Skip to content

Commit 576dd8f

Browse files
Copilotpelikhan
andauthored
Address code review: remove redundant import, document request_id regex
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 7f13654 commit 576dd8f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

actions/setup/js/parse_mcp_gateway_log.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ function writeStepSummaryWithTokenUsage(coreObj) {
222222
for (const rawLine of raw.split("\n")) {
223223
const line = rawLine.trim();
224224
if (!line) continue;
225-
// Lightweight request_id extraction for deduplication.
225+
// Lightweight request_id extraction for deduplication — mirrors extractRequestId() in
226+
// parse_token_usage.cjs. The pattern covers standard JSON escaping (\\, \") but not
227+
// exotic cases; api-proxy request IDs are UUIDs so this is sufficient in practice.
226228
const idMatch = line.match(/"request_id"\s*:\s*"((?:\\.|[^"\\])*)"/);
227229
const dedupeKey = idMatch ? `request_id:${idMatch[1]}` : line;
228230
if (seenRequestIds.has(dedupeKey)) continue;

actions/setup/js/parse_token_usage.test.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ describe("parse_token_usage", () => {
5454
});
5555

5656
test("AGENT_USAGE_JSONL_PATH points to agent_usage.jsonl", () => {
57-
const { AGENT_USAGE_JSONL_PATH } = require("./parse_token_usage.cjs");
5857
expect(AGENT_USAGE_JSONL_PATH).toBe("/tmp/gh-aw/agent_usage.jsonl");
5958
});
6059

0 commit comments

Comments
 (0)