mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 04:47:39 +00:00
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:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user