Skip to content

fix: resolve type errors, add null→undefined sanitization, release-gate publishing, add changeset skill docs#3

Merged
robert-j-y merged 3 commits intomainfrom
devin/1775171301-fix-types-null-sanitization-release-gate
Apr 2, 2026
Merged

fix: resolve type errors, add null→undefined sanitization, release-gate publishing, add changeset skill docs#3
robert-j-y merged 3 commits intomainfrom
devin/1775171301-fix-types-null-sanitization-release-gate

Conversation

@robert-j-y
Copy link
Copy Markdown
Collaborator

@robert-j-y robert-j-y commented Apr 2, 2026

Summary

Three independent changes:

  1. src/lib/next-turn-params.tsapplyNextTurnParamsToRequest now strips null values to undefined before spreading into ResponsesRequest. This prevents type errors when Speakeasy-generated SDK types use T | null in fields that ResponsesRequest expects as T | undefined.

  2. .github/workflows/publish.yaml — Replaced auto-publish-on-push-to-main with workflow_dispatch offering two modes: version (creates a Version Packages PR via changesets) and publish (pushes to npm), plus a dry-run toggle. This enables coordinated releases with @openrouter/sdk.

  3. .agents/skills/changeset-versioning/SKILL.md — New skill doc describing the full changeset versioning and release workflow.

Updates since last revision

  • Added src/lib/next-turn-params.test.ts with 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.
  • YAML syntax validated (parses cleanly, if conditions use correct GitHub Actions expression syntax).
  • Current SDK types (@openrouter/sdk) already accept null | undefined for temperature, maxOutputTokens, topP, instructions — so the sanitization is defensive/future-proofing against SDK regenerations.
  • 195/195 unit tests pass. Lint and typecheck clean.

Review & Testing Checklist for Human

  • Confirm NPM_TOKEN secret exists in the repo's GitHub Actions secrets (under the npm-publish environment). The new publish steps reference secrets.NPM_TOKEN via NODE_AUTH_TOKEN. Cannot be verified programmatically.
  • Verify the null→undefined sanitization doesn't introduce unintended behavior. The implementation uses Record<string, unknown> which erases Partial<NextTurnParamsContext> typing at the spread boundary. This is intentional for defensive compatibility, but review the 7 new tests in next-turn-params.test.ts to confirm edge cases are covered. Note: spreading {temperature: undefined} over {temperature: 0.7} results in undefined — this is the intended "clear the value" behavior.
  • Test the workflow_dispatch manually by running Actions → Release → Run workflow with each mode (version/publish) and dry-run combination to confirm the if conditions route correctly.

Notes

  • The original patch included instructions: null additions 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.
  • The old changesets/action combined 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

devin-ai-integration bot and others added 2 commits April 2, 2026 23:09
…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>
@robert-j-y robert-j-y marked this pull request as ready for review April 2, 2026 23:22
…ParamsToRequest

Co-Authored-By: Robert Yeakel <robert.yeakel@openrouter.ai>
@robert-j-y robert-j-y merged commit aae9d60 into main Apr 2, 2026
1 check passed
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