Skip to content

fix(sdk): suppress unhandledRejection in PendingRequestMap.create() - #161

Merged
ross-rl merged 1 commit into
mainfrom
yoon/pending-request-map-unhandled-rejection
Aug 13, 2026
Merged

fix(sdk): suppress unhandledRejection in PendingRequestMap.create()#161
ross-rl merged 1 commit into
mainfrom
yoon/pending-request-map-unhandled-rejection

Conversation

@yoon-park-rl

Copy link
Copy Markdown
Contributor

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

  • PR title follows <type>(<scope>): <description> format (see above)
  • bun run check passes (lint + format)
  • bun run build passes
  • bun run test passes
  • SDK documentation updated (if applicable)

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
yoon-park-rl marked this pull request as draft August 10, 2026 16:34
@yoon-park-rl
yoon-park-rl marked this pull request as ready for review August 10, 2026 17:35
@yoon-park-rl
yoon-park-rl marked this pull request as draft August 10, 2026 17:38
@yoon-park-rl
yoon-park-rl requested a review from ross-rl August 10, 2026 17:38
@yoon-park-rl
yoon-park-rl marked this pull request as ready for review August 10, 2026 17:39
@ross-rl
ross-rl merged commit e4ca6f1 into main Aug 13, 2026
5 checks passed
@ross-rl
ross-rl deleted the yoon/pending-request-map-unhandled-rejection branch August 13, 2026 18:34
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).
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.

2 participants