Public: anyone can read this; the crew can change it.

A tell is limited to 4,000 characters at the boundary, refused with a message naming the limit #14153

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A tell now has one limit, 4,000 characters, counted as characters rather than bytes. Every door refuses longer text naming it. I ran tsc, design-lint, gate.ts --fix and the tell and MCP test files, including mcp-size.test.ts.

Notes

shipped production is serving it deploy 4adf612

opened this

A tell now has one limit, 4,000 characters, counted as characters rather than bytes. Every door refuses longer text naming it. I ran tsc, design-lint, gate.ts --fix and the tell and MCP test files, including mcp-size.test.ts. I did not run the full suite, because fast.ts flagged the diff as too broad to name tests.

What changed

  • Existing limit: a 2,000-character limit already sat in TELL_TEXT_MAX (src/actions/tell_from.ts), with other numbers in other places (8,000 on the MCP schema, 65,536 on the web box). I made TELL_TEXT_MAX 4,000 and pointed the CLI, share target, feed route, MCP tool and web boxes at it. This raises the old 2,000 limit, which is what the issue asks for.
  • POST /api/v1/feed/tells: answers 422 {error: "invalid_text", message: "A tell is one thought: at most 4,000 characters.", hint}. apiError takes an optional hint, and other routes are unchanged.
  • MCP tell tool: the schema maxLength is 4,000, and the tool refuses longer text with the same sentence and hint. The MCP error shape has no hint field, so the hint is appended to the message there. mcp-size.test.ts passes.
  • Web tell routes: the plain tell and the toolbar tell refuse over-limit text (the toolbar one is a new check) and show the same words on the page. TOO_LONG_WORDS is now that sentence for every door.
  • Tell boxes: the studio box, feed card, toolbar box, thread tell box and the in-app toolbar script all use maxlength 4,000. The studio box and the toolbar box also show the limit in one line.
  • Tests: the new test/tell-limit.test.ts proves 4,000 passes and 4,001 is refused, with multi-byte text counted by characters, on the MCP tool. I did not add 4,000/4,001 tests for the HTTP route or the web box. The stale 2,000 assertions in test/tell-refused.test.ts, test/tell-stdin.test.ts, test/share-target-tell.test.ts, test/tell-from-parse.test.ts and test/mcp-tell.test.ts were wrong, so I updated them.
  • Docs: docs/mcp/tools/tell.md has the new refusal sentence.

Left out

  • tell() ceiling: tell() itself still enforces the 65,536 ceiling, because the toolbar and MCP append a page-context note after the user's words. The 4,000 check sits at each door, on the user's words only.
  • Run steer box: the steer box on a run page has no maxlength yet.

Try it: open an app's tell box and paste 4,001 characters. It is refused naming 4,000. Or curl -X POST /api/v1/feed/tells with a 4,001-character text for the 422 JSON.

🤖 Generated with Claude Code

Closes #14139

6 earlier comments · 1 event
commented

A tell now has one limit, 4,000 characters, counted as characters rather than bytes. Every door refuses longer text naming it. I ran tsc, design-lint, gate.ts --fix and the tell and MCP test files, including mcp-size.test.ts. I did not run the full suite, because fast.ts flagged the diff as too broad to name tests.

What changed

  • Existing limit: a 2,000-character limit already sat in TELL_TEXT_MAX (src/actions/tell_from.ts), with other numbers in other places (8,000 on the MCP schema, 65,536 on the web box). I made TELL_TEXT_MAX 4,000 and pointed the CLI, share target, feed route, MCP tool and web boxes at it. This raises the old 2,000 limit, which is what the issue asks for.
  • POST /api/v1/feed/tells: answers 422 {error: "invalid_text", message: "A tell is one thought: at most 4,000 characters.", hint}. apiError takes an optional hint, and other routes are unchanged.
  • MCP tell tool: the schema maxLength is 4,000, and the tool refuses longer text with the same sentence and hint. The MCP error shape has no hint field, so the hint is appended to the message there. mcp-size.test.ts passes.
  • Web tell routes: the plain tell and the toolbar tell refuse over-limit text (the toolbar one is a new check) and show the same words on the page. TOO_LONG_WORDS is now that sentence for every door.
  • Tell boxes: the studio box, feed card, toolbar box, thread tell box and the in-app toolbar script all use maxlength 4,000. The studio box and the toolbar box also show the limit in one line.
  • Tests: the new test/tell-limit.test.ts proves 4,000 passes and 4,001 is refused, with multi-byte text counted by characters, on the MCP tool. I did not add 4,000/4,001 tests for the HTTP route or the web box. The stale 2,000 assertions in test/tell-refused.test.ts, test/tell-stdin.test.ts, test/share-target-tell.test.ts, test/tell-from-parse.test.ts and test/mcp-tell.test.ts were wrong, so I updated them.
  • Docs: docs/mcp/tools/tell.md has the new refusal sentence.

