Commit graph

70 commits

Author SHA1 Message Date
musistudio
df42fe8683 Propagate provider context for Fusion model discovery 2026-08-05 20:06:58 +08:00
musistudio
0e1d9f4c05 Add Codex multi-agent bridge and provider model descriptions 2026-08-05 16:24:36 +08:00
musistudio
ccf63088ea Fix Bot Gateway stdio runner handling in Electron 2026-07-31 17:25:33 +08:00
musistudio
6a3509dbb2 Merge dev/3.1 into main for v3.0.18 2026-07-31 15:37:47 +08:00
musistudio
39a5712ae7 Prepare Claude App VM storage before launch 2026-07-31 11:55:10 +08:00
Matteo Antoci
70d31ab47e fix(claude-code): never resolve a token from inside mcpOAuth
Review on #1604: preferring `claudeAiOauth` was not enough. A record holding
only `mcpOAuth` entries still produced a token, because the fallback ran a
recursive `findOauthTokenSet()` over the whole record and `mcpOAuth`
per-plugin records carry their own `accessToken`. That imports a plugin
token as a Claude Code provider and recreates the 401 the change was meant
to avoid. It also short-circuited the plaintext-file fallback, so a usable
`~/.claude/.credentials.json` was ignored in favour of the plugin token.

Restrict both lookups to root-level token fields instead of reordering the
recursive search. Root-level excludes *any* nested container, so a future
sibling of `mcpOAuth` cannot reintroduce the hole, and the pre-`claudeAiOauth`
layout that kept tokens at the record root still resolves.

Extract `readOauthTokenSetFields()` out of `findOauthTokenSet()` in shared.ts
rather than duplicating the field list. `findOauthTokenSet()` keeps its
behaviour, so codex/grok/kimi/opencode/zcode are unaffected.

Apply the same restriction to the credentials-file path: Claude Code writes
that file with the identical record shape, mcpOAuth included, so the hazard
was present there too.

Adds the two regression tests from the review verbatim.

Refs #1601, #1567
2026-07-29 14:34:09 +02:00
musistudio
ea501e95f3 Fix deck-stage captures and Windows SDK path resolution 2026-07-29 19:04:41 +08:00
Matteo Antoci
519b92d406 fix(claude-code): look up the keychain item by account
Claude Code >= 2.1 writes its credential item under the current $USER and
leaves any pre-2.1 item (account "unknown") in place on the *same* service
name, `Claude Code-credentials`. `security find-generic-password -s <svc> -w`
with no `-a` matches an arbitrary one of them, so CCR read the stale legacy
item: the read exits 0, the JSON parses, and it carries only `mcpOAuth`.
`findOauthTokenSet()` then correctly returns undefined and the candidate is
silently dropped by the `status !== "missing"` filter in service.ts.

Resolve the item through tiered candidates, evaluated lazily so the normal
case stays at one `security` call:

1. the expected service name, derived the way Claude Code derives it
   (`Claude Code${oauthSuffix}-credentials${configSuffix}`, where
   configSuffix is `-${sha256(NFC(configDir)).slice(0, 8)}` once
   CLAUDE_CONFIG_DIR / CLAUDE_SECURESTORAGE_CONFIG_DIR is set), read under
   the current account;
2. `security dump-keychain` enumeration, newest-modified first, for items
   under another account or a config dir this process cannot reconstruct.
   Without `-d` that prints item metadata only: it never decrypts a
   password and never prompts;
3. the previous accountless read, as a last resort.

Prefer an explicit top-level `claudeAiOauth` across every candidate and fall
back to the recursive search only if none has one. `mcpOAuth` holds
per-plugin OAuth records that also carry `accessToken`, and key order puts
it first, so a recursive match could import an MCP plugin token as an
Anthropic provider that then 401s on every request.

