Providers: skip context1m beta for Anthropic OAuth tokens (#24620)

* Providers: skip context1m beta for Anthropic OAuth tokens

* Tests: cover OAuth context1m beta skip behavior

* Docs: note context1m OAuth incompatibility

* Agents: add context1m-aware context token resolver

* Agents: cover context1m context-token resolver

* Commands: apply context1m-aware context tokens in session store

* Commands: apply context1m-aware context tokens in status summary

* Status: resolve context tokens with context1m model params

* Status: test context1m status context display
This commit is contained in:
Vincent Koc
2026-02-23 12:29:09 -05:00
committed by GitHub
parent 28377e1b7a
commit f03ff39754
11 changed files with 248 additions and 23 deletions

View File

@@ -179,7 +179,7 @@ describe("applyExtraParamsToAgent", () => {
});
});
it("preserves oauth-2025-04-20 beta when context1m is enabled with an OAuth token", () => {
it("skips context1m beta for OAuth tokens but preserves OAuth-required betas", () => {
const calls: Array<SimpleStreamOptions | undefined> = [];
const baseStreamFn: StreamFn = (_model, _context, options) => {
calls.push(options);
@@ -220,7 +220,7 @@ describe("applyExtraParamsToAgent", () => {
// Must include the OAuth-required betas so they aren't stripped by pi-ai's mergeHeaders
expect(betaHeader).toContain("oauth-2025-04-20");
expect(betaHeader).toContain("claude-code-20250219");
expect(betaHeader).toContain("context-1m-2025-08-07");
expect(betaHeader).not.toContain("context-1m-2025-08-07");
});
it("merges existing anthropic-beta headers with configured betas", () => {