| feat(ai): add @oh-my-pi/pi-ai package with tool name prefixing
- Port pi-ai from upstream with Bun-first approach (source files, no dist)
- Add cli_ prefix to tool names in OAuth mode to avoid collisions
- Improve beta header handling with proper deduplication
- Convert codex-instructions.md to Bun text embed
- Strip .js extensions from all imports
| 4 个月前 |
| test: replaced real timers and sleeps with deterministic test hooks
- Added providerRetryWait and retryWait hooks to stream/usage options so tests bypass real scheduler delays.
- Parameterized GitHub Copilot poll intervals and Copilot model retry base delay for fast test execution.
- Replaced Bun.sleep/setTimeout polling loops with AbortSignal event listeners in agent session tests.
- Consolidated auth-gateway E2E helpers into a shared test/helpers module, eliminating duplicated checkGatewayAvailable implementations.
- Migrated credential-disabled tests from SQLite-backed stores to an in-memory store, removing temp-dir lifecycle overhead.
| 15 天前 |
| fix(ai): corrected AI abort precedence and provider stream normalization
- Fixed abort-source handling so caller aborts always win and local reasons only attach to matching request signals.
- Fixed agent-loop streaming to race event reads against abort signals and emit an aborted assistant message.
- Fixed Anthropic request construction to honor thinkingEnabled=false and omit temperature/top_p/top_k for Opus non-thinking.
- Fixed OpenAI Codex request handling by normalizing response URLs, decoding non-string websocket frames, and cleaning handshake headers.
- Added regression tests for abort precedence, Anthropic alignment cases, and Codex stream/header normalization.
- Documented the cancellation and provider behavior fixes in package changelogs.
| 30 天前 |
| fix(coding-agent): removed unnecessary awaits from non-promise function calls
- Removed await from stream() calls that return async iterables directly.
- Removed await from synchronous utility functions like findApiKey(), resolvePythonRuntime(), and getToolPath().
- Removed await from prerenderMermaid() and findExaKey() calls that don't require awaiting.
| 2 个月前 |
| fix(ai): resolved duplicated ai stream timeout handling via helpers
- Added shared timeout helpers in sdk-stream-timeout and removed duplicated inline stream timeout logic.
- Replaced inline provider timeout math with resolveSdkTimeoutMs and shared request-option builders.
- Added Codex websocket first-event and idle timeout settings via env-backed options.
- Updated Codex stream polling to apply per-phase time limits, return timeout errors, and fallback to SSE.
- Expanded abortable-iterator tests for preflight, in-flight, and leak cases around abort handling.
- Updated streamFirstEventTimeoutMs docs to document provider support and deprecated streamIdleTimeoutMs.
| 6 天前 |
| feat(mnemosyne): added session-scoped visibility, graph tools, and safety hardening
- Filtered recall, fact, vector, temporal, and polyphonic voices to session-owned or explicitly global memories.
- Implemented graph_query and graph_link MCP tool handlers via EpisodicGraph; wired annotations and graph into Mnemosyne's external-db path.
- Fixed restore to stage and integrity-check before replacing the live database, rolling back on failure.
- Deduped generateId with a per-process nonce to prevent batch duplicate-content collisions.
| 2 天前 |
| feat(ai): added Opus4.8 metadata and mapped xhigh effort tiers
- Added Opus 4.8 metadata and expanded provider entries, including Bedrock and other model variants.
- Updated models.json with additional Claude, Grok, Gemini, and Qwen entries carrying reasoning or image support.
- Adjusted Anthropic effort mapping for Opus 4.7+ to a five-tier scale and cached requireSupportedEffort results.
- Adjusted xhigh handling so legacy models now map to max and Opus 4.7+ map to low/med/high/xhigh/max.
- Updated thinking and alignment tests to expect revised xhigh/max mappings for opus47 and legacy models.
| 3 天前 |
| fix(coding-agent): fixed Anthropic fast-mode detection and scoped fast-mode icon
- Expanded isAnthropicFastModeUnsupportedError to treat 429 rate_limit_error responses mentioning fast mode as unsupported alongside 400 invalid_request_error speed-rejection cases.
- Added tests for unsupported-fast-mode detection covering 400, 429, and unrelated error payloads.
- Added AgentSession.isFastModeActive() with provider-scoped resolution and switched status-line rendering to use it for the fast-mode icon.
| 13 天前 |
| feat(ai): added image downscaling over 20 images in Anthropic prompt prep
- Updated Anthropic prompt preparation to downscale image blocks to 2000px when a request has more than 20 images.
- Added regression tests in anthropic-many-image-resize.test.ts for resizing above threshold and no-op below threshold.
| 4 天前 |
| feat(ai): added Anthropic per-model mid-conversation system-role map
- Added AnthropicCompat.supportsMidConversationSystem and AnthropicMessageParam system-role support for per-model control.
- Added supportsMidConversationSystemMessages(modelId) to return false on unknown models and true only for opus >=4.8.
- Updated convertAnthropicMessages/buildParams to map eligible developer turns to system role and keep unsupported turns as user.
- Added tests and fixtures for mid-conversation handling and documented claude-opus-4-8 Bedrock metadata in changelog.
| 3 天前 |
| fix(coding-agent): resolved OAuth token expiry flow in AuthStorage
- Centralized OAuth access lifecycle in AuthStorage, returning identity metadata and new access-result types.
- Added 60-second skew and strict expiry checks, returning undefined/throws for stale or expired OAuth credentials.
- Removed provider-local token refresh flows from Gemini, Gemini CLI, Antigravity, Kimi, and related OAuth helpers.
- Migrated web-search providers from AgentStorage to AuthStorage session-aware lookup with authStorage/sessionId/signal flow.
- Replaced findAnthropicAuth/DB auth lookup with buildAnthropicAuthConfig and explicit base-url override/env fallback ordering.
| 6 天前 |
| fix(ai): added idle timeout watchdog to OpenAI-family streaming transports
- Added idle-iterator utility to enforce maximum gaps between stream events, preventing indefinite hangs when providers stop sending mid-response. Applied watchdog to OpenAI completions, responses, Azure OpenAI responses, and Codex SSE streams with configurable timeout via PI_OPENAI_STREAM_IDLE_TIMEOUT_MS.
- Added separate first-event timeout for Codex websocket connections to quickly fall back to SSE when a prewarmed socket connects but never starts the response stream. Codex websocket now validates auth headers match before reusing connections.
- Fixed OAuth token refresh and usage lookups to respect request timeouts instead of waiting indefinitely during credential selection or rotation.
| 2 个月前 |
| fix(ai): added retry classification for unexpected socket closure errors
- Added a new isUnexpectedSocketCloseMessage helper and used it to treat socket closure failures as retryable in generic and provider-level retry checks.
- Kept Copilot-specific retry detection aligned with the new helper so transient Bun socket close errors are retried.
- Added coverage for the new retry path with Anthropic and Copilot retry tests for the Bun socket closure message.
| 1 个月前 |
| chore: reformat
| 2 天前 |
| fix: fixed idle-timeout retries, darwin-x64 ORT preload, and prefill support
- Fixed Anthropic stream idle-timeout errors incorrectly triggering provider retries after streaming had begun.
- Fixed darwin-x64 bun build --compile failure by guarding onnxruntime-node preload behind a process.platform === "win32" literal for dead-code elimination.
- Added prefill and stop parameters to the tiny-model worker's complete message type to pin output format without biasing content.
| 1 天前 |
| fix(agent): changed intent tracing marker from _i to i
- Updated the agent loop intent marker constant to use i instead of _i for tracing fields.
- Updated intent tracing documentation to describe a generic string marker field and cleanup behavior.
- Adjusted related Anthropic and coding-agent tests to match the renamed intent field via shared INTENT_FIELD usage.
| 1 个月前 |
| fix: resolved Bun HTTP/2 retry matching and thinking-only turn filtering
- Expanded transient error matching for Bun HTTP2StreamReset, RefusedStream, and EnhanceYourCalm.
- Dropped thinking-only/error/aborted turns without text/toolCall, reset aborted tool-call map, and stored timestamps.
- Updated TUI render planning to track scrollback high-water and suppress suffix-scroll artifacts in non-multiplexer sessions.
- Added regression tests and changelog notes for Bun HTTP/2 retry handling, thinking-only filtering, and scrollback regressions.
| 6 天前 |
| fix(ai): resolved strict-mode local-ref inlining and single-item allOf
- Added strict-mode ref preprocessing to resolve local #/ refs with sibling-key precedence.
- Added single-item allOf handling that inlines the sole schema entry and retains multi-item allOf.
- Added Anthropic schema normalization to retain whitelisted metadata and enforce stricter key handling.
- Added Google schema sanitizer options for snake_case renaming, null-collapse behavior, and ordering.
- Expanded schema tests for Anthropic, Google, and strict-mode parity across refs, arrays, and recursion.
| 16 天前 |
| chore: remove garbage tests
| 20 天前 |
| fix(ai): persist final tool-call args on output_item.done finalization
The per-delta streaming-parse throttle (parseStreamingJsonThrottled) can
skip the last partial re-parse of a tool-call's arguments. For OpenAI
Responses and Codex streams that finalize a function_call via
response.output_item.done WITHOUT a trailing
response.function_call_arguments.done event, the handler built a fresh
toolCall with the authoritative full-buffer parse for the emitted
toolcall_end event but never wrote those args back to the block stored in
output.content. The persisted assistant message therefore retained the
last throttled partial parse (often {}), so subsequent tool execution and
history replay used stale/empty arguments.
Write the authoritative final args onto the persisted block before
dropping the streaming bookkeeping in both handlers.
Also update the stale codex idle-timeout test: bc7afc143 began stripping
partialJson/lastParseLen on finalization, but its expectation still
required partialJson: "" on a block finalized via output_item.done.
Tests: add regression coverage in both providers driving throttled deltas
that finalize via output_item.done with no args.done event, asserting the
persisted block carries the full parsed arguments and no streaming
internals. Verified both fail without the source fix.
| 1 天前 |
| feat(auth): added auth-broker for remote credential vault
- Added AuthBrokerClient, RemoteAuthCredentialStore, AuthBrokerRefresher, and startAuthBroker server in packages/ai/src/auth-broker.
- Renamed AuthCredentialStore class to SqliteAuthCredentialStore; extracted AuthCredentialStore as a persistence interface.
- Added exportSnapshot, forceRefreshCredentialById, disableCredentialById, and upsertCredential to AuthStorage for broker wire protocol.
- Added omp auth-broker CLI subcommand (serve, token, login, logout, import, status) and discoverAuthStorage broker-mode path keyed on OMP_AUTH_BROKER_URL.
| 15 天前 |
| feat(auth-broker): added auth-broker /v1/snapshot/stream SSE support
- Added /v1/snapshot/stream SSE support and discriminated snapshot/entry/removed event payload contracts.
- Added openSnapshotStream() with abort handling, unsupported-stream errors, and filtered SSE payload parsing.
- Added streamSnapshots as default-true in remote store with SSE-first background syncing and 404-based fallback.
- Added per-credential generation tracking and streamKeepaliveMs tuning for long-lived SSE connections.
| 6 天前 |
| test(ai): fixed SSE test structure and added keepalive parsing coverage
- Restructured the auth-broker openSnapshotStream tests to be top-level cases under the describe suite.
- Added a stream parser test asserting pure ": keepalive" lines are not included in subsequent SSE event raw output.
| 6 天前 |
| test: replaced real timers and sleeps with deterministic test hooks
- Added providerRetryWait and retryWait hooks to stream/usage options so tests bypass real scheduler delays.
- Parameterized GitHub Copilot poll intervals and Copilot model retry base delay for fast test execution.
- Replaced Bun.sleep/setTimeout polling loops with AbortSignal event listeners in agent session tests.
- Consolidated auth-gateway E2E helpers into a shared test/helpers module, eliminating duplicated checkGatewayAvailable implementations.
- Migrated credential-disabled tests from SQLite-backed stores to an in-memory store, removing temp-dir lifecycle overhead.
| 15 天前 |
| feat: added auth-gateway usage cache with single-flight 15s ttl fallback
- Added AbortSignal propagation and timeout-race handling for broker health, usage, refresh, and snapshot calls.
- Added single-flight usage-report caching with 15s TTL, per-caller abort races, and null-on-fail fallback.
- Expanded provider schemas and parse/build logic for cache metadata, headers, stop controls, and image/file content.
- Hardened auth flows by rejecting refresh sentinels and using timing-safe bearer-token comparisons.
| 15 天前 |
| test: replaced real timers and sleeps with deterministic test hooks
- Added providerRetryWait and retryWait hooks to stream/usage options so tests bypass real scheduler delays.
- Parameterized GitHub Copilot poll intervals and Copilot model retry base delay for fast test execution.
- Replaced Bun.sleep/setTimeout polling loops with AbortSignal event listeners in agent session tests.
- Consolidated auth-gateway E2E helpers into a shared test/helpers module, eliminating duplicated checkGatewayAvailable implementations.
- Migrated credential-disabled tests from SQLite-backed stores to an in-memory store, removing temp-dir lifecycle overhead.
| 15 天前 |
| feat: added auth-gateway usage cache with single-flight 15s ttl fallback
- Added AbortSignal propagation and timeout-race handling for broker health, usage, refresh, and snapshot calls.
- Added single-flight usage-report caching with 15s TTL, per-caller abort races, and null-on-fail fallback.
- Expanded provider schemas and parse/build logic for cache metadata, headers, stop controls, and image/file content.
- Hardened auth flows by rejecting refresh sentinels and using timing-safe bearer-token comparisons.
| 15 天前 |
| fix: resolved auth-gateway handling of 429 usage-limit responses
- Classified usage-limit gateway responses as 429 rate_limit_error in auth handling paths.
- Aligned auth-gateway and pi-native key retrieval with derived sessionId for getApiKey lookups.
- Handled usage-limit auth failures by rotating credentials with retry hints and returning undefined when none available.
- Replaced stream auth checks with retryable-upstream logic for 401 and usage-limit errors before content.
- Expanded extractRetryHint parsing for ~, sec, ms, and minute/hour units.
- Added coverage for classifyGatewayError, retry-hint parsing variants, and stream-auth retry edge cases.
| 4 天前 |
| test: replaced real timers and sleeps with deterministic test hooks
- Added providerRetryWait and retryWait hooks to stream/usage options so tests bypass real scheduler delays.
- Parameterized GitHub Copilot poll intervals and Copilot model retry base delay for fast test execution.
- Replaced Bun.sleep/setTimeout polling loops with AbortSignal event listeners in agent session tests.
- Consolidated auth-gateway E2E helpers into a shared test/helpers module, eliminating duplicated checkGatewayAvailable implementations.
- Migrated credential-disabled tests from SQLite-backed stores to an in-memory store, removing temp-dir lifecycle overhead.
| 15 天前 |
| chore: reformat
| 2 天前 |
| test(tests): updated test setup to use shared E2E helpers and reset settings
- Updated the auth-gateway OpenAI responses caching test to use shared E2E helper utilities and the common gateway URL constant.
- Initialized and reset in-memory settings in the nested live rendering test fixture to isolate test state between runs.
| 5 天前 |
| feat: added auth-gateway usage cache with single-flight 15s ttl fallback
- Added AbortSignal propagation and timeout-race handling for broker health, usage, refresh, and snapshot calls.
- Added single-flight usage-report caching with 15s TTL, per-caller abort races, and null-on-fail fallback.
- Expanded provider schemas and parse/build logic for cache metadata, headers, stop controls, and image/file content.
- Hardened auth flows by rejecting refresh sentinels and using timing-safe bearer-token comparisons.
| 15 天前 |
| feat(ai): added pi-native auth-gateway transport
- Added POST /v1/pi/stream endpoint that accepts canonical Context directly, skipping wire-format translation layers.
- Added client-side streamPiNative dispatch activated via Model.transport = "pi-native".
- Propagated transport field through model registry, provider overrides, and models.yml schema.
- Refactored deriveSessionId to accept explicit arguments instead of ParsedFormatRequest.
| 15 天前 |
| chore: reformat
| 2 天前 |
| fix(coding-agent): resolved OAuth token expiry flow in AuthStorage
- Centralized OAuth access lifecycle in AuthStorage, returning identity metadata and new access-result types.
- Added 60-second skew and strict expiry checks, returning undefined/throws for stale or expired OAuth credentials.
- Removed provider-local token refresh flows from Gemini, Gemini CLI, Antigravity, Kimi, and related OAuth helpers.
- Migrated web-search providers from AgentStorage to AuthStorage session-aware lookup with authStorage/sessionId/signal flow.
- Replaced findAnthropicAuth/DB auth lookup with buildAnthropicAuthConfig and explicit base-url override/env fallback ordering.
| 6 天前 |
| feat(ai): added strict auth-gateway mode with completion-probe checks
- Added strict auth-gateway check mode, propagated --strict, and updated strict output/exit rules.
- Added checkCredentials completion-probe support with timeout and provider-aware payload helpers.
- Changed OAuth credential checks to refresh first, preserve usage results, and skip completion on refresh failures.
- Added tests for completion-probe execution, OAuth refresh rejection, and completion.reason/sentinel behavior.
| 4 天前 |
| feat(auth): added auth-broker for remote credential vault
- Added AuthBrokerClient, RemoteAuthCredentialStore, AuthBrokerRefresher, and startAuthBroker server in packages/ai/src/auth-broker.
- Renamed AuthCredentialStore class to SqliteAuthCredentialStore; extracted AuthCredentialStore as a persistence interface.
- Added exportSnapshot, forceRefreshCredentialById, disableCredentialById, and upsertCredential to AuthStorage for broker wire protocol.
- Added omp auth-broker CLI subcommand (serve, token, login, logout, import, status) and discoverAuthStorage broker-mode path keyed on OMP_AUTH_BROKER_URL.
| 15 天前 |
| feat(auth): added auth-gateway forward-proxy and broker usage/migrate endpoints
- Added omp auth-gateway serve/token/status — a forward-proxy injecting broker credentials for OpenAI Chat, Anthropic Messages, and OpenAI Responses wire formats.
- Added GET /v1/usage to auth-broker and auth-gateway; usage cache switched to 5-min per-credential TTL with jitter and last-good fallback on failure.
- Added AuthStorage.setConfigApiKey/removeConfigApiKey/clearConfigApiKeys so models.yml apiKey beats OAuth tokens without overriding --api-key.
- Added omp auth-broker migrate --from-local for idempotent upload of local SQLite/env credentials to the broker.
| 15 天前 |
| fix(ai,coding-agent): close OAuth lifecycle gaps from the AuthStorage rework
Centralizing OAuth refresh in AuthStorage (e6893515) introduced five
follow-on bugs surfaced by an audit of the commit; this fixes all of
them and updates the tests that relied on the old refresh seam.
1. packages/ai/src/auth-storage.ts (#tryOAuthCredential):
For built-in providers the path went directly to getOAuthApiKey
with the (possibly still-expired) selection.credential when the
pre-refresh at line 2587 caught a transient error. getOAuthApiKey
then threw the "expired … must be refreshed via AuthStorage"
precondition error, which the disable classifier matched against
/expired.*refresh/ and soft-disabled the row. A single network
blip during refresh could permanently kill a still-valid Anthropic /
OpenAI / Gemini-CLI / Copilot credential. Built-in providers now
route through the broker-aware single-flighted
#refreshOAuthCredential first, so transient failures surface as
network errors (5-min temp block) instead of definitive auth
failures.
2. packages/ai/src/auth-storage.ts (#fetchUsageUncached):
The usage refresh check only fired once Date.now() >= expiresAt,
missing the 60-second skew that getApiKey honors. A token
expiring inside the skew window was posted to the usage endpoint
and 401'd mid-flight, briefly hiding quota in the UI. Aligned with
OAUTH_REFRESH_SKEW_MS.
3. packages/coding-agent/src/web/search/index.ts (webSearchCustomTool):
The CustomTool counterpart of WebSearchTool dropped sessionId so
SDK callers that opted into web_search via toolNames lost
per-session credential stickiness — multi-account users saw the
provider round-robin between searches in the same session. Threads
ctx.sessionManager.getSessionId() through to executeSearch.
4. packages/coding-agent/src/web/search/providers/perplexity.ts
(findOAuthToken):
authStorage.getApiKey("perplexity") returns runtime/config
overrides, stored api_key credentials, OAuth bearers, and env keys.
Filtering only env keys meant a config-pinned pplx-… API key was
POSTed to www.perplexity.ai/rest/sse/perplexity_ask (the OAuth
endpoint) instead of falling through to
api.perplexity.ai/chat/completions, producing 401s. Switched to
getOAuthAccess so only true OAuth bearers reach the OAuth
branch; api_key credentials/overrides correctly fall through.
5. packages/ai/scripts/generate-models.ts:
getOAuthApiKey was being called directly with possibly-expired
credentials. The new contract throws on expired, the broad catch
swallowed it, and the build silently fell back to bundled models
instead of refreshing. Both helpers now route through
AuthStorage's getApiKey / getOAuthAccess, which trigger the
full broker-aware refresh pipeline.
Test updates:
- auth-storage-credential-disabled-event.test.ts,
sdk-credential-disabled-bridge.test.ts: the failOAuthRefresh
helper used to spy on getOAuthApiKey to inject invalid_grant.
With refresh now happening before that helper, the spy never fired.
Switched to spying on refreshOAuthToken so the simulated failure
reaches the disable classifier.
- auth-storage-rotation.test.ts: stub refreshOAuthToken so the test
doesn't hit a real OAuth endpoint when the seeded credential lands
inside the 60s skew window.
| 6 天前 |
| chore: reformat
| 2 天前 |
| fix(ai): fixed OAuth refresh race by coalescing concurrent credential refreshes
- Added a per-credential in-flight refresh map in AuthStorage and returned existing promises for concurrent OAuth refreshes.
- Updated OAuth API-key retrieval to share refreshes and persist refreshed candidate credentials.
- Added tests covering preflight persistence across multiple credentials and ensuring concurrent refreshes coalesced to one call.
| 6 天前 |
| fix(coding-agent): resolved OAuth token expiry flow in AuthStorage
- Centralized OAuth access lifecycle in AuthStorage, returning identity metadata and new access-result types.
- Added 60-second skew and strict expiry checks, returning undefined/throws for stale or expired OAuth credentials.
- Removed provider-local token refresh flows from Gemini, Gemini CLI, Antigravity, Kimi, and related OAuth helpers.
- Migrated web-search providers from AgentStorage to AuthStorage session-aware lookup with authStorage/sessionId/signal flow.
- Replaced findAnthropicAuth/DB auth lookup with buildAnthropicAuthConfig and explicit base-url override/env fallback ordering.
| 6 天前 |
| fix(ai): resolved OAuth refresh failures by disabling creds
- Replaced inline definitive-failure checks with shared isDefinitiveOAuthFailure in auth-storage and refresher.
- Disabled credentials during definitive OAuth refresh failures and captured the disabling cause on the credential row.
- Wrote null usage-cache entries with expiresAt set to 0 when credentials were disabled to prevent stale reports.
- Added tests for invalid_grant and transient OAuth refresh outcomes, including cache and credential-state assertions.
- Updated Unreleased changelog notes to document OAuth refresh fixes and stale usage-cache clearing behavior.
| 5 天前 |
| fix(ai): support credential_process profiles in AWS credential resolver
readProfileCredentials now checks for a credential_process key after
the static-keys and SSO branches. The helper is spawned via Bun.spawn
with stdin ignored; stdout is parsed as the AWS SDK Version 1 JSON
envelope; Expiration feeds the existing per-profile cache so re-invocations
honour the broker's TTL.
Additional coverage:
- POSIX-shell tokenizer preserves backslashes inside double quotes so
Windows paths like "C:\\Program Files\\auth.exe" tokenize correctly.
- .cmd/.bat helpers are routed through cmd.exe /c on Windows.
- AbortSignal is forwarded to the child process.
- 13 new tests covering tokenizer edge cases, envelope validation,
cache hit-count, non-zero exit stderr surfacing, and abort propagation.
Fixes #1142
| 15 天前 |
| feat(ai): added AWS auth and Bedrock stream decoding with SigV4
- Removed deprecated AWS/Google client and proxy dependencies from root and AI package manifests.
- Added AWS credential chaining, SigV4 signing, and Bedrock stream decoding with region fallback and CRC checks.
- Added local Google type mirrors and migrated providers to request plans with SSE fetch and token-based auth.
- Updated AI changelog with auth/stream fixes, and added fetch-stub and SigV4/event-stream tests.
| 15 天前 |
| feat(ai): added AWS auth and Bedrock stream decoding with SigV4
- Removed deprecated AWS/Google client and proxy dependencies from root and AI package manifests.
- Added AWS credential chaining, SigV4 signing, and Bedrock stream decoding with region fallback and CRC checks.
- Added local Google type mirrors and migrated providers to request plans with SSE fetch and token-based auth.
- Updated AI changelog with auth/stream fixes, and added fetch-stub and SigV4/event-stream tests.
| 15 天前 |
| fix(ai): corrected AI tool handling via JSON-schema validation flow
- Replaced fromTypeBox conversion with a JSON-schema validator flow in ai tool handling and execution paths.
- Added recursive schema validation and expanded TypeBox checks for refs, enums, uniqueItems, and constraint keywords.
- Sanitized Azure/CCA tool schemas by dropping unsupported fields and rewriting oneOf tool branches as anyOf.
- Tightened argument and model-config validation, preserving unknown tool fields and adding apiKey plus compatibility flags.
| 17 天前 |
| Merge PR #148
| 3 个月前 |
| feat: added serviceTier option and providerPayload field to OpenAI providers
- Added serviceTier option to OpenAI providers for controlling processing priority and cost across agent, completions, responses, and codex APIs.
- Added providerPayload field to messages for transport-native history reconstruction in OpenAI Responses and Codex APIs.
- Added /fast slash command and serviceTier setting to coding-agent for toggling OpenAI priority mode with fast mode indicator.
- Added remote compaction support with encrypted reasoning preservation for OpenAI models in coding-agent.
- Removed usage caching layer across all providers and refactored UsageFetchContext to eliminate cache and now dependencies.
- Fixed OpenAI Codex streaming service_tier inclusion, provider retry logic with exponential backoff, and email-based credential deduplication.
| 2 个月前 |
| test(ai): fixed lint warning and vi.fn parameter inference
pi-native-client: dropped the ${baseUrl} placeholder from an it() name; biome's noTemplateCurlyInString warned because the literal isn't a template string. Replaced with <baseUrl> which keeps the descriptive intent without the false positive.
claude-usage-retry: typed the vi.fn callback as (delayMs, signal?) so tsgo can infer Parameters<T> as a 2-tuple. Without param types, T narrows to () => void and retryWait.mock.calls[0]?.[0] errored as 'tuple of length 0 has no element at index 0'.
| 15 天前 |
| feat: added ordered systemPrompt arrays and normalized context prompts
- Converted systemPrompt APIs and state types to ordered string[] across agent, AI, and coding-agent surfaces.
- Added normalizeSystemPrompts and applied it to context normalization before building provider request payloads.
- Updated AI providers to emit separate normalized prompt blocks/messages instead of a single merged system prompt.
- Removed dedicated projectPrompt state and remapped that context into system-context buckets in session, dump, and token accounting.
- Aligned tests and changelogs to pass and assert systemPrompt as arrays with ordered prompt semantics.
| 28 天前 |
| fix: resolved Bun HTTP/2 retry matching and thinking-only turn filtering
- Expanded transient error matching for Bun HTTP2StreamReset, RefusedStream, and EnhanceYourCalm.
- Dropped thinking-only/error/aborted turns without text/toolCall, reset aborted tool-call map, and stored timestamps.
- Updated TUI render planning to track scrollback high-water and suppress suffix-scroll artifacts in non-multiplexer sessions.
- Added regression tests and changelog notes for Bun HTTP/2 retry handling, thinking-only filtering, and scrollback regressions.
| 6 天前 |
| chore: reformat
| 2 天前 |
| fix(ai): replay openrouter deepseek reasoning content
Normalized OpenRouter reasoning replay back to DeepSeek's required reasoning_content field for exact-replay providers.
Added regression coverage for OpenRouter DeepSeek V4 tool-call continuations.
Fixes #1445
| 5 天前 |
| fix(ai): corrected transformMessages to emit toolResult before placeholder
- Adjusted transformMessages to emit delayed real toolResults before synthetic placeholders.
- Preferred late real results for pending aborted calls, preventing stale synthetic aborted outputs.
- Adjusted toolCallStatus checks to skip tool results once a call has already been emitted.
| 5 天前 |
| fix(ai): removed streaming throttles for immediate assistant delta delivery
- Removed delta-event throttling and merge logic so AssistantMessageEventStream now enqueues assistant deltas without batching.
- Stopped debouncing preview-diff generation in ToolExecutionComponent so apply_patch argument updates trigger immediate preview refresh.
- Added tests covering immediate delta queueing and confirming streaming arg updates no longer schedule setTimeout callbacks.
| 25 天前 |
| fix(ai): apply Kimi K2 max_tokens default to firepass router
Cross-checks PR #1199 against the official Fireworks documentation
(https://docs.fireworks.ai/models/kimi-k2,
https://docs.fireworks.ai/guides/reasoning,
https://docs.fireworks.ai/guides/function-calling,
https://docs.fireworks.ai/guides/reliability) and addresses the one
real gap that survives that cross-check.
Real defect (per Kimi K2 docs)
------------------------------
The Kimi K2 family "can produce very long reasoning traces before
arriving at a final answer" and the docs say to "always set max_tokens
explicitly". The openai-completions provider already enforces this for
moonshot-prefixed Kimi ids:
const isKimi = model.id.includes("moonshotai/kimi");
const effectiveMaxTokens = options?.maxTokens ?? (isKimi ? model.maxTokens : undefined);
but firepass/kimi-k2.6-turbo carries the catalog id kimi-k2.6-turbo
and the wire id accounts/fireworks/routers/kimi-k2p6-turbo — neither
matches moonshotai/kimi, so callers who omit maxTokens would hit
the documented runaway path. Broaden isKimi to the same regex the
compat detector already uses (/^kimi[-.]/i) so every Kimi-family
entry on every OpenAI-compatible host inherits the safety net.
Codex P2 (discussion r3265122224): not a bug
--------------------------------------------
Codex flagged that firepass/kimi-k2.6-turbo:xhigh would 400 against
Fireworks. A live probe with a real fpk_… key against the router
returns the router's own validation message:
Input should be 'low', 'medium', 'high', 'xhigh', 'max' or 'none'
xhigh is therefore a first-class effort tier on this endpoint, not
an alias for max — the same prompt produces distinct reasoning
budgets (669 vs 642 completion tokens, 1586 vs 1309 reasoning chars).
Adding compat.reasoningEffortMap.xhigh: "max" would silently
downgrade users who select the model's top tier, so the entry is left
without a remap. A new regression test asserts the passthrough so a
future "defensive" mapping cannot sneak back in.
Verification
------------
- bun test packages/ai/test/firepass.test.ts → 4 pass (added two
regressions: xhigh passthrough, and catalog max_tokens injected
on omission). Confirmed both fail on the parent commit:
* passthrough fails with the old behavior would-be max,
* max_tokens fails with Received: undefined.
- bun run check (biome + tsgo) clean in packages/ai.
- Live smoke (packages/ai/test/firepass.live.ts, env-gated, manual)
against the live Fire Pass router with a real key confirmed:
* wire id → accounts/fireworks/routers/kimi-k2p6-turbo
* max_tokens default fires (65536)
* xhigh accepted (stop reason stop, real completion text)
* garbage_value 400s with the router enumerating the accepted set
The same broadened isKimi regex also closes the gap for the existing
fireworks/kimi-k2.5 and fireworks/kimi-k2.6 entries, which carried
the same pre-existing under-detection.
| 12 天前 |
| fix(ai): fixed Kimi regex to match path-prefixed router model IDs
- Changed ^kimi[-.]/i to (^|\/)kimi[-.]/i so Fireworks router IDs like accounts/fireworks/routers/kimi-k2p6-turbo correctly trigger Kimi-specific max_tokens behavior.
- Applied the same fix in both the compat detector and buildParams.
- Added a regression test covering the canonical Fire Pass router ID format.
| 12 天前 |
| fix(ai): restore Copilot reasoning controls
fixes #773
| 1 个月前 |
| fix(ai): retry GitHub Copilot transient model_not_supported 400s
GitHub Copilot intermittently returns HTTP 400 model_not_supported
for preview models (gpt-5.3-codex, gpt-5.4, gpt-5.4-mini, ...) on OAuth
clients other than VS Code, even when /models reports the model as
enabled. Root cause is a per-OAuth-client rollout gap across Copilot's
responses backend; repeating the identical request typically lands on
a backend that has the model. See opencode#13313.
- Add isCopilotTransientModelError and callWithCopilotModelRetry
in utils/retry (3 attempts, linear backoff, abort-aware, no-op
for non-Copilot providers).
- Wrap client.responses.create in openai-responses and the
initial completions stream in openai-completions with the retry.
- Extend Anthropic isProviderRetryableError to treat Copilot
transient model errors as provider-retryable.
- Rename rewriteCopilotAuthError to rewriteCopilotError and add
a 400 model_not_supported rewrite surfacing actionable guidance
(retry, switch to a GA model, or run from VS Code) after retries
exhaust.
- Rename test file accordingly and add a dedicated retry unit test.
| 1 个月前 |
| feat: add GPT-5.4 mini and nano models (#476)
* feat: add GPT-5.4 mini and nano models
* fix: address GPT-5.4 review feedback | 2 个月前 |
| test: replaced real timers and sleeps with deterministic test hooks
- Added providerRetryWait and retryWait hooks to stream/usage options so tests bypass real scheduler delays.
- Parameterized GitHub Copilot poll intervals and Copilot model retry base delay for fast test execution.
- Replaced Bun.sleep/setTimeout polling loops with AbortSignal event listeners in agent session tests.
- Consolidated auth-gateway E2E helpers into a shared test/helpers module, eliminating duplicated checkGatewayAvailable implementations.
- Migrated credential-disabled tests from SQLite-backed stores to an in-memory store, removing temp-dir lifecycle overhead.
| 15 天前 |
| fix(ai): used copilot context window limit
Mapped GitHub Copilot OAuth discovery context windows from max_context_window_tokens before prompt budgets.
Kept output token mapping on max_output_tokens and covered the fallback order in Copilot model limit tests.
Fixes #1539
| 2 天前 |
| fix: github.com enterprise routing and structured Copilot OAuth credentials
| 1 个月前 |
| fix: github.com enterprise routing and structured Copilot OAuth credentials
| 1 个月前 |
| fix(ai): restore Copilot reasoning controls
fixes #773
| 1 个月前 |
| chore: remove garbage tests
| 20 天前 |
| fix: resolved auth-gateway handling of 429 usage-limit responses
- Classified usage-limit gateway responses as 429 rate_limit_error in auth handling paths.
- Aligned auth-gateway and pi-native key retrieval with derived sessionId for getApiKey lookups.
- Handled usage-limit auth failures by rotating credentials with retry hints and returning undefined when none available.
- Replaced stream auth checks with retryable-upstream logic for 401 and usage-limit errors before content.
- Expanded extractRetryHint parsing for ~, sec, ms, and minute/hour units.
- Added coverage for classifyGatewayError, retry-hint parsing variants, and stream-auth retry edge cases.
| 4 天前 |
| fix(coding-agent): resolved OAuth token expiry flow in AuthStorage
- Centralized OAuth access lifecycle in AuthStorage, returning identity metadata and new access-result types.
- Added 60-second skew and strict expiry checks, returning undefined/throws for stale or expired OAuth credentials.
- Removed provider-local token refresh flows from Gemini, Gemini CLI, Antigravity, Kimi, and related OAuth helpers.
- Migrated web-search providers from AgentStorage to AuthStorage session-aware lookup with authStorage/sessionId/signal flow.
- Replaced findAnthropicAuth/DB auth lookup with buildAnthropicAuthConfig and explicit base-url override/env fallback ordering.
| 6 天前 |
| feat(ai): added AWS auth and Bedrock stream decoding with SigV4
- Removed deprecated AWS/Google client and proxy dependencies from root and AI package manifests.
- Added AWS credential chaining, SigV4 signing, and Bedrock stream decoding with region fallback and CRC checks.
- Added local Google type mirrors and migrated providers to request plans with SSE fetch and token-based auth.
- Updated AI changelog with auth/stream fixes, and added fetch-stub and SigV4/event-stream tests.
| 15 天前 |
| build(config): refactored build and TypeScript configuration with Bun loaders
- Removed WASM generation script; use Bun wasm?raw loader for imports.
- Added bunfig.toml with loaders for .md, .py, and .wasm?raw text imports.
- Added types/assets/index.d.ts for global TypeScript module declarations.
- Unified TypeScript configuration with tsgo-based checking across monorepo.
- Removed build and WASM steps from install and publish pipelines.
| 4 个月前 |
| fix(coding-agent,ai): file-lock race + render-utils sanitization + google named-tool routing
F1 (coding-agent): close the withFileLock mkdir-vs-writeLockInfo race that
let a losing contender wipe the winner's freshly-created lock directory.
Every lock now carries a per-process UUID token; releaseLock verifies the
token before fs.rm, and isLockStale no longer treats an info-less but
fresh dir (or a dir that vanished mid-check) as stale.
F4 (coding-agent): sanitize tabs and truncate oversized error strings in
formatErrorMessage so error renderings that embed file content
(apply_patch, hashline, etc.) cannot break terminal alignment or
overflow the line width.
F7 (ai): support named-tool routing on Google providers. Widens
GoogleSharedStreamOptions.toolChoice and GoogleGeminiCliOptions.toolChoice
to accept { mode: 'ANY'; allowedFunctionNames }. mapGoogleToolChoice
now converts ToolChoice { type: 'tool'|'function', name } to the wire
shape (mirroring mapAnthropicToolChoice). buildGoogleGenerateContentParams
and the gemini-cli request serializer honor the allow-list.
| 1 天前 |
| feat(ai): added unified normalize flow for Google/CCA schema handling
- Implemented a unified normalization flow by switching Google/CCA handling to normalizeSchemaForGoogle/CCA.
- Added normalize.ts with recursive node normalization, nullable-union checks, and combiner collapsing.
- Removed sanitize-google.ts and normalize-cca.ts, replacing them with normalize exports in schema indexes.
- Added spill-to-description utilities with spill/paren modes and $defs exclusion for unsupported fields.
- Updated MCP bridge and schema tests to use normalizeSchemaFor* APIs with expanded compatibility checks.
- Documented normalization behavior changes and breaking rename in constraints and package changelog files.
| 16 天前 |
| fix(ai): routed vertex claude through raw predict
Mapped Google Vertex Claude catalog entries to the Anthropic messages transport, rewrote placeholder rawPredict URLs with ADC auth, and covered the request URL and payload shape.
Fixes #1456
| 4 天前 |
| feat(deps): added pi.zod exports and removed TypeBox package exports
- Added canonical pi.zod schema API exports and removed TypeBox package exports/imports.
- Migrated Tool schema typing from TypeBox to shared TSchema/Zod flow with legacy TypeBox compatibility.
- Updated AI provider adapters and MCP/agent builders to convert tool params through toolWireSchema().
- Reworked schema validation from AJV to Zod-safe parsing with fromTypeBox, toolWireSchema, and meta schema checks.
| 17 天前 |
| fix: resolved AI/OAuth helper duplication via shared modules
- Standardized missing-file read errors and now return File not found: <path> for absent edit targets.
- Centralized AI provider, usage, and OAuth helpers into shared modules to remove duplicated logic.
- Migrated OAuth/API-key login flows to shared factory helpers and removed inline prompt/token-exchange code.
- Reused shared tools and formatter utilities for discovery, stream tails, LSP batching, and source formatting.
- Consolidated repeated test helpers and fixtures into shared modules, replacing inline helper duplicates.
| 1 个月前 |
| chore: reformat
| 2 天前 |
| fix(ai): parse MiniMax CN think tags
| 13 天前 |
| fix(ai): fixed DeepSeek V4 direct API reasoning payload handling
- Updated DeepSeek V4 direct API compat to map unsupported low reasoning levels to high, use max_tokens, set thinking mode, and suppress tool_choice on tool-call requests.
- Adjusted OpenAI compat detection and resolution to specially handle direct DeepSeek reasoning flows while preserving OpenRouter behavior and merging model-provided compat overrides.
- Added regression coverage for issue #1207 and updated DeepSeek model tests to assert the new reasoning mapping, payload shape, and tool-call requirements.
| 12 天前 |
| fix(ai): guarded hasToolHistory branch on context.tools === undefined
The previous fix stopped empty context.tools from routing through
convertTools (.length guard), but when a session has prior tool history
the empty array fell through to the hasToolHistory sentinel, which still
emitted tools:[] on the wire. LiteLLM → Bedrock serializes any tools
array as toolConfig, and Bedrock rejects an empty toolConfig whenever
the conversation has toolUse/toolResult content.
The sentinel exists to satisfy Anthropic-via-proxy, which requires the
tools param when the conversation has tool history even if no tools are
offered this turn. Scope it to context.tools === undefined (caller did
not specify tools at all) so an explicit context.tools = [] — the /btw
and IRC side-channel opt-out shape from AgentSession.runEphemeralTurn
— is honoured and produces no tools field on the wire.
Add a regression test that covers the exact /btw-after-agentic-turn
scenario: context.tools = [], tool history in messages, toolChoice none.
| 12 天前 |
| test(ai): adjusted issue-1270 repro test token endpoint mocks
- Added constants for OAuth and metadata token endpoints in the Vertex AI repro test.
- Expanded the fetch mock in the issue #1270 test to return tokens for either token endpoint, accommodating different ADC environments.
| 10 天前 |
| fix(ai): defaulted bedrock claude thinking.display to summarized
Anthropic silently switched adaptive-thinking's display default to
"omitted" starting with Claude Opus 4.7, so the Bedrock provider
stopped surfacing any reasoning content — observed in the wild as
silent streams and timeouts on long reasoning runs.
Mirrors the existing direct-Anthropic behavior in this repo:
- For adaptive-thinking models that accept the field (Opus 4.7+),
emit { type: "adaptive", display: "summarized" } by default.
- For older adaptive-thinking models (Opus 4.6, Sonnet 4.6+) that
reject the field, keep emitting just { type: "adaptive" }.
- For budget-based Claude models, always set display.
- Expose BedrockOptions.thinkingDisplay ("summarized" | "omitted")
so callers can opt out, and wire hideThinkingSummary into the
bedrock-converse-stream case in stream.ts.
Fixes #1373
| 6 天前 |
| fix(ai): ignored bedrock auth sentinel
Ignored the agent auth sentinel when selecting Bedrock bearer auth so AWS credential sources still use SigV4.
Added regression coverage for sentinel forwarding with AWS_BEARER_TOKEN_BEDROCK and static AWS credentials.
Fixes #1399
| 6 天前 |
| fix(providers): pruned stale synthetic models
Treat Synthetic discovery as an authoritative catalog so deprecated bundled IDs are removed from resolved model lists and cache snapshots. Validate Synthetic API keys through the models endpoint instead of a model-specific chat request.\n\nFixes #1417
| 5 天前 |
| refactor(coding-agent/tools): removed bash fixup warning notices from command execution flow
- Removed the exported formatBashFixupNotice helper from bash command fixup utilities.
- Removed BashTool's one-time bash-fixup notice tracking and stopped emitting those notices when fixups were applied.
| 7 天前 |
| fix(ai,coding-agent): narrow Model.compat consumers after AnthropicCompat split
Commit a190397d8 made Model.compat resolve to OpenAICompat | AnthropicCompat
under the default TApi = any. The widened union broke every site that treated
compat as openai-shaped: model-registry deep-merge, openai-completions resolved
compat, and ~20 test fixtures. This restores the assumption locally instead of
papering over it with casts.
- getBundledModel is now generic on TApi so test fixtures that spread it into
Model<"openai-completions"> get the narrow compat back.
- mergeCompat is generic over TBase/TOverride; the schema-driven model-registry
override path keeps its OpenAICompat-shaped merge fields, anthropic overrides
pass through untouched.
- OpenAICompatSchema gains the openai-only fields it was missing
(requiresMistralToolIds, reasoningContentField, requiresReasoningContent*,
thinkingFormat, requiresThinkingAsText, disableReasoningOnForcedToolChoice).
- resolveOpenAICompat fills in disableReasoningOnForcedToolChoice so the
Required<OpenAICompat> shape stays satisfied.
- Anthropic tool-result block id assignment uses the proper unknown double-cast.
- isForcedToolChoice accepts unknown so it can read params.tool_choice whose
type comes from the OpenAI SDK ChatCompletionToolChoiceOption (now wider than
our local OpenAICompletionsToolChoice).
- Test fixtures and Required<OpenAICompat> literals updated for the field set.
Fixes CI red on main.
| 1 个月前 |
| feat: added ordered systemPrompt arrays and normalized context prompts
- Converted systemPrompt APIs and state types to ordered string[] across agent, AI, and coding-agent surfaces.
- Added normalizeSystemPrompts and applied it to context normalization before building provider request payloads.
- Updated AI providers to emit separate normalized prompt blocks/messages instead of a single merged system prompt.
- Removed dedicated projectPrompt state and remapped that context into system-context buckets in session, dump, and token accounting.
- Aligned tests and changelogs to pass and assert systemPrompt as arrays with ordered prompt semantics.
| 28 天前 |
| feat(deps): added pi.zod exports and removed TypeBox package exports
- Added canonical pi.zod schema API exports and removed TypeBox package exports/imports.
- Migrated Tool schema typing from TypeBox to shared TSchema/Zod flow with legacy TypeBox compatibility.
- Updated AI provider adapters and MCP/agent builders to convert tool params through toolWireSchema().
- Reworked schema validation from AJV to Zod-safe parsing with fromTypeBox, toolWireSchema, and meta schema checks.
| 17 天前 |
| Add DeepSeek API provider login
| 9 天前 |
| fix(ai): use Ollama /api/show context_length for discovered models
The local Ollama provider relied on /v1/models, which omits the
per-model context length and so reported a hardcoded 128k for any
model lacking a bundled reference (e.g. deepseek-v4-flash:cloud at
1M tokens). Now query /api/show per discovered model, parse
model_info.<arch>.context_length, and fall back to 128k only when
the call fails or the field is absent. Results are cached per model
id so repeated fetchDynamicModels calls do not refetch.
Fixes #847
| 1 个月前 |
| test(ai): add comprehensive tests for DeepSeek reasoning_content replay
16 tests covering all three failure modes:
- reasoningEffortMap xhigh→max for DeepSeek-family on any provider
- allowsSyntheticReasoningContentForToolCalls flag detection
- Tier 1: signature recovery from empty thinking blocks
- Tier 2: empty-string fallback when no thinking blocks exist
- Tier 3: synthetic placeholder for non-DeepSeek providers (Kimi)
Updates existing issue-883 tests to match new behavior (empty string
instead of synthetic "." for DeepSeek).
| 1 个月前 |
| fix(ai): preserved Anthropic routing for OpenCode qwen3.7-max after refresh
- Prefixed model cache fingerprints with a merge-v2 marker so cache keys are regenerated after model fingerprinting changes.
- Normalized OpenCode base-path handling and mapped dynamic OpenCode models to descriptor metadata so discovered models preserve their intended api and baseUrl.
- Added a regression test for issue #887 that mocks /v1/models and verifies qwen3.7-max remains anthropic-messages on refresh.
| 2 天前 |
| fix(ai): normalize array content parts in openai-completions stream
Mistral Medium 3.5 (mistral-medium-2604) streams delta.content as an
array of typed parts (e.g. [{ type: 'text', text: 'Hello' }]) instead
of a string. The OpenAI-completions parser appended the value directly
to the text block, producing literal '[object Object]' sequences in
the assembled assistant response.
Normalize string, array-of-parts, and single-part-object shapes into
plain text before feeding the existing tag/strip buffers and text
delta sink. Non-text parts and unknown shapes are skipped so we never
emit JS object sigils as visible content.
Fixes #911
| 30 天前 |
| feat: added ordered systemPrompt arrays and normalized context prompts
- Converted systemPrompt APIs and state types to ordered string[] across agent, AI, and coding-agent surfaces.
- Added normalizeSystemPrompts and applied it to context normalization before building provider request payloads.
- Updated AI providers to emit separate normalized prompt blocks/messages instead of a single merged system prompt.
- Removed dedicated projectPrompt state and remapped that context into system-context buckets in session, dump, and token accounting.
- Aligned tests and changelogs to pass and assert systemPrompt as arrays with ordered prompt semantics.
| 28 天前 |
| fix(ai): apply reasoning effort map to responses
Fixes #931
| 26 天前 |
| feat(deps): added pi.zod exports and removed TypeBox package exports
- Added canonical pi.zod schema API exports and removed TypeBox package exports/imports.
- Migrated Tool schema typing from TypeBox to shared TSchema/Zod flow with legacy TypeBox compatibility.
- Updated AI provider adapters and MCP/agent builders to convert tool params through toolWireSchema().
- Reworked schema validation from AJV to Zod-safe parsing with fromTypeBox, toolWireSchema, and meta schema checks.
| 17 天前 |
| fix(ai): minimax thinking
MiniMax descriptors carried thinkingFormat: "zai", which made
openai-completions emit thinking: { type: "enabled" } in plan mode.
MiniMax's OpenAI-compatible endpoint rejects that field with
400 invalid params, invalid chat setting (2013). Drop thinkingFormat
from both minimax-coding-plan descriptors and add
supportsReasoningEffort: false (MiniMax also ignores reasoning_effort).
Normalize bundled minimax-code/minimax-code-cn entries inside
applyGeneratedModelPolicy so a regenerated models.json cannot
reintroduce the bad flag.
Fixes #955
| 23 天前 |
| fix(test): rewrite Kimi issue #957 test for new AuthStorage refresh flow
- packages/ai/test/issue-957-repro.test.ts now tests:
- refreshKimiToken applies the 5-minute server-side skew (Kimi-specific)
- AuthStorage refreshes kimi-code credentials inside its 60s skew window
- packages/ai/test/anthropic-stream-timeout.test.ts: raise the
streamFirstEventTimeoutMs from 10ms to 5000ms so slow CI scheduling
cannot fire the first-event watchdog before the mocked events arrive.
The test still exercises the (1ms) idle path it was written for.
fix(web): allow Parallel extract via PARALLEL_API_KEY env var without storage
The fetch tool and YouTube scraper previously gated the Parallel extract
branch behind storage && findParallelApiKey(storage). With no
AgentStorage the env key was never consulted, so callers that ran
without a per-session storage (e.g. ReadTool sessions in unit tests, and
in practice any caller that has only an env API key) silently fell back
to raw-html / no-ytdlp paths.
- findCredential/findParallelApiKey now accept null or undefined storage
and rely solely on the env-first path when no storage is supplied.
- searchWithParallel/extractWithParallel mirror the same nullable shape.
- Drop the redundant storage && guards in fetch.ts and youtube.ts;
the inner findParallelApiKey call already returns null when no
credential is available.
| 6 天前 |
| fix(ai): handle utf-8 across chunk boundaries
DeepSeek streams leak chat-template markers (e.g. <|Assistant|>)
into delta.content, but the marker-stripping logic in
openai-completions.ts was gated on model.provider === "nvidia" and
so bypassed the native deepseek provider. Multibyte markers split
across chunk boundaries also surfaced as garbled "<瘻" sequences.
Apply the marker stripping for deepseek as well, hold partial
markers across chunks, and clean up surrounding whitespace when a
standalone marker is removed.
Fixes #959
| 23 天前 |
| fix(ai): replaced silent image drop with placeholder for non-vision models
- Image blocks sent to models without vision support now emit [image omitted: model does not support vision] instead of being silently dropped, preventing opaque 404 errors.
- Fix applies to user messages and tool-result payloads across Anthropic, OpenAI completions/responses, Codex, and Google providers.
- Extracted shared vision-guard.ts with partitionVisionContent, joinTextWithImagePlaceholder, and NON_VISION_IMAGE_PLACEHOLDER.
- Added regression tests covering all five provider paths.
Fixes #967
Fixes #968
| 22 天前 |