Commit Graph

262 Commits

Author SHA1 Message Date
musistudio 065be3bf99 chore: release v3.0.20 2026-08-07 15:49:19 +08:00
musistudio 8cab2dbb7a Merge dev/3.1 into main for v3.0.20 2026-08-07 15:41:27 +08:00
musistudio c8825cf5cd Rename browser usage mode to Browser request 2026-08-07 15:04:43 +08:00
musistudio 83a7979c0b Implement routing updates 2026-08-07 14:57:45 +08:00
musistudio 1f5cc499f1 Improve Claude Design asset discovery and product runtime support 2026-08-07 11:51:19 +08:00
musistudio 860f41b187 Add provider logos to account balance widgets 2026-08-06 17:51:51 +08:00
musistudio 4097bbe5e7 Improve router configuration and request handling 2026-08-06 17:41:41 +08:00
musi 70b51b08d4 Merge pull request #1634 from flaviomartil/fix/grok-peer-rotated-credential
fix(grok): adopt peer-rotated credential on refresh 401
2026-08-06 16:12:24 +08:00
musistudio 240cd73c1c Merge branch 'dev/3.1' into dev/docs
# Conflicts:
#	docs/src/content/docs/en/configuration/profiles.md
#	docs/src/content/docs/zh/configuration/profiles.md
2026-08-06 14:16:12 +08:00
musi 3c71252de1 Add interactive docs demos 2026-08-06 14:10:32 +08:00
musistudio 89081a2082 Preserve target-provider slash model routing 2026-08-06 14:07:56 +08:00
Flavio martil 01d275892e fix(grok): coalesce in-process refreshes and unexport GrokRefreshAuthError
Address review on #1634:

- keep GrokRefreshAuthError module-private, consistent with the updated
  Kimi implementation, avoiding new public API surface;
- dedupe concurrent resolveGrokAuth calls with a per-credential in-flight
  refresh map keyed by sourceFile + authRecordKey, mirroring
  kimiRefreshInFlight, so parallel requests share one refresh (and its
  peer-rotation adoption outcome) instead of racing the same stale
  refresh token;
- add a test proving concurrent refreshes coalesce into a single token
  request.
2026-08-06 01:14:09 -03:00
musistudio 94674ba2e6 Add web content JSON provider account connectors 2026-08-06 11:36:11 +08:00
Flávio Martil c2e478691a fix(kimi): harden peer-rotation adoption per review
Address review feedback: keep KimiRefreshAuthError internal to the
module, and require an access token on the adopted credential so a
partially written file cannot mask the real refresh failure.
2026-08-05 10:54:53 -03:00
Flávio Martil bb018e95cf fix(grok): adopt only the same account record on peer rotation
Address review feedback: in a multi-account auth.json, re-reading all
records could adopt a different account just because its refresh token
differs. Restrict adoption to the same sourceFile + authRecordKey that
was being refreshed, and require an access token on the adopted record
so a partially written file cannot mask the real failure.
2026-08-05 10:53:56 -03:00
Flávio Martil b6248f3708 fix(grok): adopt peer-rotated credential on refresh 401
The Grok refresh token rotates on every refresh. CCR reads and writes
the same ~/.grok/auth.json as the Grok CLI, so when the CLI (or any
other consumer of the file) refreshes first, the refresh token CCR
holds is invalidated and the refresh fails with 401/403. Previously the
error propagated to the caller even though the file on disk already
held a valid, newer credential.

On 401/403 from the refresh endpoint, re-read the credential records
once and, when the stored refresh token differs from the rejected one,
adopt the on-disk credential instead of failing the request. Other
errors propagate unchanged, and a 401 without a peer rotation still
surfaces as before. Same treatment as the Kimi provider fix.
2026-08-05 10:53:22 -03:00
musistudio b4e6185172 Separate enhanced route from profile routing settings 2026-08-05 20:23:08 +08:00
musistudio df42fe8683 Propagate provider context for Fusion model discovery 2026-08-05 20:06:58 +08:00
Flávio Martil 1ea0c960a7 fix(kimi): adopt peer-rotated credential on refresh 401
The Kimi refresh token rotates on every refresh. CCR reads and writes
the same ~/.kimi/credentials file as the Kimi CLI, so when the CLI (or
any other consumer of the file) refreshes first, the refresh token CCR
holds is invalidated and the refresh fails with 401/403. Previously the
error propagated to the caller even though the file on disk already
held a valid, newer credential.