Surface diagnostics instead of swallowing them: capture `security` stderr
rather than discarding it via `stdio: ["ignore","pipe","ignore"]`, and
return a `locked` candidate naming the reason when login state exists but
yields no token, so it survives the `status !== "missing"` filter. Treat
errSecItemNotFound (exit 44) as absence rather than an error, so a machine
with no Claude Code login still reports `missing`.

Also fix the file fallback: continue past a credentials file that holds no
token instead of returning it, and check the secure-storage config dir,
which the env vars above can relocate away from ~/.claude.

Refs #1601, #1567
2026-07-29 11:53:30 +02:00
musistudio
c0e4dba2c3 Expose model output limits in OpenCode configuration 2026-07-28 20:05:21 +08:00
musistudio
d305f87e67 Cap imported Codex GPT-5 context windows 2026-07-28 15:15:14 +08:00
musistudio
2c89b212ef Merge branch 'main' into dev/3.1
# Conflicts:
#	packages/core/test/unit/gateway/upstream-header-sanitizer.test.mjs
2026-07-28 09:54:13 +08:00
musi
6971be8e87 Unify config storage and gateway bootstrap 2026-07-27 16:51:03 +08:00
jesieleo
74fa35f374 fix(zcode): resolve Fusion model context windows 2026-07-27 12:58:14 +08:00
jesieleo
237b4924b7 fix(zcode): use model catalog context windows 2026-07-27 08:56:52 +08:00
musi
7c4a877c99 feat: support Kilo Code profiles 2026-07-26 22:09:24 +08:00
musistudio
28a613c26a Merge branch 'dev/extensions' into codex/claude-design-profile 2026-07-24 23:19:13 +08:00
musistudio
084b660cd4 Document Pi agent profile support 2026-07-24 17:38:39 +08:00
musistudio
7867065099 Support Claude Code model aliases in profiles 2026-07-24 16:38:24 +08:00
musi
51725911c7 Merge branch 'fix-priority-ui-issues' into dev/3.1 2026-07-24 13:39:26 +08:00
musi
018db8f566 chore: checkpoint local changes 2026-07-23 23:06:32 +08:00
musistudio
54acd2fc15 Prefer live Claude Code OAuth credentials 2026-07-22 10:01:08 +08:00
musi
04a9f60041 Enable Claude Design app window and secure request handling 2026-07-21 22:17:39 +08:00
musi
aecb74405c fix: update Codex catalog and plugin settings handling 2026-07-21 15:43:51 +08:00
musi
062158a00a Merge remote-tracking branch 'origin/main' into dev/extensions
# Conflicts:
#	packages/cli/src/cli.ts
#	packages/core/src/agents/codex/model-catalog.ts
#	packages/core/src/config/config.ts
#	packages/core/test/unit/agents/agent-console-launcher.test.mjs
#	packages/core/test/unit/agents/plugin-permissions.test.mjs
#	packages/core/test/unit/agents/plugin-stop-reason.test.mjs
#	packages/core/test/unit/agents/socket-compat.test.mjs
#	packages/electron/src/main/ipc.ts
#	packages/ui/test/component/extensions.test.ts
#	tests/main/codex-model-catalog.test.mjs
2026-07-21 12:43:12 +08:00
musi
88c07b605a Merge branch 'main' into dev/3.1
# Conflicts:
#	package-lock.json
#	package.json
#	packages/cli/package.json
#	packages/core/package.json
#	packages/core/src/contracts/ipc-channels.ts
#	packages/core/src/gateway/claude-code-router-plugin.ts
#	packages/ui/test/component/layout.test.tsx
2026-07-20 22:09:34 +08:00
musistudio
6c1a90889b Refactor router implementation and configuration 2026-07-20 20:21:18 +08:00
musistudio
ecdf2fec0f Support xAI video generation and isolate Codex authentication 2026-07-20 15:38:13 +08:00
musistudio
225b3c23df Improve Codex authentication and app-server launch handling 2026-07-20 14:36:26 +08:00
musistudio
42cc9dbd74 Add NVIDIA NIM provider preset and preserve Claude model selection 2026-07-20 11:08:04 +08:00
musistudio
3f8d450366 Refactor routing architecture and update related modules 2026-07-20 10:10:57 +08:00
H-TTTTT
ba3b34e189 fix(opencode): stop forcing Bearer public on public local-agent imports
Public OpenCode imports wrote strict providerPlugins auth with
authorization: Bearer public, which overrode a later real Providers
api_key edit and caused upstream 401s. Put the public token on the
provider api key instead and skip the plugin override.

