Skip to content

test(sequentialthinking): characterize the absence of a per-item size cap - #5612

Open
cliffhall wants to merge 1 commit into
v2/mainfrom
v2/chore/5543-sequentialthinking-item-size-tests
Open

cliffhall wants to merge 1 commit into
v2/mainfrom
v2/chore/5543-sequentialthinking-item-size-tests

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #5543

Description

Adds src/sequentialthinking/__tests__/item-size.test.ts: characterization tests pinning that the server has no per-item size cap today. Tests only; no source file changes.

The server's documented caps are on other dimensions: MAX_THOUGHT_HISTORY bounds how many thoughts are retained, and MAX_BOX_TEXT_WIDTH / MAX_BOX_ROWS bound what one thought draws on stderr. The size of a single thought or branchId is unbounded: both are a bare z.string() in the input schema, and the history keeps each whole.

The three cases from the issue, driven through the in-process MCP client:

  1. A 1,000,000-character thought is accepted and counts once in the history.
  2. A 5,000-line thought is accepted and counts once.
  3. A 10,000-character branchId is accepted and listed verbatim in branches, by the call that records it and by a later, unbranched call.

Two differences from the issue's proposal:

  • A file of its own rather than more cases in thinking.test.ts, so the characterization is easy to find and to delete or rewrite if a cap is ever introduced.
  • Each case runs with thought logging off and on. The issue's version ran only with logging off (the test helper's default), but logging is on by default for a real client, and drawing the box is the one step between validation and retention that reads the whole item. So "accepted" is pinned in the default configuration too.

The tests take no position on whether a cap should exist.

Server Details

  • Server: sequentialthinking
  • Changes to: tests only

Motivation and Context

See #5543. If a per-item cap is added later, these tests fail, so the change is deliberate and visible rather than a silent side effect.

How Has This Been Tested?

No client-observable surface changes, so the evidence is a targeted probe.

  • Current behavior confirmed: on v2/main @ 7f383a8e the new file passes, 6 of 6 (3 cases × logging off/on).
  • The tests detect a cap: with a planted z.string().max(100000) on thought and z.string().max(256) on branchId in index.ts, 4 of 6 fail (the million-character thought and the long branchId, in both logging modes). The 5,000-line thought is 25,000 characters, so it is the case that would catch a line-count cap rather than a character cap. The plant was reverted; the diff holds the test file only.
  • npm run local:gate exits 0.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

None of the four: test-only.

Checklist

  • I have read the MCP Protocol Documentation (not applicable: no protocol feature is touched)
  • My changes follow MCP security best practices (not applicable: tests only)
  • I have updated the server's README accordingly (not applicable: no tool, option or behavior changes)
  • I have added a changeset (npm run changeset) if this changes what a TypeScript server publishes (not applicable: nothing published changes)
  • I have tested this with an LLM client (not applicable: not a server-facing change; see the probe above)
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling (not applicable: tests only)
  • I have documented all environment variables and configuration options (not applicable: none added)

🤖 Generated with Claude Code

… cap

The documented caps bound how many thoughts are retained and what one
thought draws on stderr. Nothing bounds the size of a single thought or
branchId. Pin that through the in-process client, with thought logging
off and on: a 1,000,000-character thought and a 5,000-line thought are
each accepted and counted once, and a 10,000-character branchId is
listed verbatim, also by a later response.

Tests only; no behavior change, so no changeset.

Closes #5543

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall cliffhall added the v2 label Nov 18, 2026
@cliffhall cliffhall linked an issue Nov 18, 2026 that may be closed by this pull request
2 tasks done
@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5b5531f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cliffhall
cliffhall requested a balanced review from Copilot November 18, 2026 18:01
@github-actions

Copy link
Copy Markdown
Contributor

sequentialthinking: MCP interface diff

Base: 7f383a8e0f34 (Merge pull request #5597 from modelcontextprotocol/changeset-release/v2/main)
Head: the build in this checkout, at 5b88201ac677 (Merge 5b5531f into 7f383a8)

Diffed because it was named (--server).

✅ No interface changes detected.

Tools Prompts Resources Resource templates
Base 1 0 0 0
Head 1 0 0 0

Updated by this run for 5b5531fb9ea3400623028bccf50b46134b4a356c.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for this test-only change covering large thoughts and branch IDs.

No open issues 🎉

What changed in this PR

Adds test-only coverage for #5543, characterizing the sequentialthinking server’s current lack of per-item size limits so future caps require deliberate test updates. No production code changes.

Changes:

  • Checks that million-character and 5,000-line thoughts are accepted and each counts once in history.
  • Verifies that a 10,000-character branch ID appears verbatim in both immediate and later responses.
  • Runs all three cases with thought logging disabled and enabled, suppressing stderr output.
File Description
src/​sequentialthinking/​__tests__/​item-size.test.ts Adds six in-process MCP characterization cases covering large inputs across both logging modes.

Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot round 1: clean. The review recorded no findings and no suppressed comments, so the loop ends here on the first clean round. Nothing was pushed after the review. Not merged: merging is the maintainer's call.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sequentialthinking: characterization tests for per-item size (no cap today)

2 participants