On 401/403 from the refresh endpoint, re-read the credential file once
and, when the stored refresh token differs from the rejected one, adopt
the on-disk credential instead of failing the request. Other errors
propagate unchanged, and a 401 without a peer rotation still surfaces
as before.
2026-08-05 08:59:22 -03:00
musistudio b41890610c chore: release v3.0.19 2026-08-05 18:58:13 +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 62ca009716 feat: update ai-gateway version 2026-08-05 16:48:24 +08:00
musistudio 0e1d9f4c05 Add Codex multi-agent bridge and provider model descriptions 2026-08-05 16:24:36 +08:00
musistudio b4afa55c49 Offload large network log body formatting to a web worker 2026-08-05 15:49:18 +08:00
musistudio 561c2d813c Add local agent auth provider hook support 2026-08-04 15:34:47 +08:00
musistudio 4cba6b51a8 Apply provider capability routing per upstream attempt 2026-08-04 10:21:51 +08:00
musi bc8a8e6205 Merge pull request #1618 from NDViet/main
fix(ui): repair provider setup flow in Get Started onboarding
2026-08-03 13:20:37 +08:00
musi 7a51e892cc Merge pull request #1622 from jesieleo/fix/codex-oauth-live-credentials
fix(codex): 同步本地登录的最新 OAuth 凭据
2026-08-03 13:20:24 +08:00
musi 454daec31c Improve documentation navigation and extension guidance 2026-08-03 08:40:36 +08:00
pacocartones 174ab41849 fix(gateway): compare API keys in constant time
The gateway API key authorizer matched the presented token against every
configured key with `item.key === token`, a variable-time string
comparison that returns on the first differing byte. The repository
already avoids that shape for its other secrets: context-archive.ts,
management-server.ts and media/service.ts each compare tokens through a
local timingSafeEqual helper with a length guard.

Route the gateway API key lookup through the same helper shape so all
secret comparisons behave identically. The length guard is kept so a
token of a different length is rejected rather than making
timingSafeEqual throw.

Behaviour is unchanged: valid keys authorize, unknown keys still return
401 "Invalid API key.", expired keys still return 401 "API key is
expired.", and the refresh-on-miss reload path is preserved.
2026-08-02 19:41:27 +02:00
musi bd9ffd385c Merge pull request #1623 from jesieleo/fix/ui-responsive-overflow
fix(ui): 修复窄窗口下侧栏和账户卡片内容被遮挡的问题
2026-08-02 17:09:36 +08:00
musi 991b04fde6 Merge pull request #1621 from mindops/codex/show-routed-model-logs
fix: show routed model in request logs
2026-08-02 17:06:44 +08:00
jesieleo 440241faa0 fix(ui): prevent responsive panels from clipping content 2026-08-02 12:46:10 +08:00
jesieleo c86e86038a fix(codex): refresh OAuth credentials from local login 2026-08-02 12:46:00 +08:00
willyang 9331c9cbef fix: show routed model in request logs 2026-08-01 16:22:06 +08:00
ezra-quemuel 24a4861aa6 fix(config): translate top-level provider protocol into a capability
Local-agent login imports (Codex API et al.) declare the provider protocol
at the top level of the payload (protocol: "openai_responses") and carry no
capabilities array. parseProviders dropped that field, so the saved provider
ended up with neither protocol nor capabilities and the gateway fell back to
the default openai_chat_completions adapter. For Responses-only backends
(chatgpt.com/backend-api/codex) every request then 404s against a
non-existent /chat/completions route.

