Skip to content

fix: answers from the question card reach Claude Code, and stay in the card when they can't - #169

Merged
sean-brydon merged 4 commits into
cosscom:mainfrom
Stener1:answers-reach-claude-form
Oct 19, 2026
Merged

sean-brydon merged 4 commits into
cosscom:mainfrom
Stener1:answers-reach-claude-form

Conversation

@Stener1

@Stener1 Stener1 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Answers submitted from the chat's question card often never reached Claude Code: the box stopped before the first key and Claude's own form stayed on question 1. The card then folded away, and everything typed into it was lost.

Why: an agent nobody has open sits at tmux's 80x24. A form whose questions contain lists is taller than that, so its tabs and question scroll off the top of the pane. tmux's scrollback can't stand in for them: what scrolls off is an older frame, not the current one. The box read "Claude's screen doesn't show its questions" and stopped.

 driveAnswers
+  fit()                    # pane < 200 rows: resize-window -y 200, put back size + own window-size after
   readForm
+    question behind a "│" gutter (Claude Code 2.1.3, multi-line questions)
+    rows are "❯ N." / "  N." only: a question's own "1." lines stay question
+    a row's wrapped lines kept (more): own words read whole, exactly
   typeOther
-    row's first line is a prefix of what was sent
+    the whole row equals what was sent
   last question
-    form gone OR review → ok (a review out of sight counted as done, unsubmitted)
+    several questions → must show the review; one → form must close
+  on failure: log why, and the form it stopped at (not the conversation above)
 <QuestionCard>
-  stuck → <InTerminal>             # form unmounted, answers gone
+  stuck → <Form stuck>             # every answer kept
+            <Alert> why · Retry · Copy answers
   + the agent's own screen still opens under it

verify-berthd gains a real-box path: scripts/dev-box.sh starts a box and laptop agent of this checkout beside the Shipyard already running, drive.mjs --agent drives the app against it, and chat-questions-live answers a real Claude Code (feature map: features/chat-questions.md).

Evidence

Before, on a real Claude Code 2.1.303 at 80x24, three questions with lists in them, long words on two of them: Claude's screen doesn't show its questions: finish in Claude's screen, with no key sent. With the pane at 120x50 it still fails the same way, because of the │ gutter.
After, the same questions on the same pane: all three are delivered in 0.7 s, ´ and a backtick included, and the pane is back at 80x24.

The real app on a dev box of this branch, driving a real Claude Code at 80x24 (chat-questions-live):

Card, long own words Review Claude has them and goes on

Claude's own record has the tool result with every answer word for word. The box log shows answer ask: answered 3 questions.

A forced failure (text already typed in Claude's own-words row when the box gets there):

Kept, with why, Retry, Copy Claude's screen opens under it Retry delivers

Copy answers put Rollout: …\nOwner: Sam\nNotes: … on the clipboard. The box log has answer: Claude's form when it stopped: followed by the form, and then the reason.

Tests:

  • go vet ./... && go test -race ./...: green.
  • New tests on captured 2.1.303 screens (testdata/answer), plus a fake form that wraps and is shorter than its form. The new cases fail on main:
    • TestDriveLongWordsOnAShortPane: doesn't show its questions.
    • TestReadFormRealScreens: the gutter question isn't recognised.
    • TestDriveStopsOnSurprise/review out of sight: main returned nil without submitting.
  • TestFitPutsThePaneBack runs on real tmux and checks the size and the window's own window-size are restored.
  • App: pnpm test 556/556 (with answersText), plus the checks and build. chat.spec.ts 14/14, including the new 409 path: the form and its answers stay, Copy answers works, and Retry delivers. tsc -p e2e and the docs build pass.
  • Not run: cargo check (no Rust on the box I used; no Rust changed).

Review notes:

  • Codex suggested two changes I didn't make:
    • Raw screen in the box log: the log keeps the form only (from its tabs down), or the last 8 lines when there is no form, so the next failure can be diagnosed. It holds the person's own words, which the agent's record on the same box already has.
    • Token in ?token=: the browser build takes its token only from there (lib/api.ts, as e2e/live.mjs does). It belongs to a throwaway loopback agent, and the driver redacts it from everything it writes.

Merge Danger

Door: two-way

Box and app code only; nothing persisted changes shape. A revert restores the old behaviour.

Blast Radius: answering

Only POST /v1/sessions/{name}/answer (terminal-driven Claude Code) and the question card change. While an answer runs, the agent's window is 200 rows tall. Someone with that terminal open sees it cropped for a second or two, and then it is put back.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VT2hKzCE1WfLU9uk6jhKd6

Stener1 and others added 4 commits October 19, 2026 16:39
…ane, with long words

An agent nobody has open sits at tmux's 80x24. A form of questions with
lists in them is taller than that: its tabs and question scroll off, and
what scrolls off is an old frame, so the answer stopped before the first
key. The pane is made tall enough while it is answered, then put back
with its own window-size setting.

The form is also read as Claude Code 2.1.3 draws it: a question of
several lines behind a bar, a question's own numbered lines kept apart
from the options, and long own words read whole across their wrapped
lines. A multiple question form must reach its review, never counted
done without it. Every answer that doesn't go is logged with why and
the form it stopped at.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VT2hKzCE1WfLU9uk6jhKd6
…etry and Copy answers

When the box can't fill in the agent's form, the card no longer folds
into the terminal: it keeps every answer, says why, offers Retry and
Copy answers (one line each under its question's name), and the agent's
own screen opens under it to finish there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VT2hKzCE1WfLU9uk6jhKd6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VT2hKzCE1WfLU9uk6jhKd6
dev-box.sh starts a box and laptop agent of this checkout beside the
Shipyard already running, drive.mjs --agent drives the app against it,
and chat-questions-live answers a real Claude Code's questions, and
forces a failure to prove Retry and Copy answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VT2hKzCE1WfLU9uk6jhKd6
@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

@Stener1 is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sean-brydon
sean-brydon merged commit 12f6ec7 into cosscom:main Oct 19, 2026
0 of 2 checks passed
@Stener1
Stener1 deleted the answers-reach-claude-form branch October 19, 2026 20:28
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.

2 participants