Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(mobile): match jsonrpc errors by duck typing to survive Hermes

4 months ago

85e1288
Authored
mweinbach5/25/2026, 4:27:38 PM
Hermes can drop the prototype chain on Error subclasses, so
`error instanceof JsonRpcResponseError` (and even `error instanceof
Error`) would silently miss the "Already initialized" handshake error
and let it bubble out of `resumeThread`/`readThread` as "Failed to load
thread feed". Match by `error.code` or `error.message` instead, and
pin the prototype on `JsonRpcResponseError` so `instanceof` works too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Parenta9faa25

2 files changed
  • apps/mobile/src/features/cowork/jsonRpcClient.ts+20−9
  • test/mobile.jsonrpc-client.test.ts+59−0