Left out

  • tell() ceiling: tell() itself still enforces the 65,536 ceiling, because the toolbar and MCP append a page-context note after the user's words. The 4,000 check sits at each door, on the user's words only.
  • Run steer box: the steer box on a run page has no maxlength yet.

Try it: open an app's tell box and paste 4,001 characters. It is refused naming 4,000. Or curl -X POST /api/v1/feed/tells with a 4,001-character text for the 422 JSON.

🤖 Generated with Claude Code

commented

<!-- look-pages 75a9a8af6ece --> Look pages for 75a9a8a, from the gate:

  • look pages (inferred): this pull changes src/web/pages/thread.ts, src/web/share_target.ts, src/web/studio/actions.ts and 3 more; the forge pictures / (src/web/pages/thread.ts), /docs (src/web/pages/thread.ts), /explore (src/web/pages/thread.ts) and 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

A tell is now limited to 4,000 characters at every door, and a refusal names the limit. This push fixes the failed check; the gate is clean locally and bun x tsc --noEmit is clean.

  • Test cast: test/tell-limit.test.ts built the MCP context with as never, which the gate rejects. It now builds a real Ctx.
  • "both doors" rule: the commit message carries a No door: line, because src/web/pages/thread.ts only changes the textarea maxlength to the shared 4,000 limit and the terminal already refuses at that limit. It also carries a No look: line, since a maxlength attribute changes no pixels.

test/tell-limit.test.ts passes. I did not run the other tests that cover the change.

To try it, paste more than 4,000 characters into the tell box, or call the MCP tell tool with 4,001 characters. It refuses with a message naming 4,000, and exactly 4,000 goes through.

commented

This note is the gate's look-pages inference for the earlier commit 75a9a8a. It asks for no code change, and there is nothing new to push.

My latest commit, 855fb0019, already carries the override the note describes. It has a No look: line, because the only visible change in src/web/pages/thread.ts is the textarea maxlength attribute (2,000 → 4,000), which changes no pixels. So I'm not asking the forge to picture the 27+ inferred pages.

What changed

  • A tell is limited to 4,000 characters, counted as characters, not bytes. The limit is the shared TELL_TEXT_MAX / overTellLimit in src/actions/tell_from.ts.
  • The same limit applies at the web composer, the share target, the studio toolbar, studio actions, studio feed, studio app, the MCP tell tool and the shared HTTP responder.
  • A refusal names the limit: "4,000".
  • The composer's maxlength now reads from TELL_TEXT_MAX instead of the hard-coded 2,000.
  • test/tell-limit.test.ts covers the character count (4,000 two-byte characters fit) and the MCP tool refusing 4,001 and accepting 4,000. The test builds a real Ctx rather than casting.

What I left out

  • I added no terminal change for the composer edit. The terminal already refuses at the same limit, and the commit says so in a No door: line.

How to try it

  • Paste more than 4,000 characters into the tell box, or call the MCP tell tool with 4,001 characters. It refuses naming 4,000, and exactly 4,000 goes through.

Checks

  • bun x tsc --noEmit and bun scripts/gate.ts are clean locally.
  • I ran test/tell-limit.test.ts, which passes.
  • I did not run the other tests that cover the change; the forge's check runs them on the push.
commented

I've pushed the fix, but I only know 5 of the 6 failed tests are fixed. The sixth, the guides are read once however many requests come, passes for me, so I can't say whether it still fails in the forge's check. The seventh, the crew-concurrency test that timed out after 30 seconds, I did not touch.

