Commit Graph
2146 Commits
Author SHA1 Message Date
can1357 7b21704a72 merge PR #5772 via eval/pr-5772: fix(codex): force tool_choice auto on responses-lite requests 2026-07-17 04:42:11 +02:00
can1357 34cd2df096 merge PR #5758 via eval/pr-5758: fix(ai): honored kimi-k3 131k output limit 2026-07-17 04:40:05 +02:00
can1357 f59dea091c merge PR #5724 via eval/pr-5724: fix(ai): honored custom kimi anthropic base urls 2026-07-17 04:40:03 +02:00
can1357 93c6f219a5 merge PR #5723 via eval/pr-5723: fix(ai): classify 402/balance-exhausted quota errors as usage limits 2026-07-17 04:40:03 +02:00
can1357 b587da5059 merge PR #5673 via eval/pr-5673: fix(ai): recognize indented markdown fences as fenced code 2026-07-17 04:37:11 +02:00
can1357 bcc7d34a9a merge PR #5651 via eval/pr-5651: fix(cursor): gated mounted device execution through approval 2026-07-17 04:37:09 +02:00
can1357 731448c53c merge PR #5636 via eval/pr-5636: fix(ai): deferred Cursor completion until protocol end 2026-07-17 04:37:09 +02:00
can1357 2d41785b3a fix(cursor): prevent duplicate MCP execution 2026-07-17 04:18:20 +02:00
can1357 b0d04e5173 fix(ai): fixed snapshot validation for login-sourced API keys
- Added optional `source?` field with value `'login'` to `apiKeyCredentialSchema` so snapshots accept login-sourced API keys.
- Updated CHANGELOG with a fixed entry describing the correction.
- Added a test verifying that a snapshot containing `source: "login"` passes client wire validation.
2026-07-17 04:15:58 +02:00
can1357 1f0d8d9750 fix(codex): preserve Lite tool-use constraints 2026-07-17 03:57:41 +02:00
roboomp f961d824bf fix(codex): force tool_choice auto on responses-lite requests
The Responses-Lite rewrite moves tools into an `additional_tools` developer
input and deletes top-level `tools`, but preserved a forced top-level
`tool_choice` (e.g. `{ type: "web_search" }`). With no top-level tools to
validate against, the ChatGPT Codex endpoint rejected the request with
`HTTP 400 Tool choice '…' not found in 'tools' parameter`, and web search
silently fell back to Gemini.

`applyCodexResponsesLiteShape` now sets `tool_choice: "auto"`, matching
codex-rs `build_responses_request`. Classic (non-Lite) Responses requests
keep their forced choice since top-level `tools` remains present.

Fixes #5771
2026-07-16 23:42:30 +00:00
roboomp aa4386d8ca fix(ai): honored kimi-k3 131k output limit
The generic OpenAI-compatible output policy capped native K3 requests at 64,000 tokens even though its catalog metadata advertises Moonshot’s 131,072-token output limit.

- Generalized the Chat Completions provider clamp resolver.
- Allowed native moonshot/kimi-k3 to clamp against model.maxTokens.
- Preserved the existing 64k default for other OpenAI-compatible models and the existing raised GLM-5.2 reasoning clamp.
- Covered default and explicit 131,072-token K3 requests on the wire.

Fixes #5756
2026-07-16 21:50:57 +00:00
roboomp 3eda7154f9 fix(ai): honored custom kimi anthropic base urls
Derived the Anthropic Messages root from the configured OpenAI-compatible model base URL and covered custom gateway routing with a regression test.

