Skip to content

test(usage): add long-context token fields to the Codex fixture - #23478

Merged
Jinwoo-H merged 1 commit into
mainfrom
fix/usage-test-long-context-fixture
Sep 27, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
fix/usage-test-long-context-fixture

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6
Prod 0 0 0 0

ELI5

Main's typecheck is failing, so every open PR shows a red typecheck. Two changes merged independently, and each passed on its own, but together they broke one test file. This adds the missing fields to that test's sample data.

What Changed

src/main/usage/agent-token-usage.test.ts builds a sample Codex usage session and location breakdown. #22360 made three long-context token fields required on both types (CodexLongContextTokens). #18759 added this fixture without those fields, so pnpm run typecheck fails on main. The fixture now sets them to 0. The test's assertions don't depend on long-context counts.

Why

This is a test-only fixture fix. The product types are correct. Zero keeps the fixture's existing totals meaningful.

Linked Issue

N/A (maintainer fix for red main typecheck)

Visual Proof

N/A: test fixture only.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Before (main): pnpm run typecheck fails with 3 TS2322 errors in agent-token-usage.test.ts.

  • After: pnpm run typecheck exits 0 with no errors, and agent-token-usage.test.ts passes 4 of 4.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Test-only change. No effect on security, platform behavior, SSH, mobile, compatibility, or performance.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

#18759's test fixture predates #22360 adding required long-context token
fields to Codex session and location breakdowns, so main's typecheck fails.
@Jinwoo-H
Jinwoo-H merged commit 0547b32 into main Sep 27, 2026
8 checks passed

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Fixture now satisfies the required CodexLongContextTokens fields — sets longContextInputTokens, longContextCachedInputTokens, and longContextOutputTokens to 0 on both codexLocation and codex, unblocking main's pnpm run typecheck.

This is a mechanical test-only repair and it is correct. The three fields are required via the CodexLongContextTokens intersection on both CodexUsageLocationBreakdown (src/main/codex-usage/types.ts:52) and CodexUsageSession (:101), while codexOpenCodeTokenSessions / claudeTokenSessions (src/main/usage/agent-token-usage.ts) never read them, so the existing assertions remain meaningful. 0 is a valid subset value for a session with no long-context requests and matches every other Codex fixture in the tree. The opencode fixture inherits the fields through ...codex.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant