Commit graph

526 commits

Author SHA1 Message Date
musi
c0da81d6f3
Merge pull request #1505 from LZong-tw/fix/client-abort-stream-cleanup
fix: handle downstream aborts in gateway streams
2026-07-09 19:41:11 +08:00
musi
5a3e1cb71f
Merge pull request #1504 from octo-patch/octo/20260708-add-target-provider-model-to-existing-provider-registry-recvoNaZVlY9Cd
Add MiniMax provider presets
2026-07-09 19:40:36 +08:00
Lim, Un-tiong
768baa8575 fix: handle gateway client aborts during streaming 2026-07-09 18:15:22 +08:00
octo-patch
2cc208d857 Add MiniMax provider presets
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-09 09:33:39 +00:00
musi
990bc0d958
Merge pull request #1499 from emthy0/fix/claude-defautl-model-legacty
fix: Update default sonnet model as old one is no longer existed (404)
2026-07-08 19:27:03 +08:00
musi
fcd386c80c
Merge branch 'main' into fix/claude-defautl-model-legacty 2026-07-08 19:26:40 +08:00
Kuranasaki@M3Max
1aaee2ef60 Update to sonnet 5 due legacy model not support effort and adative thinking 2026-07-08 18:24:27 +07:00
musi
92a16b0d4b
Merge pull request #1498 from emthy0/fix/claude-macos
fix: Claude Code CLI credentials moved to macOS Keychain — local-agent import fails
2026-07-08 19:24:09 +08:00
musi
2020e8f53c
Merge pull request #1497 from emthy0/main
fix: Local-agent OAuth provider plugin auth override never applies
2026-07-08 19:23:09 +08:00
Kuranasaki@M3Max
70f85864a6 Revert "Read claude credential from KeyChain"
This reverts commit d8154e5357.
2026-07-08 17:46:24 +07:00
Kuranasaki@M3Max
8361805bdf Update default sonnet model as old one is no longer existed (404) 2026-07-08 17:38:24 +07:00
Kuranasaki@M3Max
f568968673 Revert model change 2026-07-08 17:29:59 +07:00
Kuranasaki@M3Max
421cbd05b2 Update default claude model to claude-sonnet-4-5-20250929 2026-07-08 17:26:51 +07:00
Kuranasaki@M3Max
a65b8bb6f9 Read claude credential from KeyChain 2026-07-08 17:23:13 +07:00
Kuranasaki@M3Max
d8154e5357 Read claude credential from KeyChain 2026-07-08 17:21:35 +07:00
Kuranasaki@M3Max
cce7292877 Fix broken auto import 2026-07-08 16:55:55 +07:00
musi
499d25d200 chore: prepare cli and docker 3.0.1
Some checks failed
Docs / Build (push) Has been cancelled
Docs / Deploy (push) Has been cancelled
2026-07-07 21:56:20 +08:00
musi
04185dba99 chore: release 3.0.9 2026-07-07 21:42:12 +08:00
musi
d29f2176e8 Merge dev/3.1 for 3.0.9 release 2026-07-07 21:36:59 +08:00
musistudio
bc872a29b3 fix fusion error 2026-07-07 20:34:11 +08:00
musistudio
c8cbc09b96 add new api probe 2026-07-07 20:29:32 +08:00
musistudio
52a6371600 add preset providers 2026-07-07 19:25:25 +08:00
musistudio
027826fd13 Refactor router context handling and update integrations 2026-07-07 18:56:28 +08:00
musi
7216b9dcfa Split configuration docs into main and settings pages 2026-07-07 07:39:02 +08:00
musi
300096e39e build: slim docker runtime image
Some checks are pending
Docs / Build (push) Waiting to run
Docs / Deploy (push) Blocked by required conditions
2026-07-06 22:54:46 +08:00
musi
07fd47ad65 fix: set linux executable name for AppImage 2026-07-06 22:32:57 +08:00
musi
4d7c1990ba Merge dev/3.1 for 3.0.8 release 2026-07-06 22:23:30 +08:00
musi
8cf350e041 chore: prepare 3.0.8 desktop release 2026-07-06 22:22:52 +08:00
musi
7faf59276a update ai-gateway version 2026-07-06 22:19:54 +08:00
musi
a4f5cc9172 Simplify Docker networking and external URL handling 2026-07-06 22:16:30 +08:00
musi
ad0d9db795 Scope ToolHub resolve cache by task 2026-07-06 21:56:55 +08:00
musistudio
1da1723530 Merge remote-tracking branch 'origin/dev/3.1' into dev/3.1 2026-07-06 20:23:45 +08:00
musistudio
d4ff6706f4 Refactor router flow and update provider integrations 2026-07-06 20:23:14 +08:00
musi
fce80a0c3a Merge branch 'main' into dev/3.1 2026-07-06 09:05:45 +08:00
musi
9af987d224 update readme badge 2026-07-06 08:48:09 +08:00
musi
61108ed6e3
Merge pull request #1489 from jesieleo/fix/gateway-crashes
Fix/gateway crashes
2026-07-06 08:41:25 +08:00
musistudio
c409797bc5 fix provider icon 2026-07-06 07:36:15 +08:00
musistudio
964d1dbf23 Add protocol detection details tooltip 2026-07-06 07:25:09 +08:00
musistudio
5f92120114 Bundle bot gateway SDK and simplify CLI delegation 2026-07-05 22:38:09 +08:00
musistudio
528a8e0efa Refactor routing and provider integration 2026-07-05 19:57:39 +08:00
jesieleo
daf745ac3f fix(codex-middleware): stop forcing sandbox_mode=workspace-write to avoid repeated COM+ setup failures
When Codex runs through the ccr middleware, every command execution
fails with three repeated Windows error dialogs:

  codex-windows-sandbox-setup.exe
  COM+ 注册表数据库检测到一个系统错误
  (COM+ registry database system error)

