[codex] Correlate protocol request failures#3433
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved Adds optional diagnostic context (method, requestId, operation) to protocol error objects for better error correlation. Backwards-compatible schema additions with comprehensive test coverage and no behavioral changes. You can customize Macroscope's approvability policy. Learn more. |
Summary
Validation
Note
Medium Risk
Touches core JSON-RPC error mapping and pending-request lifecycle in two protocol packages; behavior is mostly additive diagnostics but changes error shapes and ACP extension error handling semantics.
Overview
ACP and Codex App Server now attach method, request ID, and operation (
receive-response, encoding failures, etc.) when outbound encoding fails or when a client request gets an error response, so failures can be tied to the call that caused them.Pending outbound requests keep method alongside the deferred (not just ID), and protocol layers use that when mapping JSON-RPC errors into
AcpRequestError/CodexAppServerRequestError. ACP also adds focused factories for extension response failures, response encoding errors, and unsupported streaming chunks, keeps full exit cause on protocol errors where relevant, and tightens extension-handler error handling toAcpProtocolParseErrorinstead of a blanket catch. Encode/decode failure logging can include requestId where available.Reviewed by Cursor Bugbot for commit 878b3a6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Correlate protocol request failures with originating RPC method and request ID
methodandrequestIdmetadata toAcpRequestErrorandCodexAppServerRequestErrorso that protocol-level failures can be traced back to the originating request.AcpPendingRequestandCodexAppServerPendingRequestinterfaces that storemethodalongside the deferred, enabling correlation when responses arrive.fromProtocolError,fromExtensionResponseFailure,fromExtensionResponseEncodingError,unsupportedStreamingResponse) produce structured errors tagged with specificoperationvalues (receive-response,encode-extension-response,receive-streaming-response).offerOutgoingandencodeWireMessagenow propagatemethodandrequestIdintoAcpProtocolParseError/CodexAppServerProtocolParseError.tapErroron send failure rather than swallowing the error path.Macroscope summarized 878b3a6.