Repository navigation
fix(agent-core-v2): close idle MCP OAuth callback connections - #4431
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🦋 Changeset detectedLatest commit: 0e43a79 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
MoonshotAI#4410 MoonshotAI#4413 MoonshotAI#4431 MoonshotAI#4450 MoonshotAI#4451 MoonshotAI#4485 MoonshotAI#4524 were each implemented earlier — the compaction prefix suite, the media-recovery case, the OAuth callback socket drain, the split delivering-work section, the compaction wording, the reasoning-key order and the 10-step todo reminder are all in the tree and pinned by their own tests. Each row now carries that probe. Only MoonshotAI#4410 needed care: upstream patched paths that this fork renamed (`human/llm/builtin/protocol` versus `human/llm/requester/bases`), so the matching was done on the behaviour — stripDynamicToolContext is gone and extractEventUsage already reads usage only on terminal response events. Ledger: closed 22 -> 28, remaining 71.
…le browser preconnect Widen the callback-handler read timeout from the CLI MCP waiter to the two sibling single-threaded loopback listeners with the same shape: the shared provider-login listener (Codex browser login, OpenRouter, PKCE plugins) and the Desktop/dashboard connector receiver. An idle speculative socket accepted ahead of the redirect parked each serve loop until the browser dropped it. Port from MoonshotAI/kimi-code#4431 (close idle MCP OAuth callback connections).
Requirement or Bug
MCP 浏览器授权已完成后,客户端仍可能等待本地回调监听器关闭,迟迟不能结束授权流程。
Bug Reproduction Steps
/callback?code=example&state=example发起请求。Root Cause
授权完成流程会等待回调监听器关闭。
server.close()不会主动销毁尚未形成 HTTP 请求的预连接;关闭开始时仍在发送响应的 keep-alive 连接也可能延迟退出。本次在一次性监听器自身修复连接清理,保留授权结果 HTML 的正常发送。Code Changes
Behavior Changes and Affected Users
404 路径、OAuth state 校验、凭证持久化和公开接口保持不变。已形成请求的其他活动连接仍使用原有 drain 行为,本次不增加强制终止机制。
验证:
git diff --check通过。Checklist
/approve). 无关联 issue,复现步骤见上。gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.