Skip to content

[codex] Track Codex usage and reduce repeated context#81

Merged
jamesrochabrun merged 2 commits into
mainfrom
codex/fix-token-usage-context
Jun 17, 2026
Merged

[codex] Track Codex usage and reduce repeated context#81
jamesrochabrun merged 2 commits into
mainfrom
codex/fix-token-usage-context

Conversation

@jamesrochabrun

Copy link
Copy Markdown
Owner

Summary

  • records provider-reported Codex token usage from turn.completed events and persists session/workspace totals
  • shows token usage only in DEBUG builds for now, so production users do not see confusing API-token totals
  • stops resending Codex developer instructions and Easel runtime hidden context on follow-up turns
  • adds a compact resource manifest delta hidden context for follow-up messages when project resources are added, updated, or removed
  • removes the visible return / shift-return composer hints

Why

The token badge exposed that small follow-up messages could still report very large API-token totals. Part of that was expected provider accounting, but we were also adding repeated hidden context that did not need to be resent on Codex resume turns. This PR keeps exact provider usage available for development while reducing repeated prompt payload where Easel controls it.

Validation

  • swift test in Packages/EaselClaudeCodeUI passed 124 tests
  • xcodebuild test -scheme EaselChat-Package -destination 'platform=macOS' -only-testing:EaselChatTests/EaselAgentInstructionsTests -only-testing:EaselChatTests/ChatServiceTests passed 18 focused tests
  • xcodebuild build -project Easel.xcodeproj -scheme Easel -configuration Release -destination 'platform=macOS' exited successfully
  • git diff --check clean

Note: Xcode logs still print the existing third-party SwiftLint plugin messages about missing Output folders for CodeEdit packages, even when the build/test command exits successfully.

@jamesrochabrun jamesrochabrun marked this pull request as ready for review June 17, 2026 07:51
@jamesrochabrun jamesrochabrun merged commit 88abb86 into main Jun 17, 2026
1 check passed
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