fix: resolve type errors, add null→undefined sanitization, release-gate publishing, add changeset skill docs#3
Merged
robert-j-y merged 3 commits intomainfrom Apr 2, 2026
Conversation
…ate publishing, add changeset skill docs - Fix type errors in anthropic-compat.test.ts and chat-compat.test.ts by adding missing 'instructions: null' field to mock response factories (required by @openrouter/sdk 0.11.2) - Apply null->undefined sanitization in applyNextTurnParamsToRequest to match SDK defensive fix (prevents type failures when Speakeasy regenerates types with different nullability) - Change publish.yaml from auto-publish on push to main to workflow_dispatch with version/publish modes, dry-run toggle, and informative descriptions - Add .agents/skills/changeset-versioning/SKILL.md documenting the full changeset versioning and release workflow
Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>
yogasanas
approved these changes
Apr 2, 2026
…ParamsToRequest Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>
2 tasks
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
Three independent changes:
src/lib/next-turn-params.ts—applyNextTurnParamsToRequestnow stripsnullvalues toundefinedbefore spreading intoResponsesRequest. This prevents type errors when Speakeasy-generated SDK types useT | nullin fields thatResponsesRequestexpects asT | undefined..github/workflows/publish.yaml— Replaced auto-publish-on-push-to-main withworkflow_dispatchoffering two modes:version(creates a Version Packages PR via changesets) andpublish(pushes to npm), plus a dry-run toggle. This enables coordinated releases with@openrouter/sdk..agents/skills/changeset-versioning/SKILL.md— New skill doc describing the full changeset versioning and release workflow.Updates since last revision
src/lib/next-turn-params.test.tswith 7 unit tests covering the null→undefined sanitization: passthrough of non-null values, null-to-undefined conversion, preservation of unrelated request fields, empty params, mixed null/non-null, zero-as-valid, and empty-string-as-valid.ifconditions use correct GitHub Actions expression syntax).@openrouter/sdk) already acceptnull | undefinedfortemperature,maxOutputTokens,topP,instructions— so the sanitization is defensive/future-proofing against SDK regenerations.Review & Testing Checklist for Human
NPM_TOKENsecret exists in the repo's GitHub Actions secrets (under thenpm-publishenvironment). The new publish steps referencesecrets.NPM_TOKENviaNODE_AUTH_TOKEN. Cannot be verified programmatically.Record<string, unknown>which erasesPartial<NextTurnParamsContext>typing at the spread boundary. This is intentional for defensive compatibility, but review the 7 new tests innext-turn-params.test.tsto confirm edge cases are covered. Note: spreading{temperature: undefined}over{temperature: 0.7}results inundefined— this is the intended "clear the value" behavior.version/publish) and dry-run combination to confirm theifconditions route correctly.Notes
instructions: nulladditions to test mock factories, but these were already present in the source files (causing duplicate property errors). The final diff correctly omits those test changes.changesets/actioncombined version + publish in one step; the new workflow separates them into explicit modes for coordinated release control.Link to Devin session: https://app.devin.ai/sessions/7690662a430848d9be47c3b020fdb50f
Requested by: @robert-j-y