Synthesize a single capability from the top-level protocol (and the
provider's base URL) when no explicit capabilities are configured, reusing
the existing protocol normalization used for capability items. Explicit
capabilities still win. Fixes #1619.
2026-07-31 17:24:39 -07:00
Viet Nguyen Duc ba80cc81eb fix(ui): repair provider setup flow in Get Started onboarding
The onboarding wizard and the Add/Edit Provider dialog render the same
AddProviderForm, but the wizard is wired up differently, and several
defects lived in those differences.

Model probe never fired during onboarding. The model-probe useEffect in
App.tsx guarded on `providerAddOpen` only, which is set true solely when
opening the manual Add/Edit Provider dialog. It is never set during the
onboarding wizard, so after entering an endpoint + API key on the Get
Started flow and reaching the "Pick models" step,
probeProviderCandidates() never fired and the model list stayed empty
with no loading state. Regressed in 9f704fc ("Guide onboarding through
granular provider setup steps"), which narrowed the guard from
`providerAddOpen || (activeView === "onboarding" && onboardingStep === "provider")`
down to `providerAddOpen`. Restore the broader guard so the probe runs
both when the dialog is open and when onboarding is on the provider step.

A rejected API key produced an empty model list with no feedback. Typing
an API key switches the probe from mode "protocols" to mode "models",
but the error-reporting branch was guarded on `probeMode !== "models"`,
so it never ran in exactly that mode. The backend still runs full
protocol probing in models mode, so a 401 came back as `supported: false`
with a real message that was then discarded. Report the failure, while
staying quiet when models were discovered, since a provider can expose a
working catalog while a protocol probe endpoint 404s.

"Added models" faked a loading state for data it already had. The panel
renders local draft state, yet showed a skeleton and hid its whole
toolbar whenever the catalog probe re-ran, leaving the header badge
reading a real count above shimmer rows and removing the "Custom model"
button, the only way to add models on a provider with no catalog. Keep
both panels' controls mounted, disabling the catalog search while
loading, which also removes a layout shift and mid-typing focus loss.

An empty catalog gave no way forward, so point at "Custom model" (en+zh).

Onboarding's "Check Connection" spent real credits with no confirmation.
The dialog wraps onCheck in a confirm step that warns about account
balance, lets the user pick models, and shows per-model results;
onboarding passed onCheckProvider straight through, so one click fired a
billable request against every configured model and discarded the
report. Extract that step as ProviderConnectivityCheckDialog and use it
from both surfaces.

ProviderConnectionStatusRow hardcoded bg-emerald-50 / border-emerald-200
/ bg-amber-50 with no dark variant, so the "Verify connection" status
chips rendered as bright light blobs on the dark card. Use alpha fills,
matching the pattern used elsewhere in the file.

The provider error banner was not announced; add role="alert".

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
2026-08-01 06:47:14 +07:00
musistudio ccf63088ea Fix Bot Gateway stdio runner handling in Electron 2026-07-31 17:25:33 +08:00
musistudio 4a152d959c feat: update ai-gateway version 2026-07-31 15:39:56 +08:00
musistudio 6a3509dbb2 Merge dev/3.1 into main for v3.0.18 2026-07-31 15:37:47 +08:00
musistudio e8ae64f5a2 feat: update ai-gateway version 2026-07-31 15:33:46 +08:00
musistudio 3f566d991a Preserve API keys across provider probes 2026-07-31 14:50:19 +08:00
musistudio 39a5712ae7 Prepare Claude App VM storage before launch 2026-07-31 11:55:10 +08:00
musistudio 43f99b2de8 Use Token consistently in Chinese UI labels 2026-07-30 18:44:03 +08:00
musi 2bceead04b Merge pull request #1605 from ShiroKSH/fix/abort-retry-backoff
fix(gateway): abort retry backoff on disconnect
2026-07-30 17:33:09 +08:00
musistudio 571aa63602 Show request and trace costs in agent observability 2026-07-30 17:32:34 +08:00
musistudio 7b6a14301c Refine subagent model extraction and add detection tests 2026-07-30 15:29:56 +08:00
musistudio e778687774 Show partial agent session failures in observability UI 2026-07-30 15:25:50 +08:00
ShiroKSH 7fcdeef78a fix(gateway): restore retry executor 2026-07-29 16:00:33 +03:00
ShiroKSH 546719003c fix(gateway): abort retry backoff on disconnect 2026-07-29 15:58:35 +03:00