core-agent-ide/codex-rs/app-server/src
Owen Lin 8d97b5c246
fix(app-server): surface more helpful errors for json-rpc (#11638)
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:

```json
{
  "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`
2026-02-13 00:14:55 +00:00
..
bespoke_event_handling.rs fix(app-server): surface more helpful errors for json-rpc (#11638) 2026-02-13 00:14:55 +00:00
codex_message_processor.rs app-server: stabilize detached review start on Windows (#11646) 2026-02-12 16:12:44 -08:00
config_api.rs feat(core): add network constraints schema to requirements.toml (#10958) 2026-02-07 19:48:24 +00:00
dynamic_tools.rs fix(app-server): surface more helpful errors for json-rpc (#11638) 2026-02-13 00:14:55 +00:00
error_code.rs Reapply "Add app-server transport layer with websocket support" (#11370) 2026-02-11 18:13:39 +00:00
filters.rs [app-server] feat: add filtering on thread list (#9897) 2026-01-26 21:54:19 +00:00
fuzzy_file_search.rs app-server: add fuzzy search sessions for streaming file search (#10268) 2026-02-12 10:49:44 -08:00
lib.rs app-server: thread resume subscriptions (#11474) 2026-02-11 16:21:13 -08:00
main.rs Reapply "Add app-server transport layer with websocket support" (#11370) 2026-02-11 18:13:39 +00:00
message_processor.rs fix(app-server): surface more helpful errors for json-rpc (#11638) 2026-02-13 00:14:55 +00:00
models.rs Feat: add upgrade to app server modelList (#10556) 2026-02-03 14:53:36 -08:00
outgoing_message.rs fix(app-server): surface more helpful errors for json-rpc (#11638) 2026-02-13 00:14:55 +00:00
thread_state.rs app-server: thread resume subscriptions (#11474) 2026-02-11 16:21:13 -08:00
transport.rs app-server: thread resume subscriptions (#11474) 2026-02-11 16:21:13 -08:00