fix: disable experimental API betas by default, reduce side query token usage, standardize Headers type (#281)
* fix: disable experimental API betas by default to prevent 500 errors Tool search (defer_loading), global cache scope, and context management betas require internal Anthropic server-side support. External accounts receive 500 Internal Server Error when these are sent. Set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=true by default in the CLI entrypoint. Users with internal access can opt back in with =false. Also includes: cache key stability fixes (Sonnet 1M latch, system-before- messages key ordering, resume fingerprint isMeta skip), sideQuery default cleanup, and /dream command. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: standardize API headers to Headers type and enable tengu feature flags by default * fix: address PR review — dream lock, MCP betas guard, redundant Partial - Call recordConsolidation() programmatically in /dream instead of delegating to model prompt (unreliable) - Add CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS guard to MCP entrypoint (was only in CLI entrypoint, causing 500s in MCP server mode) - Remove redundant ? markers from SecretValueSource Partial<{}> type --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -563,7 +563,7 @@ export async function performCodexRequest(options: {
|
||||
throw APIError.generate(
|
||||
response.status, errorResponse,
|
||||
`Codex API error ${response.status}: ${errorBody}`,
|
||||
response.headers as unknown as Record<string, string>,
|
||||
response.headers as unknown as Headers,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ export async function collectCodexCompletedResponse(
|
||||
if (event.event === 'response.failed') {
|
||||
const msg = event.data?.response?.error?.message ??
|
||||
event.data?.error?.message ?? 'Codex response failed'
|
||||
throw APIError.generate(500, undefined, msg, {} as Record<string, string>)
|
||||
throw APIError.generate(500, undefined, msg, new Headers())
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -661,7 +661,7 @@ export async function collectCodexCompletedResponse(
|
||||
if (!completedResponse) {
|
||||
throw APIError.generate(
|
||||
500, undefined, 'Codex response ended without a completed payload',
|
||||
{} as Record<string, string>,
|
||||
new Headers(),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -820,7 +820,7 @@ export async function* codexStreamToAnthropic(
|
||||
if (event.event === 'response.failed') {
|
||||
const msg = payload?.response?.error?.message ??
|
||||
payload?.error?.message ?? 'Codex response failed'
|
||||
throw APIError.generate(500, undefined, msg, {} as Record<string, string>)
|
||||
throw APIError.generate(500, undefined, msg, new Headers())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user