Skip to content

feat: WebSocket Fast (Codex 1.5x) + MCP hub; fix: loopback & crash-safe usage stats#193

Open
drvcode-code wants to merge 2 commits into
leookun:mainfrom
drvcode-code:feat/ws-fast-and-mcp-hub
Open

feat: WebSocket Fast (Codex 1.5x) + MCP hub; fix: loopback & crash-safe usage stats#193
drvcode-code wants to merge 2 commits into
leookun:mainfrom
drvcode-code:feat/ws-fast-and-mcp-hub

Conversation

@drvcode-code

@drvcode-code drvcode-code commented Jul 10, 2026

Copy link
Copy Markdown

两个特性 + 两个修复,已 rebase 到最新 main,go build ./... 通过。

特性

  • WebSocket Fast:为 OpenAI Responses 增加 WS 通道以兑现 Codex fast(1.5x)(仅在 WS + codex 身份下生效);含首帧探活、字段剥离、失败回退 HTTP、长推理静默心跳。
  • MCP 网关(internal/mcphub):把多个 MCP 后端聚合为单一端点,只暴露 list-all-tools / call-tool,突破 Cursor 单会话工具数量上限;多开同类后端靠 serverName 精确区分;含管理界面。新增依赖 mark3labs/mcp-go。

修复

  • 代理层放行本地回环:修复代理误捕获 localhost 导致 Cursor 连不上本地 MCP 服务器。
  • 统计文件抗崩溃:原子写在 rename 前 fsync(修复硬崩溃后 usage.json 变全 NUL);读侧损坏时自愈。

- WebSocket transport for OpenAI Responses to unlock Codex fast (1.5x),
  which only takes effect over WS with codex client identity; strips
  Codex-unsupported fields, first-frame probe, HTTP fallback with cooldown,
  plus a stream keepalive to avoid Cursor reconnecting on long reasoning.
- MCP hub (internal/mcphub): aggregate multiple MCP backends into one
  endpoint exposing list-all-tools + call-tool to bypass Cursor's per-session
  tool cap; multi-instance safe via serverName routing; management UI.
- mitm proxy forwards loopback (127.0.0.1/localhost) directly instead of
  intercepting, so Cursor can reach local MCP servers when the proxy is
  configured as http.proxy.
- atomic file write fsyncs data before rename (fixes usage.json becoming
  all-NUL after a hard crash on NTFS); usage readers self-heal on corruption.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant