Skip to content

build(deps): upgrade to TOON v4 - #130

Merged
lcottercertinia merged 4 commits into
certinia:mainfrom
lukecotter:121-toon-v4
Aug 13, 2026
Merged

build(deps): upgrade to TOON v4#130
lcottercertinia merged 4 commits into
certinia:mainfrom
lukecotter:121-toon-v4

Conversation

@lukecotter

Copy link
Copy Markdown
Collaborator

Upgrades @toon-format/toon from 2.3.1 to 4.1.1. There is no v3.

v4 removes key folding and path expansion. Every encode() call in this repo
passes no options, so neither was in use: no response changed, and no golden
moved.

Measured, and rejected

The other v4 encode forms were each measured against all five tables:

form result
keyed tabular costs a character per row
tab or pipe delimiter saves 2 tokens on a 9,365-token response
nested field groups nothing left to fold
indentSize: 1 saves 2.4%, but decode rejects it

None pays, so the default form stays. The reasoning is recorded in
DEVELOPING.md so the next reader does not repeat the measurement.

Verification

pnpm run build, pnpm run lint, pnpm test (256 tests) and pnpm run eval
all pass. Response token counts and the ~1,093-token definition budget are
unmoved, and no golden was re-recorded.

Only pnpm run eval can see this change — jest.config.js maps
@toon-format/toon to a JSON stand-in.

Supersedes #105.

Stacked on #128. Until that merges, the diff here also shows its commits.

Closes #121

Replace @modelcontextprotocol/sdk with @modelcontextprotocol/server and
@modelcontextprotocol/client, and serve stdio through the serveStdio
factory. The factory runs once per connection, after the opening exchange
chooses the protocol era, so the process-level signal handlers and the
error callback move out of the ApexLogServer constructor into a new
exported runStdioServer.

legacy: "serve" is the SDK default and is stated explicitly, because
dropping the 2025-era clients would be a second breaking change.

The SDK no longer emits execution.taskSupport on a tool definition, so
every definition costs 9 tokens less. No response changed.

Closes certinia#103
ApexLogServer was a constructor plus one private registerTools, and the
SDK v2 factory made its server field public just to reach it through a
throwaway instance. createApexLogServer returns the McpServer directly.

classificationCache moves to module scope. The factory builds one server
per connection, so as an instance field the cache no longer had the
process lifetime it is documented to have.

runStdioServer returns void: no caller read the handle.

Refs certinia#103
v4 removes key folding and path expansion. Every encode() call here
passes no options, so no response changed and no golden moved.

The other v4 encode forms were measured and none pay: keyed tabular
costs a character per row, a tab or pipe delimiter saves 2 tokens on a
9,365-token response, nested field groups have nothing left to fold, and
indentSize 1 saves 2.4% but decode rejects it. Recorded in DEVELOPING.md.

Closes certinia#121
@lcottercertinia
lcottercertinia merged commit f2d2c24 into certinia:main Aug 13, 2026
14 checks 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.

chore: upgrade to TOON v4 and measure the new tabular forms

2 participants