mirror of
https://github.com/Gitlawb/openclaude.git
synced 2026-11-06 20:58:14 -04:00
1ce3c30dee8df0c2c94cc8fe044c768e84f55007
1400
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1ce3c30dee | fix: remove next 40 unused local findings (batch 5) (#2457) | ||
|
|
1cead2c906 | fix: remove next 40 unused local findings (batch 4) (#2456) | ||
|
|
31274c145a | fix: remove next 40 unused local findings (#2454) | ||
|
|
ec6bc3fd5d | fix: encode JSX apostrophes for CodeQL tokenization (#2455) | ||
|
|
f55f4dfdf0 | chore: resolve next 40 unused-local-variable findings (#2453) | ||
|
|
d4d1b2bfa7 |
fix: remove permanently disabled conditional paths (#2450)
* fix: remove permanently disabled conditional paths * fix: remove the disabled classifier rendering branch |
||
|
|
099cd505fe | fix: add missing statement terminators flagged by CodeQL (#2448) | ||
|
|
9876d04b3a | fix: simplify redundant UI conditions (#2449) | ||
|
|
24a90a5639 | fix: simplify redundant utility and tool conditions (#2452) | ||
|
|
a8843cf241 | chore: resolve bottom 40 unused-import quality findings (#2451) | ||
|
|
a9387e4cc3 | chore: remove unused spinner layout assignments (#2444) | ||
|
|
51085b9836 | chore: remove unused UI and text-input assignments (#2445) | ||
|
|
e097dc8864 | chore: remove unused plugin cache assignments (#2446) | ||
|
|
443dbea52a | chore: remove unused core utility assignments (#2447) | ||
|
|
94ebcff640 | fix: remove unreachable internal-only branches (#2440) | ||
|
|
51f50e99b0 | fix: clarify declarations and redundant comparisons (#2441) | ||
|
|
a883d57f82 | fix: remove duplicate regex members and bound SGR parsing (#2442) | ||
|
|
391c660db6 | fix(ide): propagate VSIX download stream errors (#2443) | ||
|
|
0470c16c28 | chore: remove useless MCP import and updater expressions (#2438) | ||
|
|
85cfaa7345 | chore: remove useless expressions from plugin validation (#2436) | ||
|
|
87f65c5955 | chore: remove discarded agent prompt default expression (#2439) | ||
|
|
3202a153ce | chore: remove useless search and markdown expressions (#2437) | ||
|
|
a91f736ef1 | chore: remove ten reported unused bindings (#2433) | ||
|
|
24901c610a | chore: remove unused imports from GitHub setup and insights (#2432) | ||
|
|
ddacba95c7 | chore: remove unused React import from session chooser (#2431) | ||
|
|
3adc887e85 |
fix: clean up existing ESLint warnings (#2429)
* fix: resolve all existing ESLint any warnings * fix(sdk): preserve raw shapes with _input fields * fix(sdk): preserve interface inputs and mutable raw arguments * fix(sdk): enforce callback variance at tool creation * fix(sdk): preserve raw input and JSON handler compatibility * fix(sdk): preserve handlers for keyless JSON schemas * fix: restore original SDK boundary for lint cleanup |
||
|
|
ec39d807c0 |
fix(smart-routing): stop overriding sub-agent models chosen by agentRouting (#2310)
* fix(smart-routing): stop overriding sub-agent models chosen by agentRouting Smart routing classified the first pass of every query loop, including the loop each sub-agent runs. A sub-agent's prompt is not a user turn, but it was classified as one and the pinned model overwrote the model agentRouting (or the agent definition) had just selected. With both features on, every routed sub-agent silently ran on the strong model. decideTurnModel now returns routed:false when the query loop belongs to a sub-agent, so the parent turn's decision holds for its Agent tool call as documented, and sub-agent runs no longer count toward the routing tally or the per-session allowlist disable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(smart-routing): cover sub-agent query model preservation * fix(smart-routing): preserve inherited fork models * fix(smart-routing): preserve parent request selection in forks * fix(smart-routing): preserve selection across context boundaries * fix(smart-routing): keep inherited runtime and request selections paired * fix: preserve fork selections across tool and provider changes * fix: preserve model selections across asynchronous context lifetimes * fix: preserve child model policy and recovery origin * fix: validate skill admission before effects and retain recovery ownership * fix: establish ambient fork models against the current provider * fix: preserve assigned child models in plan mode --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: jatmn <the@jat.mn> |
||
|
|
4e746935f8 |
ci: enforce lint and prepare applicable merge checks (#2428)
* ci: enforce lint and scope contributor validation * ci: add required-check gates that accept untouched surfaces |
||
|
|
77739e2ce5 | fix(web): reject empty sitemap in build verification (#2427) | ||
|
|
2dddbb379a | fix(plugins): suppress hooks throughout sparse clones (#2426) | ||
|
|
ae7eb82187 | fix(test): verify isolated child and release suite completion (#2425) | ||
|
|
7b83353db1 |
feat: add OrcaRouter gateway descriptor (#2125)
* feat: add OrcaRouter gateway descriptor Add first-class support for OrcaRouter, an OpenAI-compatible model routing gateway, as a generated gateway descriptor with hybrid catalog discovery and curated flagship models (openai/gpt-5.5, anthropic/claude-sonnet-4.6, google/gemini-3.5-flash) plus its orcarouter/auto named router. Registers ORCAROUTER_API_KEY in the env-file allow-list, surfaces the provider in the web provider list and README, and updates the compatibility/registry tests for the new preset. Co-Authored-By: Claude <noreply@anthropic.com> * test: include OrcaRouter in provider picker navigation * fix(orcarouter): preserve profile credentials and model limits * fix(orcarouter): keep managed keys scoped to their profiles * fix(orcarouter): preserve credential ownership across process boundaries * fix: preserve Orca credential ownership across child startup * fix(orcarouter): preserve credential provenance and discovery auth * fix(orcarouter): preserve saved credential origin across launch paths * test(orcarouter): restore credential origin in shim tests * fix(orcarouter): preserve pane credential provenance * docs(orcarouter): clarify dedicated-key migration --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: jatmn <the@jat.mn> |
||
|
|
cb4a72bf1c |
fix(hooks): reject unsupported command hook args (#2398)
* fix(hooks): reject unsupported command hook args * fix(settings): preserve forbidden hook args diagnostics --------- Co-authored-by: jatmn <the@jat.mn> |
||
|
|
5ef7183a75 |
fix(sdk): wire options.hooks callbacks into the in-process hook executor (#2244)
* fix(sdk): wire options.hooks callbacks into the in-process hook executor QueryOptions.hooks was declared but never consumed by the in-process query() path — SDK consumers passing PreToolUse/PostToolUse/Stop callbacks got zero invocations, silently. The kernel hook executor already supports callback-form hooks: utils/hooks.ts merges getRegisteredHooks() into every hook event, and bootstrap/state.ts exposes registerHookCallbacks() for exactly this purpose (the CLI path wires the same mechanism via the control protocol in print.ts). This registers options.hooks (converted to HookCallbackMatcher form) during query() setup so in-process SDK consumers get the same hook semantics as CLI users: - PreToolUse deny/ask decisions now gate tool execution - Stop hooks fire when the agent attempts to finish - All HookEvents flow through the standard executor Verified against dist/sdk.mjs with GLM gateway end-to-end: - PreToolUse callback fires and its deny decision blocks the tool call - Stop callback fires on result Co-Authored-By: Claude <noreply@anthropic.com> * fix(sdk): isolate query hook callbacks and clean up their lifecycle Keep options.hooks on each query's existing async context instead of registering callbacks globally. Release callbacks on close and terminal iteration, and cover matching, denial output, concurrent queries, and cleanup without affecting process-level hooks. * fix(sdk): validate hook matchers and preserve callback arguments Skip malformed matcher values before registration without broadening them to wildcards. Preserve omitted, undefined, and empty matchers, and forward the executor's full callback tuple including cancellation and state access. Cover both boundaries through the SDK query lifecycle and real hook executor, including live abort propagation and valid optional matchers. * test(sdk): isolate query hook fixtures from persisted settings --------- Co-authored-by: renjie.yin <renjie.yin@ronds.com.cn> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: jatmn <the@jat.mn> |
||
|
|
0e441ba09a |
fix(launcher): tolerate missing bin helpers on distro installs (#2255) (#2256)
* fix(launcher): tolerate missing bin helpers on distro installs (#2255) * test(launcher): add heap fallback/canonical parity plus robust siblingless fixture * test(launcher): isolate heap env in launcher fixture --------- Co-authored-by: Gravirei <gravirei@users.noreply.github.com> |
||
|
|
c86014337b |
fix(opencode): promote bare Codex alias launches to Codex backend (#2066) (#2171)
* fix(opencode): promote bare Codex alias launches to the Codex backend endpoint * fix(opencode): normalize [1m] tag before Codex alias classification (#2171) * fix(opencode): centralize [1m] tag normalization inside isCodexAlias (#2171) * chore: remove pnpm lockfile (repo uses bun) * fix(provider): share Codex model identity parsing for tagged routes --------- Co-authored-by: jatmn <the@jat.mn> |
||
|
|
23115eb86d |
feat(attachments): make TODO reminders configurable (#2214)
* commit1 * fix(attachments): resolve reminder thresholds per field and validate env strictly - Resolve turnsSinceWrite/turnsBetweenReminders independently with per-field precedence (settings -> env -> default) so partial todoReminder settings are honored instead of discarded. - Parse OPENCLAUDE_TODO_REMINDER_* via whole-string positive-safe-integer validation so suffixed, fractional, scientific, and oversized values fall back to the default instead of being truncated. - Degrade invalid todoReminder thresholds or a malformed object to undefined in the settings schema so one bad value cannot invalidate the entire settings source. - Replace the copy-pasted JSDoc above getEnvNumber with an accurate one. - Extend focused tests: settings precedence, partial/mixed settings, malformed env values, and schema fallback behavior. * test(attachments): isolate reminder settings and cover consumer boundaries --------- Co-authored-by: jatmn <the@jat.mn> |
||
|
|
c56c68f063 |
feat(gemini-vertex): native env routing and tool-id safety (2/3) (#1614)
* feat(gemini-vertex): wire env-flag provider routing, selection and model defaults Builds on the native client PR. CLAUDE_CODE_USE_GEMINI_VERTEX=1 now selects the provider end-to-end: - integrations: gemini-vertex vendor descriptor, route/runtime metadata, Gemini model catalog additions, regenerated artifacts - client.ts: route to the native Vertex client on the env flag; the Anthropic-on-Vertex branch is only reached for real Claude-on-Vertex - providerConfig.ts: resolveProviderRequest Vertex model/project/location resolution; getAdditionalModelOptionsCacheScope returns null instead of 'firstParty' for Gemini Vertex sessions (bootstrap stays third-party) - model defaults / deprecation / context windows recognise the category - startup selection: hasProviderSelectionFlags + hasCompleteProviderSelection recognise the flag and its concrete project/model/location vars, so an explicit Vertex env wins over a saved profile like every other provider - drift sweep: auth (is3P, is1PApiCustomer), log, apiPreconnect, agentRouting, spawnUtils teammate forwarding, statusNotice, StartupScreen, onboard-github, providerFlag (--provider gemini-vertex, --model mapping), managedEnvConstants (managed; project ids deliberately NOT in SAFE_ENV_VARS, same policy as ANTHROPIC_VERTEX_PROJECT_ID), providerStartupOverrides, GCP credential prefetch, SDK provider type - durable guard: providerSelectionFlags.ts is the single source of truth for CLAUDE_CODE_USE_* flags; enumerating call sites derive from it and a parity test fails when a new provider flag appears unregistered Profile/UI integration follows in the next PR. Typecheck clean, test:provider 703/703 plus 353 targeted tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): sanitize smuggled thought-signature tool ids on foreign wires The Gemini Vertex client smuggles Gemini thought signatures into tool_use ids (toolu_vertex_x~~sig~~<base64>, up to ~1.8k chars) so they survive session persistence and can be replayed to Vertex, which requires them. Any other provider consuming that history then echoes the giant id and the backend rejects it - e.g. Codex: 400 "Invalid 'input[2].id': string too long" after a /provider switch or --resume from a Vertex session. Fix at every wire boundary, never in the stored history (Vertex keeps reading its signatures): - utils/toolUseIds.ts: shared dependency-free sanitizeToolUseIdForWire - cut at the first character outside [A-Za-z0-9_-] (no legitimate id contains one), cap with a deterministic FNV-1a hash tail so distinct overlong ids stay distinct - codexShim.normalizeToolUseId: sanitize before building fc_/call_ ids (Responses API limit 64) - openaiShim chat/completions: sanitize tool_calls[].id, tool_call_id and the correlation sets (OpenAI limit 40) - normalizeMessagesForAPI: same sanitation for the Anthropic wire, gated on getAPIProvider() !== 'gemini-vertex' Verified E2E on a real Vertex session containing 1.7k-char signed ids: resumed under the Codex profile -> completes (was the 400); resumed under the Vertex profile -> signatures preserved, completes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address CodeRabbit review on #1614 - onboard-github: clear CLAUDE_CODE_USE_GEMINI_VERTEX in the fast-path (applyGithubOnboardingProcessEnv + buildGithubOnboardingSettingsEnv), so GitHub activation resets Vertex routing on both onboarding paths, not just the device-flow finalize path. Covered by an assertion in the existing test. - messages.normalizeMessages: guard against falsy/non-object slots before the switch reads message.type, matching the default arm's intent. - toolUseIds.sanitizeToolUseIdForWire: keep at least one prefix char if a caller passes maxLength < tail length. - providerFlag.test: add the Gemini Vertex env vars to the cleanup lists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(gemini-vertex): add profile compatibility so the preset routes natively Addresses jatmn's P1 review on #1614: gemini-vertex is selectable in ProviderManager (it is in ORDERED_PROVIDER_PRESETS), but without a profile compatibility mode a saved profile fell through to the OpenAI-compatible path and was routed through the shim to aiplatform.googleapis.com instead of the native client. Brings the profile env-shaping into this PR (the /provider UI forms and launcher stay in the follow-up UI PR): - providerProfile.ts: 'gemini-vertex' compatibility/profile types, buildGeminiVertexProfileEnv, managed + secret env keys. - providerProfiles.ts: resolveProfileCompatibility mode, profile env application, startup-profile bootstrap, env/profile alignment. - client.ts: route a saved gemini-vertex profile to the native client (gated by shouldRouteToGeminiVertexFromProfile, yields to an explicit selection of another provider). - providerValidation.ts: Vertex project/credential validation messages. So a saved or preset-selected Gemini Vertex profile now sets CLAUDE_CODE_USE_GEMINI_VERTEX + the Vertex project/location/model env and reaches the native client. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address jatmn review on #1614 (P1 test, P2 isolation, P3 startup) - ProviderManager.test.tsx: add 'Google Vertex AI Gemini' to PRESET_ORDER at its generated position (between Fireworks and Gemini) so navigation selects the intended preset and the ProviderManager suite is green again. (P1) - messages.toolUseIds.test.ts: clear the full provider-selection registry in before/afterEach so getAPIProvider() (which checks FOUNDRY before route resolution) reflects only the test's own flags — proven by passing under CLAUDE_CODE_USE_FOUNDRY=1. (P2) - StartupScreen detectProvider: when no Vertex project resolves, show a /projects/<set GEMINI_VERTEX_PROJECT>/locations/... project-required state instead of a project-less endpoint the native client never calls. (P3) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test(gemini-vertex): make tool-id tests suite-order independent - providerSelectionFlags parity: scan only runtime source (skip *.test.*), so a flag a test fixture sets but the code never reads (e.g. a placeholder in discoveryService.test.ts from #1620) doesn't trip the gate. - messages.toolUseIds: mock getAPIProvider directly instead of relying on global env/route state, which other suite tests mutate via mock.module — makes the wire assertions hermetic. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address CodeRabbit review on the routing PR - providerProfile.ts: honor an explicit shell GEMINI_VERTEX_AUTH_MODE over the persisted/default value (same precedence as model/project). - providerProfiles.ts: validate the active Vertex project in the profile alignment check so a project drift forces re-apply instead of routing to the wrong project (only when the profile pins a project; ADC-resolved stays free). - messages.ts: harden isNotEmptyMessage against malformed user/assistant slots ({ type } / { message: {} }) that previously crashed on message.message.content; add a regression test. - providerConfig.local.test.ts: clear a possibly-leaked CLAUDE_CODE_USE_OPENAI so the Gemini Vertex cache-scope assertion can't pass/fail for the wrong reason. The Critical "typecheck must pass" item is a false positive: both `bun run typecheck` and `bun run typecheck:type-tests` pass cleanly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address jatmn re-review on #1614 (P2 content guard, P3 /provider summary) - messages.ts: isNotEmptyMessage now narrows content to string | array before the indexed reads, so a non-string/non-array content (object/number) no longer crashes on content[0].type. Added the object/number regression cases. - provider.tsx: buildCurrentProviderSummary now has a Gemini Vertex branch, so a CLAUDE_CODE_USE_GEMINI_VERTEX session reports the Vertex provider/model and the /projects/<project>/locations/<location> endpoint (project-required state when unset) instead of falling through to Anthropic. Added summary tests for both the resolved and project-required cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): guard normalizeMessages payloads and forward all Vertex project aliases Addresses jatmn's third re-review on #1614: - messages.ts: normalizeMessages now drops malformed assistant/user slots (missing message, or non-array/non-string content) before the branches dereference message.message.content — so progress-derived messages routed through normalizeMessages (queryHelpers) can't crash the pipeline. Added a regression test for the missing/non-array content paths. - spawnUtils.ts: TEAMMATE_ENV_VARS now forwards every project alias Gemini Vertex accepts (adds GCLOUD_PROJECT and GOOGLE_PROJECT_ID), so an env-only teammate launched with any of them keeps the project hint instead of failing Vertex validation/routing. Added a spawn-env coverage test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): drop content arrays with malformed elements in normalizeMessages Addresses CodeRabbit follow-up: the array guard rejected bad content containers but arrays whose elements are null/primitive/typeless or a text block without text still reached block.type / isNotEmptyMessage and could crash the same malformed-history path. Drop the whole slot when any element is malformed, with regression cases. Also assert the normalized output shape in the well-formed cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test(gemini-vertex): use toMatchObject for normalized-shape assertion Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): use saved profile for project/model and validate credentials Addresses jatmn's re-review on #1614: - client.ts: when routing purely from the saved profile (no CLAUDE_CODE_USE_GEMINI_VERTEX flag), fall back to the profile's own project (stored in baseUrl) and model instead of only reading process.env — so a saved gemini-vertex profile no longer throws "project required" or routes an ADC session to the ambient/default project and gemini-2.5-flash. Env still wins when explicitly set. - providerValidation.ts: the Gemini Vertex branch now also resolves the selected credential path (mirroring getAnthropicClient's auth-mode mapping) and fails when none is available, so an access-token profile without GEMINI_ACCESS_TOKEN (or a missing ADC) is caught at setup/startup instead of on the first request. Added a credential-missing regression test and made the project-alias test inject a deterministic credential. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): wire the provider into doctor, /provider GitHub switch, and profile scripts Addresses jatmn's re-review on #1614 (provider-list drift in peripheral tools): - scripts/system-check.ts: doctor now dispatches Gemini Vertex — env checks (project/model/location/credential), reachability + generation readiness show a Vertex-specific skip instead of reporting the Anthropic login flow, currentBaseUrl and serializeSafeEnvSummary cover it. Test-only export + tests for the dispatch and safe-env summary. - ProviderManager.tsx: GitHub activation now clears every selection flag from the central PROVIDER_SELECTION_FLAGS list (including CLAUDE_CODE_USE_GEMINI_VERTEX) in both the settings patch and process.env, so switching to GitHub can't keep routing on a previously selected Vertex profile. - scripts/provider-launch.ts + provider-bootstrap.ts: accept gemini-vertex in the provider allowlists, build a real gemini-vertex profile (instead of a broken openai one), and fail loudly when project/credentials are missing. Verified end-to-end: `doctor:runtime` reports the Vertex provider; the launch script errors clearly without creds; bootstrap saves a gemini-vertex profile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address CodeRabbit review on PR-2 (8 findings) - client.ts: re-resolve the Vertex credential per request via getAccessToken so long-lived clients pick up refreshed ADC tokens instead of a stale one captured at construction (Critical); coerce geminiVertexModel to a plain string so the model fallback satisfies tsc and never passes undefined. - toolUseIds.ts: coerce non-string ids before .replace so loosely typed history blocks (number/object/undefined) cannot throw on the wire path. - system-check.ts / provider-launch.ts / provider-bootstrap.ts: resolve the Gemini Vertex project through the shared getGeminiVertexProjectId resolver instead of three drifting OR chains, matching the runtime validator/client contract and adding whitespace normalization. - providerSelectionFlags.test.ts: keep the parity scan non-tautological by excluding the registry and its own test. - bugfixes.test.ts: add a sectionBetween() helper that asserts both anchors resolve before slicing the drift-guard regions (a missing end anchor used to silently widen the slice and pass); fix the StartupScreen detectProvider end anchor it exposed. - deprecation.test.ts: lock the gemini-vertex bypass so Anthropic model retirement dates never leak into the Vertex deprecation banner. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test(gemini-vertex): make deprecation bypass test hermetic The env-based variant failed deterministically in the full CI suite: getModelDeprecationWarning() resolves the provider through getAPIProvider(), which reads global env/route state that other suites mutate, so setting CLAUDE_CODE_USE_GEMINI_VERTEX on process.env did not reliably select the gemini-vertex route. Mock getAPIProvider directly (same pattern as messages.toolUseIds.test.ts) so the assertions are order-independent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test(provider-flags): exclude all test files from the consumed-flag scan CodeRabbit follow-up: the "registered flags are actually consumed" check only skipped the registry and its own test, so a flag referenced solely by another test fixture would still look consumed. Skip every *.test.* file so the assertion proves real runtime consumption. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address jatmn review — project/ADC/preset issues - providerProfiles.ts: never persist the Vertex API endpoint URL as the project id. The /provider preset seeds the shared baseUrl field with https://aiplatform.googleapis.com; a URL-shaped value would build invalid /v1/projects/https://.../locations/... requests. Add geminiVertexProjectFromProfile() to drop URL-shaped values and reuse it in both the profile-env builder and the alignment check. - providerUiMetadata.ts: base requiresApiKey on authMode === 'api-key' instead of requiresAuth, so the ADC-only Gemini Vertex preset is no longer pushed through the generic API-key step (ADC profiles have no key to enter). - provider-launch.ts: only require an upfront credential in access-token mode; ADC mode (explicit or default) relies on ambient Google ADC that only the runtime resolver can discover, matching doctor and the native client. - Tests: lock the endpoint-not-project guard (both URL and real-project cases) and the ADC-preset API-key gating; harden providerProfiles env cleanup with the Vertex project/credential keys. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address CodeRabbit follow-up — credentials, URL guards, tests - providerProfiles.ts / providerProfile.ts: carry the active credential forward when applying a saved Gemini Vertex profile. buildCompatibilityProcessEnv clears every managed key (incl. GEMINI_ACCESS_TOKEN / GOOGLE_APPLICATION_CREDENTIALS), so a profile switch could relaunch unauthed; re-add the access token (access-token mode) or ADC file (adc mode). - providerProfiles.ts (startup-profile path) and provider-bootstrap.ts: extend the endpoint-URL guard to the remaining sites that fed baseUrl into the Vertex project — drop URL-shaped values via geminiVertexProjectFromProfile() and reject http(s) --base-url in the bootstrap script. - Tests: add applyModelFlagFromArgs GEMINI_VERTEX_MODEL coverage; lock access-token / ADC credential preservation on profile apply; isolate every provider-selection flag in the cache-scope test via PROVIDER_SELECTION_FLAGS. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address jatmn round-3 — saved-profile-only path - messages.ts: sanitize Vertex tool_use ids by the effective provider (env flag OR saved active profile) via new isGeminiVertexEffectiveProvider(), not the env-only getAPIProvider(). On the saved-profile-only route the signed thought-signature ids were stripped before geminiVertexClient could decode them, re-triggering the 400 the smuggling avoids. - client.ts: run the saved-profile project through geminiVertexProjectFromProfile (shared "URL is not a project" sanitizer) instead of using activeProfile.baseUrl raw, so a preset profile can't build /v1/projects/https://.../. - providerProfiles.ts: carry the active credential into the persisted startup profile (buildStartupProfileFromActiveProfile), mirroring the live switch path, so a saved Vertex profile relaunches authenticated. - vendors/gemini-vertex.ts: credentialEnvVars now lists only real credentials (GEMINI_ACCESS_TOKEN / GOOGLE_APPLICATION_CREDENTIALS), not routing/config vars, so generic consumers don't surface the enablement flag/project id as an apiKey; defaultBaseUrl is a project placeholder so the preset routes through the full setup form to collect the project id. - Tests: saved-profile effective-provider preservation; startup-profile credential persistence (access-token + ADC); credentialEnvVars/apiKey gating; preset baseUrl placeholder. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): doctor validates the Vertex credential before launch The Vertex generation-readiness check unconditionally passed ("relying on ambient ADC"), so a fresh env with a project but no resolvable ADC passed the doctor that provider-launch runs as its preflight, then `node bin/openclaude` failed startup validation. Reuse the runtime resolveGeminiCredential() (mapping GEMINI_VERTEX_AUTH_MODE -> GEMINI_AUTH_MODE and clearing API keys, exactly like the native client) and fail when the credential cannot be resolved, so the preflight matches the provider that will actually run. Also clarify the GEMINI_VERTEX_AUTH line that ambient ADC is validated by the readiness check. Tests: readiness passes when a credential resolves and fails when none does. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): address CodeRabbit review (in-scope findings) - provider-bootstrap.ts: the saved-profile summary now prints GEMINI_VERTEX_MODEL for gemini-vertex profiles instead of falling through to a default. - provider-launch.ts: the usage string lists gemini-vertex and no longer repeats mistral, matching the accepted profile arguments. - StartupScreen.ts: detectProvider resolves Vertex model/location/project through the shared getGeminiVertexModel/Location/ProjectId helpers (same contract as runtime/provider summary) instead of manual env reads. - StartupScreen.test.ts: lock the alias fallback (GOOGLE_CLOUD_PROJECT resolves the endpoint project when GEMINI_VERTEX_PROJECT is unset). - client.test.ts: snapshot/clear/restore all three project aliases (GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT, GOOGLE_PROJECT_ID) so the Vertex tests can't leak host-environment project ids. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): thread saved-profile-only routing through provider identity The saved-profile-only Vertex route (active gemini-vertex profile, no CLAUDE_CODE_USE_GEMINI_VERTEX flag) was only honoured by the API client, so other env-flag-only "is this Vertex?" checks disagreed with it: - routeMetadata.ts: resolveActiveRouteIdFromEnv() now returns 'gemini-vertex' when activeProfileProvider is gemini-vertex and no provider env flag is set, so /model loads the Vertex catalog/discovery for the same session. - providerConfig.ts: getAdditionalModelOptionsCacheScope() scopes a saved gemini-vertex profile as third-party (null) instead of 'firstParty', so bootstrap/model-option traffic is not fetched through the Anthropic path. - provider.tsx: buildCurrentProviderSummary() reports the effective provider so a saved Vertex profile no longer shows "Anthropic"/api.anthropic.com. Tests cover each: saved-profile route resolution (and precedence when a flag is set), the cache-scope fallback, and the provider summary. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): resolve saved Vertex profile before env-only inference CodeRabbit follow-up: resolveActiveRouteIdFromEnv() placed the saved-profile gemini-vertex check after resolveEnvOnlyProviderRouteId(), so an ambient credential-only env (e.g. a stray XAI_API_KEY) won over the active profile and disagreed with getAnthropicClient (which routes saved gemini-vertex profiles unless a conflicting provider flag is set). Move the check above env-only inference, guarded on CLAUDE_CODE_USE_OPENAI to mirror the conflicting-flag rule. Add regressions: profile wins over ambient credential env, and yields to an explicit OpenAI flag. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): accept ADC-derived project; GitHub token over blank key - providerValidation.ts: resolve the Vertex credential before failing on a missing project, and accept credential.projectId (ADC-derived) as the project — mirroring getAnthropicClient, which falls back to the ADC project. A valid ambient-ADC setup with no project env var no longer fails startup validation. - provider-launch.ts: defer the project check to runtime in ADC mode (ADC can supply the project); access-token mode still requires an explicit project. - openaiShim.ts: GitHub hydration uses || (not ??) so a blank exported OPENAI_API_KEY no longer wins over GITHUB_TOKEN/GH_TOKEN and leaves GitHub requests unauthenticated. Pre-existing main behaviour, fixed at maintainer request; matches the Gemini/Mistral branches. - Tests: ADC-derived project acceptance + access-token project-required; GitHub-token fallback when OPENAI_API_KEY is blank. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): whitespace-safe Vertex config + ADC-only bootstrap CodeRabbit follow-up (all on this PR's Vertex code): - provider-bootstrap.ts: only require an explicit project for access-token profiles; ADC can supply credential.projectId at runtime, so ADC-only Vertex profiles can now be created. Pass the resolved authMode through. - providerProfile.ts: sanitize each shell/persisted candidate before applying precedence (model/project/location and the access-token re-add), so a whitespace-only shell value (e.g. GEMINI_VERTEX_PROJECT=' ') can't drop the real persisted config; normalize the auth-mode check too. - providerValidation.ts: trim GEMINI_ACCESS_TOKEN before inferring the default auth mode so a blank token doesn't force access-token over ADC. - Tests: assert the concrete 'openai' route in the precedence case; isolate the GCLOUD_PROJECT/GOOGLE_PROJECT_ID aliases in the env-diagnostics fallback tests; lock the whitespace-over-persisted precedence in buildStartupEnvFromProfile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): saved profile wins over ambient env in profile-only routing getAnthropicClient's saved-profile-only Vertex branch resolved the project/model from process.env before falling back to the profile, contradicting its own comment. A saved gemini-vertex profile targeting one project/model could route to an ambient GOOGLE_CLOUD_PROJECT / stale GEMINI_VERTEX_MODEL when no CLAUDE_CODE_USE_GEMINI_VERTEX flag is set. profileProject/profileModel are only populated when routedFromProfileOnly, so leading the precedence with them makes the selected profile win in profile-only mode while env still wins for an explicit Vertex selection. Regression locks the precedence (profile project + model win over ambient env). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): align saved-profile route resolution with defined flag rule resolveActiveRouteIdFromEnv's saved-profile gemini-vertex branch only blocked on a *truthy* CLAUDE_CODE_USE_OPENAI, but the client's shouldRouteToGeminiVertexFromProfile treats any *defined* conflicting provider flag as explicit intent. With a saved gemini-vertex profile and CLAUDE_CODE_USE_OPENAI=0, route metadata reported gemini-vertex while the client refused the saved-profile Vertex route, so /model loaded the Vertex catalog for a session whose requests would not use Vertex. Mirror the client exactly via PROVIDER_SELECTION_FLAGS (any defined flag other than the Vertex one blocks the route). Regression covers the falsey OpenAI flag. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): single source of truth for Vertex auth mode + edge cases CodeRabbit follow-up — the recurring "infer auth mode from token" logic was duplicated inline (and inconsistently) across the client/doctor/profile paths, so a token-only or whitespace-only config was classified differently per site. - geminiAuth.ts: add resolveGeminiVertexAuthMode() — explicit GEMINI_VERTEX_AUTH_MODE (case/space-normalized) wins, else a present (sanitized) token implies access-token, else adc. Wire it into providerProfiles.ts (apply + startup builders) and system-check.ts (env check, generation-readiness, safe summary), fixing the token-only case that previously forced adc and dropped the bearer. - system-check.ts: don't hard-fail a missing project in ADC mode (ADC supplies credential.projectId; only access-token mode requires an explicit project); normalize the credential-set boolean with trim instead of ??. - statusNoticeLocalModel.ts: handle the gemini-vertex route id explicitly so a saved-profile Vertex route never resolves to an OPENAI base URL. - Tests: resolveGeminiVertexAuthMode unit cases; token-only auth-mode regressions for apply + startup persistence; deterministic access-token validator stub; exact provider-summary assertions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(gemini-vertex): document the Gemini-on-Vertex provider and setup The PR adds a first-class native Gemini Vertex route but the user-facing docs didn't mention it (repo guidance requires doc updates for provider/setup changes). - README.md: add a "Google Vertex AI (Gemini)" row to the supported-provider table (enable flag, ADC vs access-token auth, project aliases, model/region), and clarify the existing Gemini row is Google AI Studio (API key). - docs/advanced-setup.md: add a "Gemini on Vertex AI" section with ADC and access-token setup, distinct from Claude-on-Vertex, and cross-link it from the Claude-on-Vertex section (which previously only pointed to the API-key Gemini provider for Gemini models). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(gemini-vertex): add CLAUDE_CODE_USE_GEMINI_VERTEX to isUsing3PServices() The exported isUsing3PServices() helper was missing the Gemini Vertex flag, causing /login //logout to remain visible and auth status to report as first-party when CLAUDE_CODE_USE_GEMINI_VERTEX=1. The local is3P check inside isAnthropicAuthEnabled() was already correct; this aligns the exported helper to match. Adds a dedicated drift guard test targeting isUsing3PServices() directly, since the existing test only covered the separate local is3P block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(gemini-vertex): address CodeRabbit review findings - providerProfile.ts: use firstSanitizedProviderValue for Google alias vars (GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT, GOOGLE_PROJECT_ID, GOOGLE_APPLICATION_CREDENTIALS) so a whitespace-only shell value doesn't shadow a real persisted value - providerProfiles.ts: wrap project alias env lookups with trimOrUndefined() to prevent whitespace-only values blocking the fallback chain - providerProfiles.ts: add GOOGLE_APPLICATION_CREDENTIALS and GEMINI_VERTEX_AUTH_MODE=adc to isEnvOnlyProviderProfile so ADC-only configurations are correctly detected - providerValidation.ts: use resolveGeminiVertexAuthMode() instead of duplicating the auth-mode inference inline - provider.tsx: simplify Gemini Vertex branch condition to effectiveRouteId check only (resolveActiveRouteIdFromEnv already covers the env flag) - system-check.ts: add project validation after credential resolution so the doctor catches missing project in ADC mode (mirrors getProviderValidationError) - provider-bootstrap.ts: use resolveGeminiVertexAuthMode() to infer access-token mode when GEMINI_ACCESS_TOKEN is set without explicit GEMINI_VERTEX_AUTH_MODE - docs/advanced-setup.md: clarify that ADC project derivation only applies in ADC mode; access-token mode requires an explicit project env var Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(gemini-vertex): use resolveGeminiVertexAuthMode in provider-launch Replace duplicated inline auth-mode inference with the shared helper, consistent with provider-bootstrap and system-check (CodeRabbit #3417084093). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(gemini-vertex): persist Vertex creds, sanitize project fallback, harden env test Round-3 CodeRabbit findings on #1614: - provider-bootstrap.ts: carry the active credential into the saved profile. PROFILE_ENV_KEYS clears GEMINI_ACCESS_TOKEN / GOOGLE_APPLICATION_CREDENTIALS on relaunch, so an access-token profile must persist the bearer (and fail fast if absent) and an ADC profile must persist the credentials file — otherwise the saved profile relaunches unauthed (thread 3460713116). - providerProfiles.ts: sanitize each Vertex project candidate with trimOrUndefined() + ?? at the startup-profile site so a whitespace-only GEMINI_VERTEX_PROJECT no longer shadows a real GOOGLE_CLOUD_PROJECT / GCLOUD_PROJECT / GOOGLE_PROJECT_ID (thread 3460713146; the compatibility builder site was already fixed in 0501694). - security-hardening.test.ts: assert env classification via runtime isProviderManagedEnvVar() / SAFE_ENV_VARS.has() instead of slicing source text, so the policy test tracks behavior, not formatting (thread 3460713129). Validation: tsc --noEmit, type-tests, security-hardening.test.ts (13/13), knip — all green. providerProfiles getAPIProvider() timeouts are pre-existing (identical on the unmodified tree). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor(provider-flags): derive flag-agnostic checks from the registry Address jatmn review 4558518184 on PR #1614: - Export hasAnyTruthyProviderSelectionFlag / hasConflictingProviderFlag from providerSelectionFlags.ts so the flag-agnostic call sites derive from the single source of truth instead of hand-enumerating CLAUDE_CODE_USE_* flags. Adopted by hasExplicitProviderSelection, hasNoExplicitNonOpenAICompatibleProvider, isUsing3PServices, and hasConflictingProviderFlagsForProfile (via an exhaustive activeProviderFlagForCompatibilityMode switch that preserves the github-enterprise -> CLAUDE_CODE_USE_GITHUB mapping and is compile-checked). Per-provider checks (hasConcreteProviderSelection, hasCompleteProviderSelection) stay as-is since they are not flag-agnostic. - Give the two source-scanning parity tests an explicit 30s timeout so they no longer flake under parallel test load. - Add unit tests for both helpers covering every registered flag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(gemini-vertex): align access-token startup precedence and use isEnvTruthy Address jatmn review 4565330236 on PR #1614: - [P2] providerProfiles.ts: hasCompleteProviderSelection now treats GEMINI_ACCESS_TOKEN (and GEMINI_VERTEX_AUTH_MODE='access-token') as a concrete Gemini Vertex selection, matching the sibling hasConcreteProviderSelection. Without this, CLAUDE_CODE_USE_GEMINI_VERTEX=1 + GEMINI_ACCESS_TOKEN (no project) was not "complete", so a saved profile could override the user's explicit access-token env selection at startup — unlike the ADC path. Regressions added for both the token and the auth-mode signals. - [P3] providerFlag.ts (applyModelFlagFromArgs) and StartupScreen.ts (detectProvider): recognize the Vertex flag via isEnvTruthy() instead of an exact '1'/'true' match, so 'yes'/'on'/whitespace-normalized values get the same model routing and startup banner as the rest of the codebase. Regressions added for both sites. Validation: tsc --noEmit clean; providerFlag, StartupScreen, providerProfiles, client, routeMetadata, compatibility, providerSelectionFlags suites green. Branch rebased on latest main (integrations artifacts regenerated). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test(gemini-vertex): lock isUsing3PServices drift guard to the flag registry After the round-4 refactor (jatmn review 4558518184) isUsing3PServices() derives from hasAnyTruthyProviderSelectionFlag() instead of hand-enumerating CLAUDE_CODE_USE_* flags, so the source-text drift guard that scanned the function body for the literal CLAUDE_CODE_USE_GEMINI_VERTEX no longer matched and failed under test:full. Update the guard to lock the real post-refactor guarantee: (1) the function routes through the registry helper, and (2) the Vertex flag is registered in PROVIDER_SELECTION_FLAGS (the single source of truth). This tracks the behavior the refactor introduced instead of regressing to the literal-scan drift it eliminated. Validation: bugfixes.test.ts Gemini Vertex guards 5/5 green; tsc --noEmit clean. Remaining local test:full failures are environmental only (FR-locale Intl thousands separator and the CLI-bundle build artifact) and pass on CI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(gemini-vertex): wire flag into env-file allowlist, test scrubs and truthiness Addresses maintainer review on PR #1614: - envFile.ts: add CLAUDE_CODE_USE_GEMINI_VERTEX plus GEMINI_VERTEX_* / GOOGLE_APPLICATION_CREDENTIALS / GCLOUD_PROJECT / GOOGLE_PROJECT_ID to ALLOWED_ENV_FILE_KEYS so --provider-env-file .env no longer silently rejects the documented Vertex setup. Adds a PROVIDER_SELECTION_FLAGS-derived parity test plus a full Vertex .env load test. - Add CLAUDE_CODE_USE_GEMINI_VERTEX to the provider env scrub/restore lists in betas, conversationRecovery, model, withRetry and promptCacheBreakDetection tests to prevent cross-test flag leakage. - providerFlag.applyModelFlagFromArgs and StartupScreen.detectProvider: use isEnvTruthy for all provider flags instead of literal '1'/'true' checks, removing the Vertex-only inconsistency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(gemini-vertex): address CodeRabbit review — drift, malformed-history and credential hardening Verified each CodeRabbit finding against current code; applied the valid ones, skipped two with documented reasons. Provider-flag drift / registry adoption: - auth.ts: isAnthropicAuthEnabled's is3P gate now derives from hasAnyTruthyProviderSelectionFlag() instead of a hand-maintained 8-flag list. - routeMetadata.ts: reuse the shared hasConflictingProviderFlag() helper instead of an inline PROVIDER_SELECTION_FLAGS scan. - withRetry/promptCacheBreakDetection tests: derive env scrub lists from PROVIDER_SELECTION_FLAGS so new flags are covered automatically. - bugfixes drift guard updated to assert the registry derivation rather than the now-removed literal in auth.ts. Credential / managed-env correctness: - managedEnvConstants.ts: treat GOOGLE_APPLICATION_CREDENTIALS as provider-managed so host-managed sessions can't have ADC creds swapped via settings. - providerStartupOverrides.ts: clear the Google ADC/project aliases (GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT, GOOGLE_PROJECT_ID) so a cleared Vertex override can't stay partially active. - agentRouting.ts: clear the Vertex-specific selectors before forcing an OpenAI-compatible override, mirroring the existing GEMINI_MODEL/BASE_URL clears. - providerProfile.ts: treat GEMINI_VERTEX_AUTH_MODE as a concrete Vertex signal in hasConcreteProviderSelection (mirrors hasCompleteProviderSelection). - client.ts: reuse resolveGeminiVertexAuthMode() instead of an inline auth-mode computation (trims whitespace tokens, validates the mode). - system-check.ts: use getGeminiVertexLocation() so doctor output matches runtime. - openaiShim.ts: pick the first non-blank credential so a whitespace-only OPENAI_API_KEY no longer suppresses a real GITHUB_TOKEN/GH_TOKEN (+regression). Malformed-history hardening: - messages.ts: validate the first content block before reading .type/.text; sanitize non-string tool_result.tool_use_id to mirror the assistant id path. - normalizeMessages malformed test: cover falsy slots and unknown message types. - providerConfig.envDiagnostics test: clear CLAUDE_CODE_USE_GITHUB in Vertex tests. Skipped (documented): - log.ts saved-profile gate: importing isGeminiVertexEffectiveProvider would create a log -> providerProfiles -> config -> log cycle (config.ts imports log.ts). - providerProfiles.ts hasCompleteProviderSelection access-token gate: CodeRabbit asked to require a project, which contradicts the maintainer's explicit P2 request to treat a bare access-token Vertex selection as complete. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(gemini-vertex): require project for token-only, gate logs, validate region Addresses jatmn's round-7 review (6 findings): - P1 hasCompleteProviderSelection: an access-token / token-only Vertex env (GEMINI_ACCESS_TOKEN or GEMINI_VERTEX_AUTH_MODE=access-token) with no project is unusable — the native client throws "project is required" since only ADC can derive a project. Such a stale shell no longer counts as complete, so it stops suppressing the saved active profile. Reverses the round-5 tests that encoded the opposite (now corrected). - P1 logError gate: use isGeminiVertexEffectiveProvider() so a saved-profile-only Vertex session (no env flag) gets the same no-error-reporting treatment. - P2 buildCurrentProviderSummary: merge the saved Vertex profile env so the /provider summary shows the saved project/model/location in profile-only mode. - P2 detectProvider: honor profile-only Vertex routing via the effective provider/profile logic (mirrors getAnthropicClient) instead of the raw flag. - P2 global-only models: reject gemini-3.5-flash on a regional GEMINI_VERTEX_ LOCATION via isGlobalOnlyVertexModel() rather than building an unusable URL. - P3 isNotEmptyMessage: reject typeless first content blocks ({ foo: 'bar' }) before the non-text branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(gemini-vertex): tighten ADC completeness, neutral project placeholder, hermetic tests Addresses CodeRabbit review on |
||
|
|
8be7274b90 |
feat(minimax): default to M3.1 Flash and refresh text suggestions (#2297)
* feat(minimax): default to M3.1 Flash and refresh text suggestions * fix(minimax): preserve explicit selections and retire stale Zen suggestions * fix(minimax): preserve Ollama discovery and validate cached options * fix(minimax): preserve local discovery and validate picker caches * fix(minimax): preserve gateway-owned model availability --------- Co-authored-by: octo-patch <266937838+octo-patch@users.noreply.github.com> Co-authored-by: jatmn <the@jat.mn> |
||
|
|
e3c9a873dc |
fix(utils): model Node's NODE_OPTIONS grammar in hasNodeOption (#2188)
* fix(utils): make hasNodeOption handle --flag=value and quoted NODE_OPTIONS
- Match exact flag or flag with =value suffix to support --max-old-space-size=4096, --inspect=0.0.0.0:9229 etc.
- Strip surrounding single/double quotes for quoted NODE_OPTIONS tokens
- Avoid false positives where --inspect incorrectly matched --inspect-brk
- Filter empty tokens from whitespace split
Fixes edge case where hasNodeOption('--max-old-space-size') returned false when NODE_OPTIONS contained '--max-old-space-size=4096'
* fix(utils): align hasNodeOption with Node lexer, add regression tests
- Only strip double quotes (Node's NODE_OPTIONS parser treats single quotes as literal)
so NODE_OPTIONS="'--use-system-ca'" correctly returns false and does not
incorrectly enable system CA roots (covers 145 vs 302 cert divergence reported
in review)
- Keep exact / --flag=value matching, double-quoted positives, prefix boundary
(--inspect vs --inspect-brk), whitespace filtering
- Add table-driven tests for both CA flags (--use-system-ca, --use-openssl-ca)
covering exact, equals, double-quoted positive, single-quoted negative,
repeated whitespace, and --inspect boundary; restores process.env.NODE_OPTIONS
after each case
Fixes CodeRabbit docstring coverage and jatmn P2 quote-grammar issue in PR #2188
* fix(utils): quote-aware tokenization for hasNodeOption
Parse NODE_OPTIONS respecting double quotes so option-like text inside a quoted
value does not create spurious flags (e.g. --conditions "foo --use-system-ca bar"
must not match --use-system-ca). Verified on Node 22.23.2 that --expose-gc
inside a quoted --conditions value does not enable GC while an explicit flag
does. Add table-driven cases for this grammar and keep previous single-quote
literal + double-quote handling and prefix boundary fixes.
Addresses CodeRabbit quote-grammar issue on
|
||
|
|
cdb28e0e3e |
feat(i18n): add Traditional Chinese (zh-HK) locale support (#2193)
* ' * feat(i18n): add zh-HK locale and fix extensionless imports * fix(i18n): restore original en/vi dictionaries and fix zh-HK exports * fix(i18n): resolve import paths, file duplication, and locale matching * fix(i18n): restore working import paths, localize() API, and session-based locale detection for zh-HK * fix(i18n): use Map for locale lookup to avoid prototype-key collisions * fix(i18n): restore working import paths, localize() API, exports, and session-based locale detection * fix(i18n): correct onboard-github key mismatch in zh-HK dictionary * test(i18n): clear locale env vars in beforeEach to isolate settings-based fallback tests * fix(i18n): preserve command meaning and POSIX locale normalization --------- Co-authored-by: jatmn <the@jat.mn> |
||
|
|
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>
|
||
|
|
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. |
||
|
|
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 |
||
|
|
d6e0e86be3 | fix(vscode): preserve Windows launcher argument boundaries | ||
|
|
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> |
||
|
|
3e68b6d397 | fix(ollama): honor explicit thinking without changing defaults | ||
|
|
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 |
||
|
|
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 |
||
|
|
5f91412177 | chore: remove obsolete Node 22 compatibility code (#2412) |