From 74710bead35ecfc54e373fc98ba473f54d927fec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Jul 2026 14:03:42 +0000 Subject: [PATCH 1/2] Initial plan From c3ab5ae7c27209fe29aa82dc10e6aeb5d4b4adb4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Jul 2026 14:23:24 +0000 Subject: [PATCH 2/2] test: smoke-claude regression tests for api-proxy token tracking --- scripts/ci/smoke-claude-workflow.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/ci/smoke-claude-workflow.test.ts b/scripts/ci/smoke-claude-workflow.test.ts index b73915b47..72c80e56b 100644 --- a/scripts/ci/smoke-claude-workflow.test.ts +++ b/scripts/ci/smoke-claude-workflow.test.ts @@ -35,6 +35,11 @@ describe('smoke claude workflow optimization config', () => { expect(source).not.toContain('source /tmp/gh-aw/agent/workflow-context.env'); expect(source).not.toContain('safeoutputs add_comment . < /tmp/gh-aw/agent/result.json'); expect(source).not.toContain('safeoutputs add_labels . < /tmp/gh-aw/agent/labels.json'); + // Token-usage verification job must be present so the api-proxy sidecar is + // always validated and token data is captured for the claude-token-usage-analyzer. + expect(source).toContain('verify_token_usage'); + expect(source).toContain('check-token-usage.js'); + expect(source).toContain('Token-usage sanity check'); }); it('compiles the workflow without playwright tools and with max-turns 8', () => { @@ -54,5 +59,12 @@ describe('smoke claude workflow optimization config', () => { expect(lock).not.toContain('playwright_prompt.md'); expect(lock).not.toContain('mcr.microsoft.com/playwright/mcp'); expect(lock).not.toContain('Show final Claude Code config'); + // The api-proxy sidecar must be enabled so Claude API calls are routed through + // it and token usage is captured for the claude-token-usage-analyzer. + expect(lock).toContain('\\"apiProxy\\":{\\"enabled\\":true'); + // The verify_token_usage job must exist and call check-token-usage.js to catch + // regressions where the api-proxy stops recording token data. + expect(lock).toContain('verify_token_usage'); + expect(lock).toContain('check-token-usage.js --artifact-root /tmp/gh-aw-agent --engine claude'); }); });