Root cause: the middleware's config/read handler hard-coded
`sandbox_mode: "workspace-write"` in the virtual config returned to
Codex (codex-cli-middleware-runtime.ts configRead). Unlike the
`elevated` mode Codex reads from its own config.toml when run directly
(or via tools that only swap config like cc-switch), `workspace-write`
triggers `codex-windows-sandbox-setup.exe` setup refresh on every
command. On systems where the COM+ catalog is unavailable (COMSysApp
stopped or the catalog itself misbehaves — see openai/codex#29332),
that refresh fails and surfaces as the repeated error dialogs.

Empirically verified across the three legal sandbox_mode values:

  - read-only          : does not trigger setup, but cannot write files
  - workspace-write    : triggers setup refresh every command -> fails
                         on affected systems (this bug)
  - danger-full-access : does not trigger setup, can write files, but
                         has no isolation

Forcing workspace-write therefore both overrides the user's own
config.toml preference AND guarantees the failure on affected systems.

Fix: omit sandbox_mode from the virtual config entirely, letting Codex
read it from its own config.toml ([windows] sandbox / sandbox_mode) —
matching the behavior of config-only tools like cc-switch. The user
keeps full control: those who want isolation set workspace-write (and
must ensure their COM+ works); those on affected systems set
danger-full-access.

This is a one-line removal plus an explanatory comment; configValues
was already empty ({}), so Codex now falls back to its config file
exactly as it does without any middleware.

Refs: openai/codex#29332
2026-07-04 18:52:04 +08:00
jesieleo
ee44357a34 fix(gateway): prevent three crashes from non-ASCII names, client disconnect, and immutable headers
Three independent crashes in src/server/gateway/service.ts, each surfacing
as either a 502 or an Electron Uncaught Exception dialog.

== 1. Non-ASCII provider/model names -> 502 ByteString error ==

When a provider name or model selector contains non-ASCII characters
(CJK, emoji, accented Latin — e.g. "小米mimo/mimo-v2.5-pro-ultraspeed"),
every routed request fails with:

  Unexpected status 502 Bad Gateway: Cannot convert argument to a
  ByteString because the character at index 0 has a value of 23567
  which is greater than 255.

Several observability headers derived their values from raw,
unsanitized user-facing strings (x-ccr-logical-provider, x-ccr-routed-
model, x-ccr-route-reason, the model-discovery/app-rewrite/codex-patch
diagnostics, x-ccr-fallback-model). Node/undici enforces the HTTP
ByteString contract (code point <= 255), so any non-ASCII char throws a
TypeError that bubbles to the catch-all as 502.

Fix: add sanitizeHeaderValue() that replaces characters outside the
printable ASCII range with "-", and wrap all ten affected assignments.
The core gateway (@the-next-ai/ai-gateway) does not read any x-ccr-*
header (verified), so values stay observability-only.

== 2. Client disconnect mid-stream -> Uncaught Exception ==

When a client closes the SSE connection mid-stream — normal during
local tool execution (file creation) — the gateway emitted an Uncaught
Exception that crashed the Electron main process:

  Uncaught Exception:
  Error: Client connection closed before response completed.

Two gaps let the error escape:
  - responseBody.once("error", ...) consumes only the FIRST error, but
    a disconnect triggers several in quick succession (abort, destroy,
    EPIPE). Remaining errors re-throw as unhandled.
  - The destination ServerResponse had NO "error" listener, so write
    failures on a closed socket bubbled up directly.

Fix: once("error") -> on("error") on the response body so every error
is logged via writeStreamLog; add response.on("error") that marks the
disconnect and aborts upstream. Only the spurious crash is removed —
disconnects are still recorded and upstream still aborted.

== 3. Codex apply_patch -> 502 "immutable" ==

Creating a file via Codex (apply_patch) fails with:

  Unexpected status 502 Bad Gateway: immutable

Undici's fetch Response.headers can be immutable; mergeFallbackResponse
Headers returns it as-is when no fallback occurred, and the codex patch
bridge then calls responseHeaders.delete("content-length"), which
throws TypeError: immutable.

Fix: wrap the merged headers in new Headers(...) to guarantee a mutable
copy regardless of upstream immutability or merge early-return.

== Verification ==

- sanitizeHeaderValue: "小米mimo/mimo-v2.5-pro-ultraspeed" ->
  "mimo/mimo-v2.5-pro-ultraspeed" (ASCII-safe); real repro confirmed.
- Disconnect crash: previously fired on every file-creating tool call;
  after fix, no crash, model continues normally.
- immutable 502: previously fired on every apply_patch; after fix,
  files are created successfully.
- ASCII-only configs unaffected (sanitization is a no-op; error
  handlers only affect the failure path).
2026-07-04 18:52:03 +08:00
musi
87a666df21 chore: release 3.0.7
Some checks failed
Docs / Build (push) Has been cancelled
Docs / Deploy (push) Has been cancelled
2026-07-03 23:04:05 +08:00
musistudio
d41dae4e4a feat: update ai-gateway version 2026-07-03 22:58:16 +08:00
musistudio
3983322519 feat: update ai-gateway version 2026-07-03 22:57:08 +08:00
musistudio
2929903bdc Merge branch 'main' into dev/3.1 2026-07-03 22:56:26 +08:00
musistudio
7130e1e632 Add TeamoRouter provider preset and docs 2026-07-03 22:53:10 +08:00
musistudio
6bfb2e1901 Merge remote-tracking branch 'origin/dev/3.1' into dev/3.1 2026-07-03 21:30:52 +08:00
musi
46fa7e2181 Remove stale generated bin backups 2026-07-03 21:29:10 +08:00
musistudio
2410530450 Fix Claude app launch on macOS 2026-07-03 15:35:07 +08:00