Skip to content

Fix Codex RPC timeout classification - #3025

Merged
steipete merged 3 commits into
mainfrom
fix/3022-rpc-timeout-classification
Aug 17, 2026
Merged

Fix Codex RPC timeout classification#3025
steipete merged 3 commits into
mainfrom
fix/3022-rpc-timeout-classification

Conversation

@steipete

Copy link
Copy Markdown
Owner

Summary

  • incorporate @Chipagosfinest's focused Fix Codex RPC timeout classification #3022 fix so the timeout result wins before Codex app-server teardown can surface an EOF/malformed-response error
  • refresh the exact UsageFetcher.swift provider-architecture gatekeeper anchor after the merged line shift
  • add the credited 0.52.1 changelog entry

Review

No blocking correctness issues found. The timer child now returns a typed timeout result; the parent selects it, cancels the sibling, then requests subprocess termination. The throwing task-group scope still drains the response child during unwinding, and the existing deferred shutdown remains the synchronous teardown backstop.

Supersedes #3022 while preserving @Chipagosfinest's commit and contributor credit.

Verification

  • swiftformat Sources Tests
  • swiftlint --strict
  • make check
  • swift test --filter 'ProviderArchitectureGatekeeper|CodexRPC|UsageFetcher' (758 tests in 54 suites passed)

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Fix Codex RPC timeout classification This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c89d523154

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1015 to +1021
try await withThrowingTaskGroup(of: RPCRequestRaceResult<T>.self) { group in
group.addTask {
try await body()
try await .value(body())
}
group.addTask { [weak self] in
group.addTask {
try await Task.sleep(for: .seconds(seconds))
self?.terminateProcessForTimeout(method: method)
throw RPCWireError.timeout(method: method)
return .timedOut

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add focused coverage for the timeout race

This changes the concurrency ordering that distinguishes RPCWireError.timeout from the prior malformed-EOF result, but the commit only adjusts an architecture-test line number; the existing Codex RPC tests never stall a request and assert the resulting error classification. Add a synthetic app-server test that withholds a reply until the deadline and verifies that RPCWireError.timeout wins, otherwise the specific race fixed here can regress unnoticed.

AGENTS.md reference: AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

@steipete
steipete merged commit d7bd4ef into main Aug 17, 2026
9 checks passed
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