74 Commits
Author SHA1 Message Date
musistudio 9387b5b190 fix(providers): persist deselected protocols (#1765) 2026-09-09 20:13:51 +08:00
musistudio b0d59afe08 Refactor routing configuration and improve provider support 2026-09-09 19:43:16 +08:00
musistudio 2b57c6078f Merge branch 'feat/ai-gateway' into dev/3.1
# Conflicts:
#	packages/core/src/gateway/core-runtime/upstream-header-sanitizer.ts
2026-09-02 20:24:42 +08:00
musistudio 61f8d8a60a Merge branch 'main' into dev/3.1 2026-09-02 20:21:32 +08:00
musistudio 923c742103 Add overview statistics reset with persistent reset tracking 2026-09-02 19:40:54 +08:00
musistudio a8d7038778 Add account filtering and range-aware tray activity widgets 2026-08-25 19:06:24 +08:00
songkuan-zheng 7f2500980d fix(ui): document the raw ai-gateway extraBody shape instead of byModel
Review follow-up: byModel is ai-gateway's normalized internal form
(parseModelScopedBody treats only `default` and actual model names as
scope keys); the raw config saved to disk is `default` plus top-level
model-name keys. The help text, i18n rows and the round-trip test now
use that raw shape.
2026-08-25 06:08:44 +00:00
songkuan-zheng e4ad5db099 feat(ui): edit extraBody and extraHeaders from Advanced settings
The provider dialog had no field for either, so both were config-file
only: invisible in the UI and only editable by hand-writing the config
or writing to the config database directly.

Adds two JSON boxes to the Advanced settings section, next to the usage
connector body that already uses this pattern. They open pre-filled with
whatever the provider carries, and a malformed or non-object value blocks
the save with an inline error instead of writing something the gateway
would ignore.

extraBody and extraHeaders leave providerManualFieldsForSave now that the
draft round-trips them; billing, provider and transformer stay there.
2026-08-25 06:08:22 +00:00
songkuan-zheng 1e696434c8 fix(ui): keep hand-written provider fields when saving from the dialog
Saving a provider from the setup dialog replaced the stored entry with an
object rebuilt from the dialog draft, so every field the form does not
expose was dropped: extraBody, extraHeaders, transformer, billing and the
legacy provider protocol alias.

These only ever come from a hand-written config, and the loss is silent —
the provider keeps working, just without the upstream parameters it was
configured with. Re-typing a base URL on a provider carrying
`extraBody: { default: { reasoning_effort: "high" } }` is enough to turn
reasoning off with no error and no visible change in the UI.

Carry those fields over from the existing provider on edit. The legacy
apiKey/apikey/baseUrl/baseurl aliases are deliberately not carried over:
the form writes the canonical api_key/api_base_url, and a stale alias
would shadow the value the user just typed.
2026-08-25 06:08:13 +00:00
musistudio f2360ac046 Merge branch 'main' into dev/3.1 2026-08-24 20:02:57 +08:00
musistudio ccd00632ac Update project files 2026-08-22 16:12:46 +08:00
musistudio 3ba195f893 Improve Claude Code router configuration and provider support 2026-08-19 17:19:07 +08:00
Burlesque1 cfb6aae248 fix(ui): truncate over-large JSON bodies in preview to avoid formatter worker crash
Large (>=256KB) JSON request bodies were fully JSON.parse'd and pretty-printed
in the body formatter Web Worker, which then crashed (memory/CPU) on huge object
graphs - surfacing "Body formatter worker failed." and sticking at
"Loading body...". Preview truncation only applied to non-JSON bodies.

Now, in preview mode, an over-length text body is truncated to a plain-text
preview (createLogBodyPreviewText) instead of being parsed/pretty-printed, so the
worker never chokes. Full formatting still runs in "full" mode.

The judge is the real body.text length, not sizeBytes (which may be inflated
metadata and should still render its JSON tree when lightweight).

Fixes #1694
2026-08-19 08:55:14 +00:00
musistudio 4344a2d6a7 Refactor routing configuration and improve provider support 2026-08-18 11:45:39 +08:00
musistudio 0fd9ea8f8b Add provider model refresh control 2026-08-14 16:24:25 +08:00
musistudio 9607c5f0a3 Improve provider account card layouts and meter visibility 2026-08-14 14:19:33 +08:00
musistudio 0104474e95 Merge branch 'main' into dev/3.1
# Conflicts:
#	packages/core/test/integration/observability/request-log-store.test.mjs
2026-08-14 11:17:06 +08:00
jesieleo 16f0868f40 fix(ui): 修复紧凑账户余额卡片裁切 2026-08-13 19:32:03 +08:00
musistudio 2a7aa9286b Update router configuration and provider handling 2026-08-11 16:15:53 +08:00
musistudio 3cb188c064 Report bounded agent analysis and handle missing session details 2026-08-11 15:00:59 +08:00
musi 56d7b37c64 Support multiple WorkBuddy models and generic app paths 2026-08-11 12:36:44 +08:00
musistudio 8fb38278f5 Merge branch 'main' of github.com:musistudio/claude-code-router into dev/3.1 2026-08-11 10:56:16 +08:00
musistudio 28f0a2f2b9 Merge remote-tracking branch 'origin/dev/3.1' into dev/3.1
# Conflicts:
#	packages/core/src/profiles/service.ts
#	packages/ui/src/pages/home/components/profiles.tsx
#	packages/ui/src/pages/home/shared/profiles.ts
2026-08-11 10:05:44 +08:00
musi c8e5e2b53d Add WorkBuddy app integration 2026-08-11 09:25:53 +08:00
musistudio e8db9406a7 Add automatic provider model refresh and dialog Escape handling 2026-08-10 15:40:48 +08:00
musistudio 6e34da7fca Enforce profile model allowlists across agent catalogs 2026-08-10 12:55:54 +08:00
jesieleo f39ab4d5c4 feat(providers): 增加小米 MiMo 及 Token Plan 预设 2026-08-08 19:08:47 +08:00
musistudio 83a7979c0b Implement routing updates 2026-08-07 14:57:45 +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
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
musistudio b4e6185172 Separate enhanced route from profile routing settings 2026-08-05 20:23:08 +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 454daec31c Improve documentation navigation and extension guidance 2026-08-03 08:40:36 +08:00
jesieleo 440241faa0 fix(ui): prevent responsive panels from clipping content 2026-08-02 12:46:10 +08: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 43f99b2de8 Use Token consistently in Chinese UI labels 2026-07-30 18:44:03 +08:00
musistudio 571aa63602 Show request and trace costs in agent observability 2026-07-30 17:32:34 +08:00
musistudio e778687774 Show partial agent session failures in observability UI 2026-07-30 15:25:50 +08:00
musi 8f0b2d91e5 Refactor routing architecture and update project structure 2026-07-29 09:30:04 +08:00
musistudio 6cfd3f226f Expand core functionality and update related components 2026-07-28 17:44:49 +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
jesieleo 8ea1cd6e19 fix(electron): 避免运行状态轮询阻塞界面 2026-07-27 14:09:02 +08:00
musi 7c4a877c99 feat: support Kilo Code profiles 2026-07-26 22:09:24 +08:00
musistudio fa5559435f Merge remote-tracking branch 'origin/dev/3.1' into codex/claude-design-profile
# Conflicts:
#	.test-dist/core/runtime/request-log-worker.js
#	.test-dist/core/test/integration/gateway/gateway-client-disconnect.test.js
#	.test-dist/core/test/integration/gateway/gateway-virtual-models.test.js
#	.test-dist/core/test/integration/mcp/grok-media-service.test.js
#	.test-dist/core/test/integration/mcp/local-ai-gateway-media-live.test.js
#	.test-dist/core/test/integration/observability/request-log-pricing-transaction.test.js
#	.test-dist/core/test/integration/observability/request-log-runtime.test.js
#	.test-dist/core/test/integration/observability/request-log-store.test.js
#	.test-dist/core/test/integration/plugins/plugin-service.test.js
#	.test-dist/core/test/integration/profiles/profile-service.test.js
#	.test-dist/core/test/integration/usage/usage-store.test.js
#	.test-dist/core/test/unit/agents/bot-gateway-env.test.js
#	.test-dist/core/test/unit/agents/claude-app-gateway-models.test.js
#	.test-dist/core/test/unit/agents/claude-app-launch.test.js
#	.test-dist/core/test/unit/agents/claude-environment.test.js
#	.test-dist/core/test/unit/agents/codex-app-model-catalog.test.js
#	.test-dist/core/test/unit/agents/codex-media-preview-bridge.test.js
#	.test-dist/core/test/unit/agents/codex-model-catalog.test.js
#	.test-dist/core/test/unit/agents/local-agent-provider-codex.test.js
#	.test-dist/core/test/unit/agents/local-agent-provider-grok.test.js
#	.test-dist/core/test/unit/agents/local-agent-provider-kimi.test.js
#	.test-dist/core/test/unit/agents/opencode-profile-config.test.js
#	.test-dist/core/test/unit/agents/provider-model-metadata.test.js
#	.test-dist/core/test/unit/config/config-env-interpolation.test.js
#	.test-dist/core/test/unit/config/theme-preference.test.js
#	.test-dist/core/test/unit/gateway/codex-patch-bridge.test.js
#	.test-dist/core/test/unit/gateway/gateway-billing-sync.test.js
#	.test-dist/core/test/unit/gateway/gateway-claude-code-oauth.test.js
#	.test-dist/core/test/unit/gateway/gateway-media-config.test.js
#	.test-dist/core/test/unit/gateway/gateway-runtime-change.test.js
#	.test-dist/core/test/unit/gateway/gateway-status.test.js
#	.test-dist/core/test/unit/gateway/router-builtins.test.js
#	.test-dist/core/test/unit/gateway/routing-architecture.test.js
#	.test-dist/core/test/unit/mcp/toolhub-browser-automation-config.test.js
#	.test-dist/core/test/unit/models/pricing-service.test.js
#	.test-dist/core/test/unit/observability/raw-trace-sync.test.js
#	.test-dist/core/test/unit/profiles/ccr-cli-runtime.test.js
#	.test-dist/core/test/unit/profiles/profile-app-process-detection.test.js
#	.test-dist/core/test/unit/profiles/profile-launch-core.test.js
#	.test-dist/core/test/unit/profiles/windows-ccr-launcher.test.js
#	.test-dist/core/test/unit/providers/credential-pool.test.js
#	.test-dist/core/test/unit/providers/provider-account-service.test.js
#	.test-dist/core/test/unit/providers/provider-model-catalog.test.js
#	.test-dist/core/test/unit/providers/provider-preset-utils.test.js
#	.test-dist/core/test/unit/providers/provider-probe.test.js
#	.test-dist/core/test/unit/proxy/proxy-upstream.test.js
#	.test-dist/core/test/unit/routing/route-script-runtime.test.js
#	.test-dist/core/test/unit/web/web-management-server.test.js
#	.test-dist/ui/test/component/components.test.js
#	.test-dist/ui/test/component/layout.test.js
#	.test-dist/ui/test/component/overview-components.test.js
#	.test-dist/ui/test/component/profiles.test.js
#	.test-dist/ui/test/component/tray-components.test.js
#	.test-dist/ui/test/integration/providers.test.js
#	.test-dist/ui/test/unit/mcp-server-config.test.js
#	.test-dist/ui/test/unit/model-selector-format.test.js
#	.test-dist/ui/test/unit/routing.test.js
#	.test-dist/ui/test/unit/usage-activity.test.js
#	.test-dist/ui/test/unit/usage-format.test.js
#	.test-dist/ui/test/unit/virtual-models.test.js
#	README.md
#	README_zh.md
2026-07-26 18:17:48 +08:00
musistudio 3d576d2730 Update project implementation 2026-07-25 22:40:01 +08:00
musi 01488216fe Merge remote-tracking branch 'origin/dev/3.1' into dev/3.1 2026-07-25 20:01:11 +08:00
musi a0d793680b Update project implementation and configuration 2026-07-25 20:00:57 +08:00
musistudio 28a613c26a Merge branch 'dev/extensions' into codex/claude-design-profile 2026-07-24 23:19:13 +08:00
musistudio 9f704fc911 Guide onboarding through granular provider setup steps 2026-07-24 23:02:28 +08:00