Fixes #1562
2026-07-20 09:32:17 +08:00
musistudio
5021cc35c0 Enable apply_patch bridging for all non-GPT Codex models 2026-07-20 07:13:53 +08:00
musistudio
9fb8a89831 Update routing workflows and supporting configuration 2026-07-19 20:07:40 +08:00
musistudio
f18759aa8f Add ultra effort and refine model reasoning profiles 2026-07-16 11:23:24 +08:00
musi
9b3339e4e4 Merge branch 'main' into dev/3.1
# Conflicts:
#	packages/core/src/gateway/request/pipeline.ts
#	packages/core/src/observability/request-log-store.ts
#	packages/core/test/integration/observability/request-log-store.test.mjs
#	packages/core/test/unit/agents/gateway-upstream-error-log.test.mjs
#	packages/core/test/unit/agents/provider-model-metadata.test.mjs
2026-07-15 22:08:49 +08:00
musistudio
555b31477d Refactor router internals and update related tests 2026-07-15 20:24:04 +08:00
musistudio
2e979d9e48 Merge branch 'dev/3.1' into dev/extensions
# Conflicts:
#	packages/core/src/agents/codex/cli-middleware-runtime.ts
#	packages/core/src/config/config.ts
#	packages/core/src/gateway/service.ts
#	packages/ui/src/pages/home/App.tsx
#	packages/ui/src/pages/home/shared/controls.tsx
#	tests/main/codex-cli-middleware-runtime.test.mjs
2026-07-15 10:14:30 +08:00
camjac251
5a3eda0912
fix(gateway): preserve provider context metadata
Provider imports exposed live context limits, but CCR discarded them and
fell back to stale static entries. Preserve physical and effective limits
so generated catalogs and model discovery advertise the provider-specific
usable window.
2026-07-14 19:15:39 -04:00
musistudio
9e56580334 feat: enhance app bot relay 2026-07-14 20:58:08 +08:00
musistudio
2bf349fe03 Add OpenCode bot worker support 2026-07-14 17:30:37 +08:00
musistudio
84855c4dd4 Add OpenCode profile support 2026-07-14 16:49:08 +08:00
musistudio
7b0e203693 Refine Claude app model discovery and fallback routing 2026-07-14 14:46:54 +08:00
musistudio
b03728f816 Merge branch 'main' into dev/3.1
# Conflicts:
#	packages/cli/src/cli.ts
#	packages/core/src/gateway/service.ts
#	packages/core/src/profiles/launch-service.ts
#	tests/main/profile-service.test.mjs
2026-07-13 20:14:03 +08:00
musistudio
a8bfa6363e Improve router configuration and request handling 2026-07-13 20:02:45 +08:00
musistudio
1d8ff6742c Refine router configuration and request handling 2026-07-13 16:41:45 +08:00
musistudio
645fde1878 Refactor router execution flow and update related tests 2026-07-13 15:16:07 +08:00
musistudio
0196fdebeb Add Grok CLI local provider support 2026-07-13 08:48:39 +08:00
musistudio
1bd3761d70 Disable unsupported Agent Console providers 2026-07-12 18:10:52 +08:00
musistudio
126a0a8ad0 Refactor router config and improve provider handling 2026-07-11 23:52:08 +08:00
musistudio
5ddbacee18 Document CCR as a local control plane and add ZCode home support 2026-07-11 21:27:56 +08:00