Skip to content

Conversation

@subtleGradient
Copy link
Member

@subtleGradient subtleGradient commented Dec 15, 2025

Description

Removes the @toon-format/toon dependency and related TOON encoding/decoding helper functions that were added in #276.

Motivation: The TOON integration was adding ~100kb and 83 dependencies to the bundle, which is too heavy for an optional feature. Additionally, there was a type issue where the types were always imported in index.d.ts even though the package was marked as optional, forcing downstream consumers to install @toon-format/toon to pass type checking.

BREAKING CHANGE: The following exports are removed:

  • encodeToon
  • decodeToon
  • ToonEncodeOptions
  • ToonDecodeOptions
  • JsonValue

Users who were using these helpers should import directly from @toon-format/toon instead.

Human Review Checklist

  • Confirm this breaking change is acceptable
  • Verify changeset versioning is correct (marked as patch with BREAKING CHANGE note)

Updates since last revision

  • Fixed pre-existing import ordering issue in src/chat/index.ts to make CI pass

Link to Devin run: https://app.devin.ai/sessions/5b9b891e53a74338b6d51d66f1ef20f0
Requested by: Tom Aylott (@subtleGradient)

Checklist

  • I have run pnpm stylecheck and pnpm typecheck
  • I have run pnpm test and all tests pass
  • I have added tests for my changes (if applicable)
  • I have updated documentation (if applicable)

Changeset

  • I have run pnpm changeset to create a changeset file

Note: A changeset is required for your changes to trigger a release. If your PR only contains docs, tests, or CI changes that don't need a release, run pnpm changeset --empty instead.

BREAKING CHANGE: Removes @toon-format/toon dependency and related exports (encodeToon, decodeToon, ToonEncodeOptions, ToonDecodeOptions, JsonValue).

The TOON integration was adding ~100kb and 83 dependencies to the bundle, which was deemed too heavy for an optional feature.

Co-Authored-By: Tom Aylott <[email protected]>
@devin-ai-integration
Copy link
Contributor

Original prompt from Tom
SYSTEM:
=== BEGIN THREAD HISTORY ===
James Sterling (U09LUTAUYSH): Just revisiting a Devin session, and noticed <@U09KAC36W0G> you merged a draft PR <https://github.com/OpenRouterTeam/ai-sdk-provider/pull/276>?

James Sterling (U09LUTAUYSH): didn't even have a chance to review &amp; test

James Sterling (U09LUTAUYSH): did you <@U09KAC36W0G>?

aylott, tom (U09KAC36W0G): yes, did review; didn't see that it was a draft

aylott, tom (U09KAC36W0G): captured this: <https://linear.app/openrouter/issue/PLA-1/unbreak-types-when-not-including-optional-peers|PLA-1: unbreak types when not including optional peers>
will fix the types issue and figure out a test moving forward so we don't regress types when people choose not to include optional deps

aylott, tom (U09KAC36W0G): by default Devin open up real PRs and not draft PRs. I can't tell now that this one was draft.
But now I'll be double careful to skip anything still in draft

James Sterling (U09LUTAUYSH): there was no tagged reviewers, and no approvals

James Sterling (U09LUTAUYSH): we shouldn't merge without approval unless it's the author

aylott, tom (U09KAC36W0G): Gotcha. Typically with OSS the maintainers choose when to merge

aylott, tom (U09KAC36W0G): once the subtree sync stuff is fully stable, most internal contributions will happen within the monorepo so it'll be easier to remember that the workflow is different

James Sterling (U09LUTAUYSH): I mean, wouldn't the PR author be the primary? Are we not the maintainers?

aylott, tom (U09KAC36W0G): My bad. I treated this PR the same as every other PR in this repo. Forgot/didn't notice that this PR was from an employee

James Sterling (U09LUTAUYSH): I bring this up because I didn't even have a chance to review Devin's work, as the requestor I think we need to be reviewing AI's work.

James Sterling (U09LUTAUYSH): I dropped the ball on getting to this, as it was just spitballin' ideas with Devin. So on me for not keeping up as well.

aylott, tom (U09KAC36W0G): we had a ... (1232 chars truncated...)

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@subtleGradient subtleGradient marked this pull request as ready for review December 15, 2025 18:47
Copilot AI review requested due to automatic review settings December 15, 2025 18:47
@subtleGradient subtleGradient merged commit 3c0ba4c into main Dec 15, 2025
3 checks passed
@subtleGradient subtleGradient deleted the devin/1765823760-remove-toon branch December 15, 2025 18:47
@github-actions github-actions bot mentioned this pull request Dec 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the TOON format integration to reduce bundle size and eliminate type dependencies. The integration was adding ~100kb and 83 dependencies for an optional feature, and caused type issues where downstream consumers were forced to install @toon-format/toon even when not using it.

Key Changes:

  • Removed TOON encoding/decoding helper functions and related type exports
  • Removed @toon-format/toon from dependencies and peer dependencies
  • Fixed a pre-existing import ordering issue in src/chat/index.ts

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/toon/toon.test.ts Deleted test file for TOON helper functions
src/toon/index.ts Deleted TOON helper implementation including encodeToon, decodeToon functions and type exports
src/index.ts Removed export statement for toon module
src/chat/index.ts Fixed import ordering (FileAnnotation moved after OpenRouterUsageAccounting)
package.json Removed @toon-format/toon from devDependencies, peerDependencies, and peerDependenciesMeta
.changeset/remove-toon.md Added changeset documenting the breaking change
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,7 @@
---
"@openrouter/ai-sdk-provider": patch
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaking change removes public API exports and should be marked as a major version bump, not a patch. Consider changing 'patch' to 'major' to follow semantic versioning conventions.

Suggested change
"@openrouter/ai-sdk-provider": patch
"@openrouter/ai-sdk-provider": major

Copilot uses AI. Check for mistakes.
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.

3 participants