Fixes #5722
2026-07-16 15:46:11 +00:00
metaphorics c0ec090a9c fix(ai): classify 402/balance-exhausted quota errors as usage limits
Grok Build reports exhausted account balances as HTTP 402, which bypassed credential rotation. Treat that status and wording as persistent account-local quota exhaustion while preserving informative non-quota bodies in the backoff lane.
2026-07-17 00:38:55 +09:00
roboomp e014577138 fix(ai): recognize indented markdown fences as fenced code
The fence-vs-span decision only treated a backtick run as a fenced block
when it sat immediately after a newline. CommonMark allows a fence indented
by up to three spaces, so an indented ```md block was read as an inline
span, closed at an inner triple-backtick string literal, and healed a later
literal reasoning tag as thinking.

Track the current line's leading-space count (reset on newline, invalidated
by the first non-space char) and open a fenced block when the run is >= 3
backticks at an indent of 0-3 spaces, matching the sibling FencedThinking
scanner's fence-line rule.

Fixes #5665
2026-07-16 08:14:38 +00:00
roboomp 398ab3f7b6 fix(ai): close fenced code blocks only on a fence line
Code mode treated inline spans and fenced blocks identically, closing at
the first matching backtick run anywhere in the buffer. An inline triple-
backtick literal inside a fenced block (e.g. `const fence = '```';`) exited
code mode early, so a later literal reasoning tag in the same block was
healed as thinking and dropped from the rendered code.

Track whether the opener was a fence (a backtick run >= 3 at line start) or
an inline span. A fenced block now closes only on a fence line — a line of
backticks at least as long as the opener — streaming committed lines while
holding the last partial line; inline spans keep closing on the matching
backtick run.

Fixes #5665
2026-07-16 08:03:52 +00:00
roboomp 45c7d7f173 fix(ai): keep literal think tags inside markdown code visible
ThinkingInbandScanner scanned the visible-text channel for leaked reasoning
open tags with a plain indexOf, ignoring Markdown code spans. A literal
`<think>` inside inline code or a fenced block was read as a reasoning
boundary, so the unmatched tag split the text into text + thinking and
corrupted the rendered Markdown.

The scanner now tracks code-span state: a backtick run enters code mode and
suppresses reasoning-tag detection until the matching closing run, streaming
the content through as verbatim text. Reasoning tags still win at any position
so the gemini ```thinking fence keeps healing.

Fixes #5665
2026-07-16 07:26:35 +00:00
can1357 6ae7cdbf97 feat(ai): added automatic credential rotation for invalidated OAuth tokens
- Implement `isInvalidatedOAuthTokenError` to identify specific upstream auth failures.
- Enable automatic credential rotation in `AuthStorage` and stream retries when an invalidated token is detected.
- Update `proxy.test.ts` to correctly handle `NO_PROXY` and `no_proxy` environment variables during testing.
2026-07-16 05:39:37 +02:00
can1357 1e85462cff fix: reconciled merged sources with current main APIs
- restored capability reset import in agent-session refreshSkills
- fixed renamed credential entry reference in auth-storage org fields
- aligned xai web-search fetch mock and refresh-race test with current typings
2026-07-16 03:58:41 +02:00
can1357 2c355102ce chore: applied biome formatting to merged sources 2026-07-16 03:52:48 +02:00
can1357 3a75368b92 fix(images): preserve replay and transcript invariants 2026-07-16 03:48:59 +02:00
can1357 93cc1fed1c merged PR #5417: fix(openai): render native response images
# Conflicts:
#	packages/coding-agent/src/modes/components/chat-transcript-builder.ts
#	packages/coding-agent/test/agent-session-skill-keywords.test.ts
2026-07-16 03:48:21 +02:00
can1357 6295f5cb14 merged PR #5429: fix(ai): fail over exhausted OpenRouter daily keys
# Conflicts:
#	packages/ai/src/error/rate-limit.ts
#	packages/ai/test/auth-retry.test.ts
2026-07-16 03:45:22 +02:00
can1357 8ff821515d fix(ai): honor NO_PROXY ports for secure websockets 2026-07-16 03:41:17 +02:00
can1357 a17db4bea8 merged PR #5510: fix(ai): honor proxies for Codex WebSockets
# Conflicts:
#	packages/ai/test/openai-codex-stream.test.ts
2026-07-16 03:41:16 +02:00
can1357 792f75298a fix(auth): retain targeted OAuth row after refresh races 2026-07-16 03:39:24 +02:00
can1357 908d45a98c merged PR #5519: fix(auth): serialize provider OAuth refreshes
# Conflicts:
#	packages/ai/src/auth-storage.ts
#	packages/ai/test/auth-storage-usage-cache.test.ts
2026-07-16 03:39:16 +02:00
can1357 8f6eabaa63 merged PR #5615: fix(anthropic): gate effort beta off google-vertex header path
# Conflicts:
#	packages/ai/src/providers/anthropic.ts
2026-07-16 03:34:01 +02:00
can1357 eee0bf5ac9 merged PR #5418: fix(ai): classify Anthropic spend-limit as persistent usage limit 2026-07-16 03:32:04 +02:00
can1357 8932acb6f3 fix(schema): scope boolean coercion to google transports 2026-07-16 03:31:58 +02:00
can1357 60e5074f24 merged PR #5607: fix(schema): coerce boolean subschemas for google/cca transport 2026-07-16 03:31:57 +02:00
can1357 ee7a6eb01b merged PR #5608: fix(ai): omit sampling params for OpenAI reasoning models 2026-07-16 03:31:57 +02:00
can1357 6783c3a473 merged PR #5573: fix: disable eager tool streaming for custom Anthropic endpoints 2026-07-16 03:31:57 +02:00
can1357 34870d5783 fix(ai): retain existing quota classifiers 2026-07-16 03:27:49 +02:00
can1357 d3520732b9 fix(ai): preserve main usage-limit classifiers 2026-07-16 03:27:18 +02:00
can1357 e3a7ec8802 fix(ai): classify spend limits in quota parser 2026-07-16 03:26:43 +02:00
roboomp 4a9eaf63ba fix(ai): deferred Cursor completion until protocol end
- Kept turnEnded as application-level state without settling the HTTP/2 request.
- Surfaced late CONNECT, gRPC trailer, request, and abort failures.
- Rejected streams that end before turnEnded and covered terminal lifecycle cases.

