Skip to content

fix(app-server): surface more helpful errors for json-rpc#11638

Merged
owenlin0 merged 1 commit intomainfrom
owen/more_helpful_errors
Feb 13, 2026
Merged

fix(app-server): surface more helpful errors for json-rpc#11638
owenlin0 merged 1 commit intomainfrom
owen/more_helpful_errors

Conversation

@owenlin0
Copy link
Collaborator

@owenlin0 owenlin0 commented Feb 12, 2026

Propagate client JSON-RPC errors for app-server request callbacks. Previously a number of possible errors were collapsed to channel closed. Now we should be able to see the underlying client error.

Summary

This change stops masking client JSON-RPC error responses as generic callback cancellation in app-server server->client request flows.

Previously, when the client responded with a JSON-RPC error, we removed the callback entry but did not send anything to the waiting oneshot receiver. Waiters then observed channel closure (for example, auth refresh request canceled: channel closed), which hid the actual client error.

Now, client JSON-RPC errors are forwarded through the callback channel and handled explicitly by request consumers.

User-visible behavior

  • External auth refresh now surfaces real client JSON-RPC errors when provided.
  • True transport/callback-drop cases still report canceled/channel-closed semantics.

Example: client JSON-RPC error is now propagated (not masked as "canceled")

When app-server asks the client to refresh ChatGPT auth tokens, it sends a server->client JSON-RPC request like:

{
  "id": 42,
  "method": "account/chatgptAuthTokens/refresh",
  "params": {
    "reason": "unauthorized",
    "previousAccountId": "org-abc"
  }
}

If the client cannot refresh and responds with a JSON-RPC error:

{
  "id": 42,
  "error": {
    "code": -32000,
    "message": "refresh failed",
    "data": null
  }
}

app-server now forwards that error through the callback path and surfaces:
auth refresh request failed: code=-32000 message=refresh failed

Previously, this same case could be reported as:
auth refresh request canceled: channel closed

@owenlin0 owenlin0 marked this pull request as ready for review February 12, 2026 21:20
@owenlin0 owenlin0 force-pushed the owen/more_helpful_errors branch from c63d63c to 88bd8a9 Compare February 12, 2026 21:29
@owenlin0 owenlin0 requested a review from bolinfest February 12, 2026 21:30
Copy link
Collaborator

@celia-oai celia-oai left a comment

Choose a reason for hiding this comment

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

what makes some request have a fallback response when there's client error, and some don't have this?

@owenlin0
Copy link
Collaborator Author

@celia-oai For some codepaths we can default to some reasonable behavior for a client error (like a dynamic tool call being sent as "tool failed" back to the model), whereas other codepaths there isn't a reasonable default (the external auth refresh case).

@owenlin0 owenlin0 enabled auto-merge (squash) February 12, 2026 21:44
@owenlin0 owenlin0 force-pushed the owen/more_helpful_errors branch from 88bd8a9 to c0ee01f Compare February 12, 2026 21:59
@owenlin0 owenlin0 force-pushed the owen/more_helpful_errors branch from c0ee01f to b7f00cc Compare February 12, 2026 23:14
@owenlin0 owenlin0 merged commit 8d97b5c into main Feb 13, 2026
57 of 61 checks passed
@owenlin0 owenlin0 deleted the owen/more_helpful_errors branch February 13, 2026 00:14
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants