Skip to content

fix: time out stuck app-server RPCs and cancel before turn start - #434

Open
goodjin wants to merge 1 commit into
agentclientprotocol:mainfrom
goodjin:fix/app-server-rpc-hang
Open

fix: time out stuck app-server RPCs and cancel before turn start#434
goodjin wants to merge 1 commit into
agentclientprotocol:mainfrom
goodjin:fix/app-server-rpc-hang

Conversation

@goodjin

@goodjin goodjin commented Aug 27, 2026

Copy link
Copy Markdown

Summary

  • Writes to Codex app-server stdin now wait for backpressure and surface failures instead of being ignored, so a wedged pipe cannot look like a successful RPC.
  • App-server JSON-RPC calls get a deadline (60s by default, 15s for turn/interrupt, override with CODEX_RPC_TIMEOUT_MS).
  • session/cancel no longer waits for turn/start. It aborts the open prompt immediately; a late-started turn is still interrupted.

This showed up as a prompt that produced no session/update for minutes, with cancel also hanging until the adapter process was killed. Close already released a pending turn start; cancel did not, so both sides waited on each other.

Test plan

  • npm run typecheck
  • npm test (461 passed, 28 skipped)
  • Confirm cancel returns while turn/start is still outstanding
  • Confirm a later turn/start still gets turn/interrupt

Made with Cursor

Swallowing stdin write failures and waiting for turn/start made cancel deadlock when Codex stopped responding. Surface write/backpressure errors, bound JSON-RPC waits, and release pending turn starts on cancel.

Co-authored-by: Cursor <cursoragent@cursor.com>
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