Fixes #5634
2026-07-16 01:20:05 +00:00
can1357 03c48d073b fix: fixed OpenRouter usage reconciliation and updated model catalog entries
- Applied `applyOpenRouterReportedCost` in completion parsing and shared usage population so reported OpenRouter charges are now reconciled before tier adjustment.
- Scaled usage component costs by the reported-to-estimated ratio and retained an input-only fallback when estimated totals were missing.
- Added OpenRouter-specific usage tests for SSE responses and chunk parsing to assert done-message totals and component sums match reported cost.
- Updated the model catalog with new provider/model records and revised costs, limits, and metadata.
2026-07-16 02:58:30 +02:00
roboomp 80815af78d fix(anthropic): sanitized vertex fallback effort overrides
Strip nested fallback output_config.effort values before scanning beta requirements or serializing google-vertex requests. This prevents fallback overrides from reintroducing effort-2025-11-24 into the anthropic-beta header while preserving unrelated fallback fields.

Fixes #5614
2026-07-15 20:45:29 +00:00
roboomp ae0d5054d1 fix(anthropic): gated effort beta off google-vertex header path
Thinking-enabled Claude requests routed to google-vertex pushed the
effort-2025-11-24 beta into the anthropic-beta HTTP header, which Vertex
rawPredict rejects with a 400 invalid_request_error. The effortBeta push in
streamAnthropicOnce and the output_config.effort field in buildParams lacked
the provider guard that contextManagementBeta and the thinking-context path
already apply for Vertex.

Gate both the beta and the effort field off the google-vertex path so
thinking-enabled Claude sub-agents run on Vertex without the 400.

Fixes #5614
2026-07-15 20:37:49 +00:00
roboomp cd41719757 fix(schema): stripped conditional keywords for google/cca
Added dependencies, dependentSchemas, and dependentRequired to UNSUPPORTED_SCHEMA_FIELDS so both the Google and CCA normalizers drop them before serializing to the OpenAPI-style Schema wire, which cannot model draft-2019 conditional keywords.

