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

Report a card's height to the host, so a card is not clipped #11811

opened this

Check · Review · Land · Live — It conflicts with its base. Next: builder, it conflicts with its base.

Conflicts with main

A card is drawn inside a host's frame. The MCP Apps spec (SEP-1865, stable 2026-01-26) has the view send ui/notifications/size-changed with { width?, height? } so the host can size the frame.

Notes · 3 files · +43 −2

look it conflicts with main in src/http/mcp.ts — bring the branch up to date and it can land deploy 545d481

Conflicts in 1 filedeploy 545d481

Website spec: 19 findings (report only)
opened this

What

A card is drawn inside a host's frame. The MCP Apps spec (SEP-1865, stable 2026-01-26) has the view send ui/notifications/size-changed with { width?, height? } so the host can size the frame. The card page never sent it, so the host kept the frame's first height and clipped the rows (the "Search: packs" card stopped after one hit).

Change

  • src/web/studio/card_size.ts (new): CARD_SHELL_SIZED(kind) is the existing CARD_SHELL(kind) with a script after its draw script. The script reports document.documentElement.scrollHeight on load, after each redraw (the tool-result message), and whenever the document resizes (ResizeObserver).
  • src/http/mcp.ts: resources/read serves CARD_SHELL_SIZED. Nothing else changes.
  • test/card-size-report.test.ts (new): every card kind's page reports its height, and keeps its draw script before the report.

cards.ts is unchanged, so the draw logic and its XSS tests stay as they were.

Caveat

An open claude.ai issue (anthropics/claude-ai-mcp#69) says claude.ai ignores size-changed and reads the iframe's document height directly. If so, this change is spec-correct but may not fix claude.ai. It should fix hosts that follow the spec.

Try: ask the forge for search results on a phone; every hit should show, not stop at the frame's edge.

Co-Authored-By: Claude Haiku 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JUDZN9nmtfgzoXWLjmQNhU

🤖 Generated with Claude Code

https://claude.ai/code/session_01JUDZN9nmtfgzoXWLjmQNhU

Changes requested

Not security-sensitive (no new input, no injection surface, no new dependency), but two things must change.

  1. Fix first: the report can only grow. It sends documentElement.scrollHeight, which is never less than the viewport. Once the host sizes the frame to the reported height, a shorter card (after a redraw) still reports the frame height and never shrinks. Measure the content (document.body.getBoundingClientRect().height plus margins, or a wrapper's offsetHeight), not the root scroll height.
  2. The change is bolted on beside CARD_SHELL: a new module and a new CARD_SHELL_SIZED export, with the report concatenated after the page's closing script. Any other caller of CARD_SHELL silently stays unreported. Put the report in SHELL_JS in cards.ts (the shell's one script) and keep CARD_SHELL as the single entry; delete card_size.ts. 'Runs after the draw script' then follows from order inside that script.
  3. Tests only check substrings of the string. Add one that goes through MCP resources/read (src/http/mcp.ts) and asserts the served text carries the report, so the mcp.ts wiring would fail without it.

Also: postMessage target '*' is inherited from the shell, so it is acceptable here; no change needed.

19 earlier comments
commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Taken over by @trevato; stopped @sentinel.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

The sentinel keeps picking this up and the run fails in 0s, now 10+ times with no pull, and #16413 started doing the same at 11 AM (two 0s agent failures after its check failed at 24m). Please find why a sentinel run on these fails before it starts, fix that one cause, and stop re-picking an issue whose last run failed in 0s until the cause is fixed. Post the cause here.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Pressing again on the 0s agent failures. Since 3 PM CT today three more agent runs failed in 0s, now on open pulls: #16427, #16482 and #16472 (plus #11811 itself again at ~1 PM). A run that fails before it starts should say why on the run page. Please find the cause (provider limit, a bad agent config, a missing branch?), make the run record its reason, and stop re-queuing a run that will fail the same way.

commented

Cause of the 0s agent failures (checked in the run logs of #11811, #16198 and #16427, which read the same): the run is refused before launch, not a launch, auth or subscription fault. Each log says "failed: pull #N's branch lives in the repository itself and only its author, a person, can push it; the crew leaves it with them", then "hops: 0, off-host: 0" and "run ended 0.0s after the run started". The sentinel keeps picking up open pulls whose head branch is a person's branch in this repository (here fix/card-size-report), the builder refuses to push to it, and the pull is picked again. The crew itself still works: agent run #16509 at about 1 PM CT completed in 28.6s (claude: completed, 6 turns, $0.15, reviewed: approved). #11811 also conflicts with main in src/http/mcp.ts and only its author can bring the branch up to date. I have not checked #16192, #16472 or #16482, and I have not looked at the "not measured yet" week or the open-pull ceiling. The fix, filed as an issue in trevato/forge: do not re-pick a pull whose last run failed this way, and show the reason as the pull's waiting state ("waits for its author") so it does not count against the open-pull ceiling.

commented

Correction to the comment above: the fix issue is not filed yet. It is held for the owner's approval, so nothing in the sentinel has changed. The cause stands as written.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Parked by the crew: the last three runs here failed or were declined within an hour, so nothing more starts until a person says what to try.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs