covers the 16-territory review fixes plus the triage follow-up round in coding-agent, ai, tui, and natives; also rewords the live-region IRC entries with fuller mechanism descriptions.
in-band Gemini errors, promptFeedback blocks, and missing finishReason no longer report success; toolUse override stops masking SAFETY/MALFORMED finishes; schema normalization keeps DAG-shared subtrees while detecting true cycles; Google/AWS shared credential resolution detached from first caller's signal and bounded by own timeout; Bedrock keeps toolConfig under toolChoice none; eventstream cancels body on abnormal exit.
- Fixed Azure and OpenAI response flows by using stream request options, cache metadata, and replay checks.
- Fixed Codex websocket flow by clearing runtime state on reconnect failures and OPEN-state sends.
- Fixed response parsing robustness by skipping malformed signatures and repairing orphaned outputs.
- Fixed tool/result handling by mapping unknown call IDs, splitting composite IDs, and truncating duplicates.
- Exported and applied wrapFetchForCch only for OAuth Anthropic web-search calls.
- Mapped model_context_window_exceeded to "length" and mapped unknown stop reasons to "stop".
- Adjusted header and param generation to preserve caller User-Agent and gate Claude Code betas.
- Updated stream and strict-tool retry handling to clear terminal errors and prevent regressions.
- Queued websocket transport errors without clearing previously queued stream frames.
- Handled response.incomplete stream events like completion for output IDs and stop reasons.
- Persisted final custom tool input and cleared parse buffers after tool-call completion.
- Blocked websocket connection-limit recovery when prior output existed and replay was unsafe.
- Added Anthropic request-shaping coverage for adaptive and non-adaptive models in packages/ai/test.
- Removed obsolete scratch thinking test used for commit-boundary tracing in coding-agent.
- Added Anthropic payload assertions for Claude Fable/Mythos 5 in alignment tests.
- Added role-to-system mapping test coverage for Claude Mythos 5 conversation messages.
- Added issue-1373 regression checks for Mythos default adaptive thinking on Bedrock.
- Added model policy expectations for Claude Mythos 5 generated metadata and effort mapping.
- Added cache-control regression test for empty assistant tool-call content in OpenAI completions.
- Seeded Anthropic curated fallback models into generation before discovery sources.
- Added claude-fable-5 and claude-mythos-5 model entries with 1,000,000 context and 128k max tokens.
- Enabled reasoning, text,image input, thinking controls, and larger limits across many models.
- Fixed OpenRouter Anthropic tool-call behavior for empty cache_control payloads.
- Added Anthropic Fable and Mythos support by updating model kinds, parsing, and checks.
- Set Fable/Mythos compatibility and policy values, including 1M context, 128k max tokens, and costs.
- Enabled adaptive thinking display for claude-fable-5 and claude-mythos-5 and kept output effort low when disabled.
- Adjusted forced tool-choice and cache-control behavior for unsupported features and empty text content.
The google-antigravity ranking strategy originally returned the most-pressured
counter as primary and the runner-up as secondary. AuthStorage compares the
secondary ranking metrics before primary, so credentials with a dangerous
bottleneck but a healthy runner-up counter could outrank credentials with
balanced headroom.
Return the bottleneck as secondary and the runner-up as primary, and update the
strategy contract test to lock the ordering invariant.
Fixes#2187
Cloud Code Assist's quota-exhaustion 429 carries 'You have exhausted your
capacity on this model. Your quota will reset after …'. The literal
'capacity' hit the MODEL_CAPACITY_EXHAUSTED branch in parseRateLimitReason
before the 'quota will reset' suffix had a say, downgrading the failure to
a 45-75s transient backoff; isUsageLimitError missed the same shape, so
agent-session.ts (line 8314) and auth-storage.ts (line 3457) never invoked
markUsageLimitReached. The session kept hammering the exhausted credential
while the retry layer bailed on the multi-hour retry-after, even when
sibling Antigravity OAuth accounts had headroom.
- Short-circuit parseRateLimitReason for 'quota will reset' / 'exhausted
your capacity' to QUOTA_EXHAUSTED before the MODEL_CAPACITY fallthrough.
- Extend USAGE_LIMIT_PATTERN so isUsageLimitError matches the Antigravity
phrasing too, enabling credential-rotation paths in agent-session,
auth-retry, stream, and the auth-gateway.
- Add antigravityRankingStrategy and register it under
DEFAULT_RANKING_STRATEGIES so multi-account selection consumes the
per-counter Antigravity usage report (already sorted ascending by
remainingFraction in fetchAntigravityUsage) instead of falling back to
round-robin.
- Cover the regression with parseRateLimitReason / isUsageLimitError tests
on the literal Antigravity message, plus a ranking-strategy contract
test asserting primary/secondary mapping and the 24h fallback window.
Fixes#2187
DeepSeek V4 reasoning models on api.deepseek.com emit no SSE bytes
while the model finishes its private chain-of-thought, which routinely
takes longer than the generic 100s first-event budget under load.
The OpenAI completions stream then aborts with
"OpenAI completions stream timed out while waiting for the first event"
and silently retries, doubling user-visible latency on almost every chat.
getOpenAICompletionsStreamIdleTimeoutFallbackMs now returns a 300s
floor for reasoning models when (provider === "deepseek") or
(baseUrl includes api.deepseek.com). first-event floors at idle, so
the watchdog gains 5 minutes — enough for reasoning warm-ups — without
changing steady-state streaming behavior. Mirrors the existing GLM
coding-plan widening.
Fixes#2177
- Added optional FetchImpl fields to compaction, proxy, AI, coding-agent, and mnemopi options.
- Threaded injected fetch implementations through OAuth, discovery, and search/LLM request flows.
- Removed exported hookFetch utility and its package entrypoint from utils.
- Replaced global-fetch test monkeypatching with per-test FetchImpl mocks across test suites.
- Added OpenRouter detection in openai-completions parameter construction and skipped max-token emission for non-Kimi OpenRouter routes.
- Preserved existing 64k-cap clamping behavior for non-OpenRouter requests and model-specific limits.
- Expanded max-output-token tests to cover OpenRouter omission behavior and Kimi-over-OpenRouter token handling.
- Added `AssistantMessage.upstreamProvider` and emitted it as `pi.gen_ai.response.upstream_provider` telemetry.
- Clamped OpenAI-family output caps to `OPENAI_MAX_OUTPUT_TOKENS` and model limits to avoid oversized token requests.
- Stopped aborting the shared per-request AbortController, which latched and blocked stream reopens.
- Dropped the half-built degenerate tool call and replayed the request, bounded by a retry limit of 2.
- Surfaced the original error once retries are exhausted, without polluting the message.
Interrupting the model during its visible output produced an assistant turn
whose thinking block had already finished streaming (fully signed) followed
by partial text. `transformMessages` stripped the signature from every
thinking block of an aborted/errored turn, so the valid signature was
replayed empty (`signature: ""`) and signature-enforcing Anthropic
rejected the next request with HTTP 400 "Invalid `signature` in
`thinking` block" — including when routed through an LLM gateway baseUrl.
Anthropic delivers a block's signature at `content_block_stop` before the
next block's `content_block_start`, so a thinking block followed by
text/tool_use is necessarily complete and valid. Only the single mid-stream
block at the abort point can hold a partial signature. Strip just that
final block now; completed thinking blocks keep their replayable
signatures. Abandoned end_turn+tool_use turns are unchanged (all their
signatures remain stripped).
Co-authored-by: DeprecatedLuke <16418011+DeprecatedLuke@users.noreply.github.com>
Fixes#2144
The auth-gateway client now sends `${provider}/${id}` (008981112) and the
gateway registry keys on the qualified id first. Update the stale request-shape
assertion that still expected the bare `claude-sonnet-4-5`.
Pins issue #2123: OAuth requests to adaptive-thinking Claude Opus
(4.6+) attach a 'context_management.edits[clear_thinking_20251015]'
block alongside 'thinking'. When the eager-todo prelude (and other
plan-mode paths that force tool_choice to 'tool'/'any' on the first
user turn) routes through 'disableThinkingIfToolChoiceForced',
'params.thinking' is stripped; 15.10.4 left the orphan
'params.context_management' behind, producing a 400 with
'clear_thinking_20251015 strategy requires thinking to be enabled
or adaptive'. The 15.10.5 fix in 0890b2be6 already drops both
fields together — the new repro test asserts this invariant for
both the named-tool and 'any' forced shapes so the strategy can
never outlive its enabling thinking payload again.
Fixes#2123
- Updated PI native streaming requests to send model identifiers as provider-qualified keys.
- Updated the auth-gateway model registry to store `${provider}/${id}` first and retain legacy bare IDs as fallback keys.
- Introduced filterInitialToolsForDiscoveryAll() to centralize tool filtering when discovery mode is "all", replacing inline logic in createAgentSession.
- Added forceActive parameter to ensure tools required by forced tool_choice features (e.g., eager todo) remain active in the request, preventing provider 400 errors.
- Updated eager todo enforcement to check active tool set instead of registry, ensuring it respects tool discovery hiding.
- Derived descriptors, default-model map, env keys, login list, and refresh dispatch from one ProviderDefinition per provider.
- Disabled OpenAI Codex stream obfuscation and interrupted whitespace-only tool-call argument deltas.
- Derived auth-broker callback ports and paste-code login set from the registry.