Kept them in the MCP subschema-map path (still coercing boolean entries) and documented the additions in CONSTRAINTS.md.

Fixes #5604
2026-07-15 19:47:02 +00:00
roboomp c6c063ee00 fix(schema): rejected not schemas on cca transport
Added not to the CCA residual incompatibility gate so false boolean subschemas fall back before reaching the legacy object-shaped parameters wire.

Made residual scanning schema-map aware to avoid treating a property literally named not as the unsupported keyword, and added root, property, and dependentSchemas regressions.

Fixes #5604
2026-07-15 19:34:49 +00:00
roboomp f6de373506 fix(ai): omitted unsupported reasoning sampling params
- Added resolved sampling-parameter compatibility for OpenAI o-series and GPT-5+ models.
- Stopped Responses and Chat Completions payloads from forwarding temperature and related controls to restricted models.
- Added catalog and wire-payload regressions for GitHub Copilot GPT-5.6 Luna.

Fixes #5606
2026-07-15 19:30:53 +00:00
roboomp da3e500637 fix(schema): handled boolean schema-map entries
Generalized the schema-map walk context beyond properties to include patternProperties, dependencies, dependentSchemas, $defs, and definitions. Each arbitrary map entry is now treated as a subschema, so bare booleans coerce before reaching Google/CCA.

Reused the shared map/array keyword tables in the Ollama sanitizer and added a dependentSchemas regression for both Google and CCA normalizers.

Fixes #5604
2026-07-15 19:27:00 +00:00
roboomp 508dbbbc5a fix(schema): coerce boolean subschemas for google/cca transport
Boolean JSON Schema subschemas (`true`/`false`, draft 6+) in MCP tool
inputs passed through normalizeSchemaForGoogle/normalizeSchemaForCCA
untouched. The Cloud Code Assist / Gemini protobuf Schema type has no
representation for a bare boolean, so requests bounced with a 400
INVALID_ARGUMENT before reaching the model.

Coerce booleans to their object equivalents (`true` -> `{}`,
`false` -> `{ not: {} }`) at the single normalizeSchemaNode choke point,
but only in genuine subschema slots (root, combiner branches,
subschema-valued keywords, property values). Keyword-slot booleans
(`nullable`, `enum` entries, `additionalProperties`) stay untouched so
Moonshot/MCP open-record markers survive.

Fixes #5604
2026-07-15 19:15:07 +00:00
roboomp ed5ec3ebdc fix(ai): handled cursor tls session errors
Attached the Cursor HTTP/2 session error path to the provider stream completion before starting the request.

Added a subprocess regression that resets the TLS handshake and verifies the turn surfaces a stream error without terminating the process.

Fixes #5593
2026-07-15 15:46:55 +00:00
roboomp 9e72202b48 fix(ai): gated custom eager streaming on compat provenance
Keyed the non-official eager opt-in on resolved officialEndpoint provenance instead of a baseUrl equality check, so runtime provider baseUrl overrides that reroute canonical Anthropic models no longer leak eager_input_streaming even when the spec baked a resolved official compat block.

Fixes #5572
2026-07-15 11:52:55 +00:00
roboomp 33bbf69f13 fix(ai): derived eager streaming from effective endpoint
Demoted eager tool input streaming when runtime Foundry routing replaces the model's configured Anthropic URL, without disabling explicit support on authored custom endpoints.

Fixes #5572
2026-07-15 11:40:02 +00:00
roboomp 375e890992 fix(ai): gated legacy anthropic beta to official endpoints
Kept strict custom proxies free of both eager_input_streaming and the legacy fine-grained tool-streaming beta while preserving the official API fallback.

Fixes #5572
2026-07-15 11:27:22 +00:00
can1357 485b31e8f1 Merge remote-tracking branch 'origin/farm/c22f93af/fix-amazon-bedrock-typeerror-undefined-includes' 2026-07-15 09:55:04 +02:00