fix(sdk): suppress unhandledRejection in PendingRequestMap.create() - #161
Merged
Merged
Conversation
Callers (sendControlRequest, request) store the promise then suspend on await transport.write() before returning it. If the read loop rejects the promise during that window, Node fires unhandledRejection and terminates the process because no handler is attached yet. Adding a noop .catch() marks the promise as handled without swallowing the error — we return p, not p.catch()'s result, so the rejection still propagates to the caller normally. Fixes ClaudeAxonConnection and CodexAxonConnection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
yoon-park-rl
marked this pull request as draft
August 10, 2026 16:34
yoon-park-rl
marked this pull request as ready for review
August 10, 2026 17:35
yoon-park-rl
marked this pull request as draft
August 10, 2026 17:38
yoon-park-rl
marked this pull request as ready for review
August 10, 2026 17:39
ross-rl
approved these changes
Aug 13, 2026
ross-rl
pushed a commit
that referenced
this pull request
Aug 13, 2026
🤖 I have created a release *beep* *boop* --- ## [0.4.8](remote-agents-sdk-v0.4.7...remote-agents-sdk-v0.4.8) (2026-08-13) ### Bug Fixes * **sdk:** handle Codex MCP elicitation requests ([#162](#162)) ([3d908ad](3d908ad)) * **sdk:** suppress unhandledRejection in PendingRequestMap.create() ([#161](#161)) ([e4ca6f1](e4ca6f1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Callers (sendControlRequest, request) store the promise then suspend on await transport.write() before returning it. If the read loop rejects the promise during that window, Node fires unhandledRejection and terminates the process because no handler is attached yet.
Adding a noop .catch() marks the promise as handled without swallowing the error — we return p, not p.catch()'s result, so the rejection still propagates to the caller normally.
Fixes ClaudeAxonConnection and CodexAxonConnection.
What
Why
PR title format
Checklist
<type>(<scope>): <description>format (see above)bun run checkpasses (lint + format)bun run buildpassesbun run testpasses