Skip to content

Conversation

@cruzanstx
Copy link

Summary

  • Detect DOMException/AbortError from Node.js spawn (which appears as {} when logged due to non-enumerable properties)
  • Only show "Process exited unexpectedly" for genuine failures, not transient abort/retry situations
  • Better error logging with getLaunchErrorInfo() that extracts error.name, error.message, error.code for debugging

Problem

When users send messages from the mobile app after the session is in "ready" state, occasionally the spawn throws a DOMException (from Node.js AbortSignal) that appears as {} when logged. The session actually recovers on retry, but users see a confusing "Process exited unexpectedly" error message.

Changes

  • Added LaunchErrorInfo type and getLaunchErrorInfo() helper to properly extract error details from any error type
  • Added isAbortError() helper to detect both SDK AbortError class and Node.js native DOMException/AbortError
  • Modified catch block to skip "Process exited unexpectedly" message for abort-related errors during retry cycles

Test plan

  • Build passes (yarn build)
  • Tests pass (yarn test)
  • Manual testing with mobile app during abort/retry scenarios

🤖 Generated with Claude Code + Codex

Co-Authored-By: Codex noreply@openai.com

- Detect DOMException/AbortError from Node.js spawn\n- Only show "Process exited unexpectedly" for genuine failures\n- Better error logging for debugging
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.

1 participant