The failures were stale tests and wording that still assumed the old 2,000-character limit, or tripped a vocabulary rule:

  • Tests updated to 4,000: test/share-target.test.ts (an enormous share is cut at 4,000), test/feed-card-markup.test.ts (maxlength="4000") and test/mcp-tell.test.ts.
  • Too-long share test: test/share-tell-tui.test.ts used 3,000 characters to mean "too long". It now uses 5,000.
  • Hint sentence reworded: the studio vocabulary test (test/studio-words.test.ts) rejects the phrase "a tell" in studio pages, and my hint "A tell is one thought: at most 4,000 characters." matched it. The hint now reads "One thought, at most 4,000 characters." I updated docs/mcp/tools/tell.md to match, and docs/features/share-tell.md now says 4,000.
  • Local run: the changed and affected test files pass (44 tests), including test/llms-full.test.ts, the guides test's file. bun x tsc --noEmit is clean.
  • Guides test: it reads a mock call count that earlier tests in its file set up. It would fail if the sharded check ran it apart from those tests, so I think it is order-dependent and not caused by this pull, but I did not confirm that.
  • Concurrency test: the crew's concurrency test (shard 43) is unrelated to tells and I left it alone.
  • Gate rules: the commit carries No look: and No door: lines.
Changes requested — before the latest push

The limit is shared and the MCP tool is tested at 4,000/4,001, but two issue boxes are not met. Fix first: add tests for the HTTP tell route (4,000 passes, 4,001 gives 422 {error,message,hint} naming 4,000), and the web tell box. Then show the one-line limit on every tell box, not just two.

commented

A tell is now refused at 4,001 characters at every door, with a message naming 4,000. The last push adds the missing tests and puts the one-line limit on every tell box. The type check is clean. The 14 test files I ran pass, and 2 tests inside them skip because the sandbox has no Chromium. scripts/fast.ts found the diff too broad to name tests, so I picked the files that touch tells, tell boxes, the toolbar and the feed myself. The forge's check runs the full suite on this push.

  • Route tests: the new test/tell-limit-doors.test.ts covers the HTTP tell route. 4,000 is accepted and files an issue. 4,001 gives 422 with error: invalid_text, a message and a hint naming 4,000, and files nothing.
  • Web tell action: the same file tests the web action at /:owner/:name/tell, including the toolbar path (a page field). It checks that 4,001 files nothing and names 4,000, and that 4,000 files an issue.
  • Limit line: the muted one-line limit (TELL_LIMIT_WORDS) now shows on the thread composer, the feed card tell box, the feed composer, the home tell box and the refused or share tell form. A page-level test checks that every tell box carries it.
  • Toolbar: the toolbar's box now takes its cut from TELL_TEXT_MAX instead of a literal 4000, and a test pins the two together.
  • Comments: the TELL_LIMIT_WORDS comment now says what it is, and the stale TOO_LONG_WORDS comment now names TELL_TEXT_MAX.

Two points where I did not do exactly what the review said:

  • Steer box: it is not a tell, and its server door (runSteer) has no 4,000 check. Giving it a 4,000 cut was my mistake in the earlier commit. I put its maxlength back to its original 2,000, and test/feed-card-markup.test.ts expects 2,000 again. Steer keeps its own limit, and the 4,000 line shows only on tell boxes.
  • Toolbar 4000: the literal in src/apps/toolbar.ts that the review flagged (the line-312 hit in my search) is a DOM node-count cap in the screenshot code, not the tell limit. I left it alone. The real tell maxLength was line 188, which is the one now tied to TELL_TEXT_MAX.

bun scripts/gate.ts --fix rewrapped comments in one file, and that is committed. It also notes that src/http/feed.ts has a comment line over 100 columns, which I left for the nightly rewrap.

commented

I merged main into the branch and pushed it. The only conflict was in the tell box in src/web/pages/thread.ts.

Conflict resolution: I kept the comment form as main now builds it. The tell textarea keeps this branch's change: maxlength is TELL_TEXT_MAX (4,000) rather than main's old 2000, and the box still shows TELL_LIMIT_WORDS.

Checks:

  • bun x tsc --noEmit is clean.
  • 65 tests pass across 10 tell, thread and toolbar test files.
  • scripts/fast.ts reported the diff as too broad to name tests, so I picked those 10 files myself. I did not run the full suite; the forge's check does that on this push.
  • scripts/gate.ts --fix changed nothing. It noted two over-long comment lines in src/http/feed.ts and src/web/studio/living.ts, which this change didn't touch.
Approved

The clone does not hold the earlier head, so I read the change as listed. The 4,000 limit is one constant (TELL_TEXT_MAX) with one sentence and one hint. It is enforced at the feed route, the MCP tool, both web tell actions and the share target, and counted in characters. Every tell box carries the maxlength plus a muted one-line limit; the run steer box is correctly left at its own limit. The new tests cover 4,000 and 4,001 on the route, the MCP tool and the web actions. Docs went to docs/features and docs/mcp, not README. No new dependency. Non-blocking: src/http/feed.ts and src/web/studio/living.ts have comment lines over the gate width.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs