Skip to content

Bug fix: recover browser MCP calls after transport failures (macOS)#13100

Closed
swordfish444 wants to merge 2 commits intoopenai:mainfrom
swordfish444:codex/mcp-transport-recovery
Closed

Bug fix: recover browser MCP calls after transport failures (macOS)#13100
swordfish444 wants to merge 2 commits intoopenai:mainfrom
swordfish444:codex/mcp-transport-recovery

Conversation

@swordfish444
Copy link
Contributor

@swordfish444 swordfish444 commented Feb 28, 2026

Bug Fix Summary

This PR fixes a reliability bug in Codex browser MCP handling on macOS.

Linked bug: #13138

Bug Description

When browser MCP transports die mid-session, follow-up tool calls can fail with transport-level errors (Transport send error, Broken pipe, Transport closed), and browser MCP workflows become unreliable until restart.

Affected MCP servers:

  • chrome-devtools
  • playwright

Fix

  • Keep one-shot restart + retry behavior in McpConnectionManager
  • Expand transport-failure matching to include:
    • transport closed
    • transport send error
    • transport receive error
    • transport errors containing broken pipe / connection reset
  • Add targeted unit coverage for matcher behavior

Validation

Automated

  • just fmt
  • just fix -p codex-core
  • cargo test -p codex-core is_transport_closed_error
  • cargo test -p codex-core mcp_tool_call_recovers_from_transport_closed

End-to-end (macOS, patched app-server)

Server:

  • ./target/debug/codex app-server --listen ws://127.0.0.1:4322

Chrome DevTools MCP:

  1. first turn tool call succeeds (mcp__chrome-devtools__new_page)
  2. force-close child MCP process (kill -9 10162)
  3. second turn in same thread succeeds without app restart
  4. server log confirms recovery path:
    • MCP transport closed for server chrome-devtools; restarting

Playwright MCP:

  1. first turn tool call succeeds (mcp__playwright__browser_tabs)
  2. force-close child MCP process (kill -9 10154 11782)
  3. second turn in same thread succeeds without app restart
  4. server log confirms recovery path:
    • MCP transport closed for server playwright; restarting

Related prior report: #6649

@swordfish444
Copy link
Contributor Author

swordfish444 commented Feb 28, 2026

Tagging additional maintainers for this bug fix: @etraut-openai @mzeng-openai. This PR is a reliability bug fix (linked to #13138) with macOS E2E validation for browser MCP transport drops (Chrome DevTools + Playwright), including forced process-kill recovery in-session without restarting Codex.

@etraut-openai
Copy link
Collaborator

@swordfish444 Please do not submit PRs. If you want to suggest a new feature, file a feature request.

@swordfish444
Copy link
Contributor Author

Tracking bug report (per maintainer guidance): #13138

@swordfish444
Copy link
Contributor Author

swordfish444 commented Feb 28, 2026

@etraut-openai Thanks for the guidance. I opened #13138 as requested. To clarify, this is not a feature request; it is a reliability bug affecting existing behavior in Codex on macOS where browser MCPs (chrome-devtools and playwright) can fail with transport errors (including broken pipe / transport closed) and become unusable without restart.

Given the user impact and the fix + E2E validation already captured in this PR, I’d appreciate it if you could reopen #13100 for review.

@swordfish444 swordfish444 changed the title Recover browser MCP calls after broken-pipe transport failures Bug fix: recover browser MCP calls after transport failures (macOS) Feb 28, 2026
@swordfish444
Copy link
Contributor Author

swordfish444 commented Feb 28, 2026

Issue mapping (to avoid duplicate confusion):

This PR should be evaluated as a reliability bug fix for existing behavior, not a feature request.

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.

2 participants