Repository navigation
chore(agent): upgrade @openrouter/sdk to 1.5.85 - #158
Merged
Merged
Conversation
The SDK moved from 0.13.7 to 1.5.85. BaseInputsUnion no longer includes any, so single input items are typed as InputsUnion1 and response output crosses into request input through a typeguard instead of casts. The code-interpreter image type was renamed to CodeInterpreterImageOutput; OutputImage and OutputInputImage stay as aliases.
christineschen
approved these changes
Nov 11, 2026
Import outputToInputItems through conversation-state's existing re-export instead of adding a direct edge to turn-context.
Merged
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.
Summary
Upgrades
@openrouter/sdkin@openrouter/agentfrom^0.13.7to^1.5.85(latest on npm). This is a major-version jump, so it needs a few code changes beyond the version bump.Changes
BaseInputsUnionused to includeany, and the agent used it to mean "a single input item". It is now strict and only describesinstructions. Those uses are retyped to the SDK'sInputsUnion1, which is also re-exported from the package index.turn-context.tsgains anisInputItemtypeguard and anoutputToInputItemshelper, which replace fiveascasts inmodel-result.tsandresume-tool-results.ts.OutputImageis nowCodeInterpreterImageOutputin the SDK. The new name is exported, andOutputImage/OutputInputImageremain as aliases.SignalTimeoutHookon everySDKHooksinstance. Four tests inopenrouter.test.tsthat asserted exactly one hook now assert the user's hook is present.Reviewer notes
appendToMessagesandnormalizeInputToArraymoved from anany-typed item to a strict one, so some consumers could see new type errors.outputToInputItemskeeps any object with a stringtypeorrole, so the items sent on the next turn are the same as before the upgrade.Testing
pnpm lint,pnpm typecheck,pnpm build,pnpm verify:packagespasspnpm test: agent 109 files, mcp 5 files passpnpm test:e2eagainst the live API: 18 files pass, 1 skipped