Prevents undefined theme when extensions call ctx.ui.custom() in edge cases
where module resolution could cause the theme variable to be accessed before
initTheme() is called.
Claude models accessed through Google Cloud Code Assist API require
explicit id fields in both functionCall and functionResponse parts.
Without these IDs, the API returns 'tool_use.id: Field required' error.
Add requiresToolCallId() helper to centralize the Claude model detection
and include IDs in both tool call and tool result message conversions.
* Avoid cross-provider thought signatures
* Fix Google thought signature replay
Filter thought signatures to same provider with base64 validation and rename the transform helper for clarity.
- Store thoughtSignature on text blocks during streaming (all 3 providers)
- Replay textSignature as thoughtSignature in convertMessages
- Remove redundant conditional since retainThoughtSignature handles undefined
Per Google docs, text part signatures are optional but recommended for
high-quality reasoning in multi-turn conversations.
- isThinkingPart now only checks thought === true, not thoughtSignature
- thoughtSignature is for context replay and can appear on any part type
- Store thoughtSignature on text blocks as textSignature for proper replay
- Remove id from functionCall/functionResponse (unsupported by Vertex/Cloud Code Assist)
Refs: https://ai.google.dev/gemini-api/docs/thought-signatures
Co-authored-by: Amp <amp@ampcode.com>
Renamed from supportsStreamOptions to clarify this controls stream_options: { include_usage: true }.
Defaults to true (no behavioral change for existing providers).
Providers like gatewayz.ai that reject this parameter can set supportsUsageInStreaming: false in model config.
Based on #596 by @XesGaDeus
OpenRouter with models like openai/gpt-5.2 enforces strict mode which
requires all properties in the required array. Setting strict: false
allows optional parameters without null unions, matching the approach
already used in openai-responses.ts.
lm-studio hosted openai-like api endpoint requires this parameter to either be a defined boolean, or not specifying this option entirely. null will fail the API validation.
The zen.test.ts file was added without the standard skipIf guard,
causing CI to fail on all PRs since no OPENCODE_API_KEY is configured.
This follows the same pattern used by other API-dependent tests.