Repository navigation
fix(agent): raise @openrouter/sdk floor to ^0.13.59 (typescript-sdk#350) - #135
Draft
LukasParke wants to merge 1 commit into
Draft
LukasParke wants to merge 1 commit into
LukasParke wants to merge 1 commit into
Conversation
…on fix 0.13.59 fixes an unhandled APIPromise rejection when a request is aborted during a non-streamed body read (OpenRouterTeam/typescript-sdk#350). Adds a real-SDK regression test against a stalled local server; it fails on 0.13.7 and passes on 0.13.59. The floor stays at 0.13.59 rather than 0.13.67: 0.13.60 removed '| any' from generated input unions, which surfaces 20 latent type errors in agent src. Runtime is unaffected (unit suite passes on 0.13.67). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
What
Raises
@openrouter/agent's@openrouter/sdkdependency from^0.13.7to^0.13.59and refreshes the lockfile (now 0.13.59).@openrouter/mcpdoesn't depend on the SDK directly, so it's unchanged.0.13.59 contains the APIPromise unhandled-rejection fix for OpenRouterTeam/typescript-sdk#350 (d62c2bde). Before this, aborting a run while the SDK was reading a non-streamed (JSON) body emitted one process-level
unhandledRejectionper call, even though the caller's promise rejected normally. That crashes Node under--unhandled-rejections=strict, which is the default throw mode.Why 0.13.59 and not 0.13.67 (latest 0.13.x)
I tried the newer versions. 0.13.60 removed
| anyfrom many generated input unions (BaseInputsUnion,EasyInputMessage.content/phase, ...), and the agent src has 20 latent type errors that thoseanys were hiding (model-result.ts,conversation-state.ts,turn-context.ts,resume-tool-results.ts). Fixing them is a typing migration that belongs in its own PR. Runtime is fine on 0.13.67 (full unit suite passes), and consumers resolving^0.13.59will keep getting 0.13.67 at runtime, as they already do with^0.13.7. Only the lockfile, and so our own typecheck, stays on 0.13.59.Regression test
tests/unit/sdk-abort-body-read.test.tsruns the real SDK (no mocks) against a local HTTP server that sends JSON headers plus a partial body and then stalls. It fires three parallelcallModel(...).getResponse()calls, waits until all three are mid-body, aborts, and then asserts that all three reject and nounhandledRejectionfires. It fails on 0.13.7 (3 unhandled) and passes on 0.13.59.Test plan
pnpm install --frozen-lockfilepnpm typecheck,pnpm lint,pnpm test(agent 1237, mcp 12),pnpm verify:packagesRefs OpenRouterTeam/typescript-sdk#350, #113
🤖 Generated with Claude Code