Commit Graph
1359 Commits
Author SHA1 Message Date
0xfandomandjatmn cdd6af609b fix(provider): match MiniMax and Venice base URLs by hostname, not substring (#2099)
* fix(provider): match MiniMax and Venice base URLs by hostname, not substring

The credential-mirroring chains route xAI, Cloudflare and Xiaomi through their
exact-hostname predicates (isXaiBaseUrl, isCloudflareBaseUrl,
isXiaomiMimoBaseUrl), but the MiniMax and Venice branches were left on raw
baseUrl.toLowerCase().includes('minimax') / includes('api.venice.ai') even
though isMiniMaxBaseUrl / isVeniceBaseUrl already exist. A proxy or lookalike
host (minimax-proxy.example.com, api.venice.ai.evil.com) therefore mirrors the
profile key into MINIMAX_API_KEY / VENICE_API_KEY; for MiniMax, providerAutoDetect
then reroutes it to the real api.minimax.io the user never configured. Route all
four sites through the hostname predicates, consistent with the neighbouring
providers.

* fix(provider): centralize dedicated-key mirroring across the profile lifecycle

The host-detected dedicated credential mapping (xAI, MiniMax, Venice,
MiMo) was reconstructed independently in three places and had drifted:

- The startup env builder's strict-env branch returned before any of
  these mirrors, so a keyed generic OpenAI-compatible profile on a
  canonical Venice/MiniMax host persisted only OPENAI_API_KEY and
  relaunched without its dedicated credential; the fallback branch had
  no MiniMax mirror at all and matched MiMo by substring.
- isProcessEnvAlignedWithProfile never checked MINIMAX_API_KEY, so once
  that key drifted after activation the env was still considered aligned
  and applyActiveProviderProfileFromConfig skipped reapplying — leaving
  MiniMax's dedicated-credential transport misrouted.

Introduce getHostDedicatedCredentialEnv as the single source of truth
for the exact-host (and, where available, route) credential mapping, and
route live application, both startup-persistence branches, and the
alignment check through it. Lookalike hosts still receive no dedicated
key.

* fix(provider): carry MiniMax dedicated key through launch reconstruction

buildLaunchEnv rebuilt the startup environment from a fixed dedicated-key
carry-over list that omitted MINIMAX_API_KEY, so a clean restart of a keyed
MiniMax profile retained the generic OpenAI variables but dropped the
dedicated credential. The MiniMax client only enters its native setup while
MINIMAX_API_KEY is present, so the persisted profile did not deliver the
intended restart behavior.

Add MINIMAX_API_KEY to the carry-over contract alongside the other
native-client vendor keys (MIMO/VENICE), preserving the same
shell-over-persisted precedence. The client's own hostname/route detection
gates activation, so an ambient key stays inert in an unrelated session.

Regressions reconstruct the launch environment from a saved profile with an
empty shell and assert both the surviving credential and the selected
env-only route (via resolveEnvOnlyProviderRouteId), not just the persisted
file: canonical MiniMax carries and reselects, a live shell key overrides
the persisted one, and a generic profile never synthesizes the credential.

* fix(provider): preserve keyless credential reconciliation

* fix(provider): scope MiniMax launch credentials to the active route

* fix(provider): admit saved Venice and MiMo keys only on their routes

* test(provider): document saved dedicated-key precedence

* fix(provider): restore test globals and scope profile docs

* fix(provider): keep explicit MiniMax route credentials across reconcile

Reconcile reapply rebuilt a generic OpenAI profile from the hostname only, so a launch that had already kept CLAUDE_CODE_PROVIDER_ROUTE_ID=minimax on a proxy lost MINIMAX_API_KEY when another env field drifted. Reapply now reuses that same-profile route instead of URL substring matching.

* fix(provider): preserve saved credentials in pane teammates

---------

Co-authored-by: jatmn <the@jat.mn>
2026-10-25 10:50:02 -07:00
JATMN da7e6631cc fix(vscode): align session discovery and resume with CLI storage (#2415)
* fix(vscode): align session discovery with CLI storage

* fix(vscode): discover mixed runtime session histories

* fix(vscode): preserve selected history through resume

* fix(vscode): cancel pending resume startup on abort

* fix(vscode): resolve selected transcripts before CLI launch

* fix(vscode): preserve exact-store resumes with relative config roots

* fix(vscode): skip zero-byte transcripts during session discovery

An empty exact-directory placeholder was treated as the selected session and hid a populated alternate history.
2026-10-25 09:39:23 -07:00
JATMN 8cab4d1174 fix(api): retry explicitly throttled OpenAI-compatible 403s (#2416)
* fix(api): retry explicitly throttled OpenAI-compatible 403s

* fix(api): allow explicit throttling messages that name an API key

* fix(api): distinguish OAuth throttling from token faults

* fix(api): preserve auth precedence and remote throttle retry headers

Match account, key, and token faults across clause wording instead of a
20-character credential window. Preserve plural faults and structured
error codes while allowing valid key and OAuth throttle messages.

Keep classified throttle-403s out of the infrastructure-auth retry
exception so their existing header and quota checks apply in remote mode.
Cover actual shim retries, guidance, credential recovery, and native CCR
retry behavior.

* fix(api): distinguish credential predicates across comma clauses

Keep unrelated disabled features from vetoing a valid-key throttle while
preserving actual key faults continued through relative descriptions or
parentheticals. Normalize only matching boundaries and retain raw error
text. Cover the reported retry path and baseline credential-fault cases.

* fix(api): require fault predicates in credential continuations

An adverb alone does not connect a later disabled feature to an API key.
Require an auxiliary/adverb sequence to reach the fault directly, while
preserving relative descriptions and parentheticals of the credential.
Cover the unrelated-subject regression through the real retry loop.

* fix(api): exclude routing host metadata from quota detection

Keep quota keyword matching on provider evidence and category markers,
without allowing the configured hostname to suppress throttle retries.
Preserve the original error message for diagnostics and host consumers.
Cover real 403/429 retry paths and genuine quota/no-retry controls.

* fix(api): preserve throttle fault precedence and retry categories

* fix(api): recognize qualified credential absence
2026-10-25 08:24:39 -07:00
jatmn d6e0e86be3 fix(vscode): preserve Windows launcher argument boundaries 2026-10-24 22:38:20 -07:00
Bogdanandjatmn 9bf1040e53 fix(lsp): synchronize document versions across restarts (#2106)
* fix(lsp): synchronize document versions across restarts

Track each open document by server generation and advance versions only after lifecycle notifications are delivered. This prevents replacement language servers from serving requests before receiving current file contents.

* fix(lsp): harden restart synchronization

Preserve active document URIs across Windows path aliases and coordinate connection replacement, failed startup cleanup, cross-generation retries, and shutdown with in-flight document work.

* fix(lsp): settle restart lifecycle races

Make failed starts and transport loss settle pending work, prevent obsolete generations from publishing responses, and keep diagnostics activity on the opened document identity.

* fix(lsp): preserve lifecycle generation boundaries

* fix(lsp): bound document recovery lifecycle

* test(lsp): harden lifecycle regression coverage

* fix(lsp): bound failed startup recovery

* test(lsp): harden lifecycle failure coverage

* test(lsp): restore current-main compatibility and isolation

---------

Co-authored-by: jatmn <the@jat.mn>
2026-10-24 20:44:27 -07:00
jatmn 3e68b6d397 fix(ollama): honor explicit thinking without changing defaults 2026-10-24 20:12:24 -07:00
d0ublei c884a886fe fix(ollama): send think=false by default so hybrid-reasoning models actually stop thinking
buildOllamaChatBody() never set a top-level `think` field on outgoing
requests. Ollama's hybrid-thinking models (e.g. Qwen3.x) interpret the
field's absence as thinking enabled, so every Ollama request ran in
thinking mode regardless of --effort, with no way to disable it. The
existing client-side thinking filter only hides the trace from display —
the model still generates the full reasoning chain either way, so the
latency cost was paid regardless of whether it was visible.

Mirrors the effort-handling already implemented for the Anthropic/Gemini
paths just above this function: no --effort specified maps to
think: false; an explicit effort level is passed through (xhigh/max/
ultracode collapse to Ollama's "high", matching its three-tier scale).

Measured on qwen3.6:35b-a3b-coding (Ollama, Apple Silicon):
- Before: 15-21s per trivial response, full visible reasoning trace
- After: ~1.3s via the raw Ollama API with think=false, ~5s through the
  full CLI (Node startup + OpenAI<->Ollama format conversion overhead)
- No visible reasoning trace in either case after the fix
2026-10-24 20:12:24 -07:00
JATMN fd596210f1 perf(types): keep default-heap Node 24 typecheck under the heap limit (#2414)
* fix(types): narrow SDK response schema consumers

* perf(types): bound mixed Zod schema comparisons
2026-10-24 18:59:07 -07:00
JATMN 5f91412177 chore: remove obsolete Node 22 compatibility code (#2412) 2026-10-24 17:24:11 -07:00
JATMN 11a1caa292 test(cli): isolate startup regression from shared builds (#2413) 2026-10-24 17:22:50 -07:00
JATMN 2a6d75ee92 test: preserve subprocess exports in clipboard mock (#2411) 2026-10-24 17:17:29 -07:00
JATMN 3dd93c8b81 test: clear lifecycle interruption traces after each case (#2409)
* test: clear lifecycle interruption traces after each case

* test: assert lifecycle trace leaks before cleanup
2026-10-24 16:55:39 -07:00
JATMN d9371e802b fix(types): avoid recursive schema comparisons (#2410) 2026-10-24 16:54:32 -07:00
JATMNandjatmn 6c8d22a20d fix(git): honor discovery ceilings in worktree fixtures (#2408)
* fix(git): honor discovery ceilings in worktree fixtures

* test(git): type-check subprocess status assertions

* fix(git): isolate fixtures and preserve literal ceilings

---------

Co-authored-by: jatmn <jatmn@users.noreply.github.com>
2026-10-24 16:31:19 -07:00
JATMN d7340b1e75 refactor(scripts): use Bun subprocess APIs for development commands (#2407)
* refactor(scripts): use Bun subprocess APIs for development commands

* fix(scripts): pass the live process environment to captured subprocesses
2026-10-24 15:53:24 -07:00
JATMN 6712d5a78c fix(proxy): restore direct fetch routing when clearing proxies (#2406)
* fix(proxy): restore direct fetch routing when clearing proxies

* fix(proxy): preserve dispatcher ownership and lazy setup

* fix(proxy): retire invalidated global TLS dispatchers

* fix(proxy): preserve dispatchers retained by fetch callers
2026-10-24 15:27:03 -07:00
JATMN be3a71711c chore(deps): upgrade zod to 4.6.7 (#2405)
* chore(deps): upgrade zod to 4.6.7

* test: normalize tool schema fixture paths to forward slashes

* fix: omit AgentTool fields before cwd refinement and export settings schema via zodToJsonSchema
2026-10-24 15:26:20 -07:00
JATMN ef78478fc0 chore(deps): upgrade @sentry/node to 11.9.0 (M-14) (#2402)
* chore(deps): upgrade @sentry/node to 11.9.0 (M-14)

* fix(sentry): omit hostname from sanitized error reports

* test(sentry): cover nonessential-traffic opt-out on its own

* fix(sentry): bound Sentry flush before shutdown exit

* fix(sentry): leave tracesSampleRate unset so spans stay disabled

* fix(shutdown): include Sentry drain in failsafe budget and test pending-flush exits
2026-10-24 14:52:22 -07:00
JATMN 1d6337dd2a chore(deps): upgrade undici to 8.12.3 (M-12) (#2401)
* chore(deps): upgrade undici to 8.12.3 (M-12)

* fix(proxy): honor lowercase no_proxy precedence and refresh cached bypass rules

* docs(proxy): clarify TLS options for NO_PROXY bypasses and CONNECT targets

* fix(proxy): clear CA and mTLS caches on structured I/O bypass updates

Also close the global test dispatcher in undiciFetch cleanup and document lowercase-first no_proxy precedence for fetch/undici.

* fix(proxy): refresh TLS and proxy state on certificate-only environment updates
2026-10-24 14:13:57 -07:00
JATMN 57a8978d1a chore(web): upgrade to Astro 7.4.2 (#2404) 2026-10-24 14:05:47 -07:00
JATMN b9ea599cfc chore(deps): upgrade eslint to 10.13.0 (M-15) (#2403) 2026-10-24 13:25:57 -07:00
JATMN 26c7f04cb9 chore(deps): upgrade commander and extra-typings to 15.0.0 (M-11) (#2400)
* chore(deps): upgrade commander and extra-typings to 15.0.0

* test(cli): build commander compatibility fixture in-test instead of relying on dist
2026-10-24 12:44:52 -07:00
JATMN 7a776d78c6 chore(deps): upgrade chokidar to 6.0.0 (M-13) (#2399) 2026-10-24 12:10:28 -07:00
JATMN ff13baf587 chore(deps): replace cli-highlight with a highlight.js ANSI renderer (D-5) (#2396)
* chore(deps): replace cli-highlight with a highlight.js ANSI renderer

* fix(highlight): key fallback highlight cache by Chalk level

Also correct the CONTRIBUTING highlighting note and move the qrcode
retention test and note out of this change.
2026-10-24 11:31:34 -07:00
JATMN de1bafcf6b build(deps): bump @anthropic-ai/sandbox-runtime to 0.0.81 (#2397)
* build(deps): bump @anthropic-ai/sandbox-runtime to 0.0.81

* test(sandbox): restore base sandbox config between adapter tests
2026-10-24 11:19:50 -07:00
JATMN cd350528f6 test(aimlapi): drive polling retries with fake timers (#2393)
* test(aimlapi): drive polling retries with fake timers

* test(aimlapi): await rate-limit retry timer registration
2026-10-24 09:53:31 -07:00
JATMN 1a79295216 build(deps): bump Anthropic SDK family to 0.137.0 (#2395) 2026-10-24 09:51:53 -07:00
JATMN cd536b2590 test(skills): isolate staged install temp directory assertions (#2394) 2026-10-24 09:35:51 -07:00
JATMN 8fd997c45a chore(deps): update sharp to 0.35.5 (#2390)
* chore(deps): update sharp to 0.35.5

* ci(install-hygiene): cancel superseded pull request runs
2026-10-24 09:04:58 -07:00
JATMN 9ccd6aeaac build(deps): bump @anthropic-ai/sdk to 0.110.0 and bedrock-sdk to 0.30.2 (#2391) 2026-10-24 08:47:37 -07:00
JATMN 0dbfe067de chore(deps): finish D-3/D-4 exact pins and raise ip-address override to 10.7.4 (#2392) 2026-10-24 08:35:57 -07:00
JATMN d97567b44a test(proxy): generate TLS test fixtures at runtime (#2389)
Generate ephemeral TLS fixtures once per test file.

Preserve transport assertions and add certificate validation coverage.
2026-10-24 07:23:47 -07:00
JATMN 94e22e19d3 build(deps): bump google-auth-library to 11.3.1 (#2387) 2026-10-24 06:22:19 -07:00
JATMN df184fbafc fix(proxy): pass runtime CA and mTLS options to the target TLS connection behind CONNECT proxies (#2386)
* fix(proxy): pass runtime CA and mTLS options to the target TLS connection behind CONNECT proxies

* test(proxy): isolate CONNECT tests from leaked axios mocks
2026-10-24 06:11:04 -07:00
JATMN 58d8a9d67f chore(deps): update https-proxy-agent to 9.1.0 (#2383)
* chore(deps): update https-proxy-agent to 9.1.0

* test(proxy): isolate CONNECT test from leaked axios mocks

* test(proxy): avoid global axios module registration

* test(proxy): exercise createAxiosInstance in CONNECT test
2026-10-24 04:58:01 -07:00
JATMN 196c5981a8 chore(deps): update execa to 10.x and chalk to 6.x (#2385) 2026-10-24 04:31:06 -07:00
JATMN 2976dbc0b0 test: reset cached model strings in claude lifecycle tests (#2384)
The custom-gateway lifecycle case initializes the process-global model string table with OpenAI aliases. Teardown did not clear it, so later getAgentModel haiku and fast-mode Opus tests in the same serial process resolved stale gpt-4o aliases. Reset the table in lifecycle setup and teardown.
2026-10-24 04:16:15 -07:00
JATMN d62eb70da1 chore(deps): update marked to 18.1.1 (#2382) 2026-10-24 02:52:27 -07:00
JATMN 95e96e9c16 test: restore credential refresh module mocks (#2381)
Capture detached real module exports before mocking and restore secure
storage and device-flow modules after each refresh-on-401 test. This
prevents shared-process credential mocks from breaking provider setup and
saved-profile startup tests in randomized serial runs.
2026-10-24 01:51:00 -07:00
JATMN 9160012753 test: run provider recommendation credential checks in process (#2376) 2026-10-24 01:44:47 -07:00
JATMN f5d5c69544 test: synchronize retention policy phases (#2380)
* test: synchronize retention policy phases

* test: verify cleanup policy hook ordering

Record the rejecting policy hook and threshold phase in the cleanup fixture,
and assert that the hook runs first while the throttle lock is held.
Preserve existing policy outcome and snapshot assertions.

* test: prove cleanup reruns remove newly completed sessions
2026-10-24 01:31:56 -07:00
JATMN 38ac018817 test: control paginated discovery deadlines (#2379) 2026-10-24 01:26:02 -07:00
JATMN fea268bca6 test: synchronize process outcome checks (#2378) 2026-10-24 01:25:11 -07:00
JATMN 17cd64c54e deps: upgrade diff to 9.0.0 (M-3) (#2377) 2026-10-24 01:09:41 -07:00
JATMNandjatmn a5a68675cc deps: pin @types/node to 24.19.2 (M-1) (#2375)
Co-authored-by: jatmn <12479882+jatmn@users.noreply.github.com>
2026-10-24 01:00:32 -07:00
JATMN 402478c97e chore(deps): update small ESM utility majors (#2372) 2026-10-23 23:13:23 -07:00
JATMN 67549c6da2 ci: bump Docker actions to current majors (#2373) 2026-10-23 23:08:43 -07:00
JATMN 9086822bb6 chore(deps): update typescript-eslint, knip and MCP SDK (#2371) 2026-10-23 22:03:30 -07:00
JATMN e7a3a17e00 chore(deps): update AWS SDK and Smithy group (#2370) 2026-10-23 21:25:39 -07:00
JATMN 714533a2fe ci: disable persisted checkout credentials in CI and release jobs (#2369) 2026-10-23 20:34:58 -07:00