49 Commits
Author SHA1 Message Date
musistudio df42fe8683 Propagate provider context for Fusion model discovery 2026-08-05 20:06:58 +08:00
musistudio 0fd7bf755f Merge dev/3.1 into main for v3.0.19
# Conflicts:
#	packages/ui/src/pages/home/components/network-logs.tsx
2026-08-05 18:56:16 +08:00
musistudio 0e1d9f4c05 Add Codex multi-agent bridge and provider model descriptions 2026-08-05 16:24:36 +08:00
jesieleo c86e86038a fix(codex): refresh OAuth credentials from local login 2026-08-02 12:46:00 +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
musi 8f0b2d91e5 Refactor routing architecture and update project structure 2026-07-29 09:30:04 +08:00
musistudio c0e4dba2c3 Expose model output limits in OpenCode configuration 2026-07-28 20:05:21 +08:00
musistudio 6cfd3f226f Expand core functionality and update related components 2026-07-28 17:44:49 +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 31c14ea82e feat: bundle Claude Design for desktop app 2026-07-26 18:09:01 +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 808a9c831c Refactor project structure and remove obsolete code 2026-07-24 15:26:37 +08:00
musi 51725911c7 Merge branch 'fix-priority-ui-issues' into dev/3.1 2026-07-24 13:39:26 +08:00
musi 86a383f647 Merge branch 'main' into dev/compact
# Conflicts:
#	packages/core/src/config/config.ts
#	packages/core/src/contracts/app.ts
#	packages/core/src/gateway/service.ts
#	packages/core/src/profiles/service.ts
#	packages/core/test/unit/agents/context-archive.test.mjs
#	packages/core/test/unit/gateway/codex-patch-bridge.test.mjs
#	packages/ui/src/pages/home/components/profiles.tsx
#	packages/ui/src/pages/home/shared/profiles.ts
#	tests/main/profile-service.test.mjs
#	tests/main/router-builtins.test.mjs
2026-07-23 09:24:28 +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 c856b36d50 Merge branch 'main' into dev/extensions 2026-07-21 21:36:17 +08:00
musi 8154f3ef12 Merge pull request #1548 from camjac251/fix/provider-plugin-runtime-identity
fix(gateway): align provider plugin runtime identity
2026-07-21 20:08:57 +08:00
musi 3d84d7c194 Merge pull request #1547 from camjac251/test/loopback-listener-readiness
test(gateway): wait for loopback listener readiness
2026-07-21 20:06:01 +08:00
musi 999e335fdc Merge pull request #1555 from H-TTTTT/fix/issue-1535-fallback-model
test(claude-app): lock in routable discovery default for #1535
2026-07-21 19:29:10 +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
camjac251 26d9d4cb3f test(gateway): cover delayed media listeners
Loopback listen callbacks can precede connection readiness on some hosts,
which makes otherwise deterministic media fixtures fail with refused fetches.
Reuse one TCP readiness probe before issuing requests in each affected test.
2026-07-20 14:44:42 -04:00
camjac251 16a53bb3a9 fix(gateway): preserve local oauth provider base url
Runtime identity normalization previously ran before local OAuth provider
detection, so display-name matching could no longer select the managed
backend endpoint. Defer identity normalization until after detection and
cover the ordering with a regression test.
2026-07-20 13:10:40 -04:00
camjac251 24e52a64f3 fix(gateway): align provider plugin runtime identity
Provider compilation replaces display and capability aliases with stable
runtime identifiers, but plugin targets and fallback headers could retain
the precompiled names. Normalize both paths so routing and authentication
refer to the provider identity that the gateway actually registers.
2026-07-20 13:09:41 -04: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 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
OpenCode Builder 5c4bc584c7 test(claude-app): lock in routable discovery default for #1535
The hardcoded CLAUDE_APP_FALLBACK_MODEL ("claude-sonnet-4-5") that issue
#1535 reported was already removed in 7b0e203 ("Refine Claude app model
discovery and fallback routing"), so GET /v1/models no longer surfaces the
unroutable bare fallback as the first/default model, and the model registry
now resolves a bare "claude-sonnet-4-5" to its configured provider.

Add a regression test using the issue's exact three-provider config that
asserts both invariants: the discovered default round-trips through the
request rewrite path to a provider-prefixed selector, and a bare fallback id
resolves to a provider rather than falling into model-chain fallback.

Fixes #1535
2026-07-17 10:23:16 +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
musi 2aa3529449 Refactor router internals and remove obsolete code 2026-07-15 06:39:29 +08:00