Skip to content

fix(openai): forward CommandCode cache usage - #2

Merged
yelixir-dev merged 1 commit into
yelixir-dev:mainfrom
wingwogus:fix/forward-commandcode-cache-usage
Aug 22, 2026
Merged

yelixir-dev merged 1 commit into
yelixir-dev:mainfrom
wingwogus:fix/forward-commandcode-cache-usage

Conversation

@wingwogus

Copy link
Copy Markdown
Contributor

Summary

Forward CommandCode cache-read usage to the OpenAI-compatible prompt_tokens_details.cached_tokens field.

Scope

  • Map cachedInputTokens, with the CommandCode 1.14.0 inputTokenDetails.cacheReadTokens wire shape as a fallback.
  • Preserve 0 when upstream does not report a cache read.
  • Cover the upstream cache-read payload shape with a regression test.

This PR intentionally does not change model catalogs, versions, configuration, or tray behavior.

Verification

  • npm run verify
  • Live direct bridge request: prompt_tokens_details.cached_tokens: 7552
  • Live OpenCodex proxy request and streaming usage chunk preserve the same cache detail.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
@yelixir-dev
yelixir-dev force-pushed the fix/forward-commandcode-cache-usage branch from a28e2ee to ef7e64d Compare August 22, 2026 02:18
@yelixir-dev

Copy link
Copy Markdown
Owner

Maintainer review complete. Rebased onto current main as ef7e64d. Verified with npm run verify (typecheck, ESLint, Prettier, 215 tests, build) plus manual cache-usage checks for cachedInputTokens: 7552, nested inputTokenDetails.cacheReadTokens, and the zero fallback. Independent kimi-coding/k3 and gpt-5.6-sol reviews found no blocker. Merging via fast-forward.

@yelixir-dev
yelixir-dev merged commit ef7e64d into yelixir-dev:main Aug 22, 2026
3 checks 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.

2 participants