Skip to content

fix(choice-cards): draw a five-row card instead of fenced source - #1663

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Nov 20, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

What

A futureos-choice block with five or six options now draws as a card on the phone and the desktop instead of arriving as option: source in a monospace block, clipped at the right edge and readable only by panning. The prompt still asks for 2–4 rows — that is the test of whether a block should be a card — while the client's own ceiling moved to six, because a writer who slipped by a row still wrote a card. agent/src/prompt/choice_card.rs mirrors the same bound, so the "waiting on you" badge cannot promise a card the client refuses to draw. A futureos-choice fence that still cannot be drawn now folds its lines instead of hiding them behind a sideways scroll, and stops printing the fence's own language label.

Commits

  • fix(choice-cards): draw a five-row card instead of fenced source

Verification

Local run in a throwaway worktree at origin/dev-huichen 31c2b9d, Rust toolchain pinned to 1.99.1, ulimit -n 8192:

  • cargo fmt --all -- --check → clean
  • cargo clippy -p future-agent --all-targets -- -D warnings → clean
  • cargo test -p future-agent --lib → 3114 passed, 5 failed; all five are sandbox::tests / sandbox::windows_plan::tests that assert on $HOME and interfere under parallel execution. Re-running cargo test -p future-agent --lib 'sandbox::' -- --test-threads=1 → 225 passed, 0 failed. This branch touches no file under agent/src/sandbox/ (git diff origin/main...origin/dev-huichen -- agent/src/sandbox/ is empty), so the parallel failures are not this change.
  • make check-docs → 425 docs OK; channel matrix 13 rows OK
  • desktop: npx tsc --noEmit clean, npx eslint on the 4 changed files clean, npx vitest run on MarkdownContent.test.tsx + CodeBlock.test.tsx → 27 passed
  • mobile: npm run typecheck clean, npx eslint on the 2 changed files clean, npx jest --runInBand src/components/__tests__/MarkdownText.test.ts → 49 passed
  • @future-os/markdown: npx vitest run --config ../packages/markdown/vitest.config.ts from desktop/ → 34 files, 775 tests passed

User-visible changes

  • Chat choice cards with five or six options now render as a card on desktop and mobile instead of fenced option: source. The prompt still asks for 2–4 rows; blocks with 2–6 rows are drawn, fewer than 2 or more than 6 still fall back to source. Revert 012ab6c.
  • A futureos-choice fence the client cannot draw now wraps its lines instead of scrolling horizontally, and the futureos-choice language label is no longer printed above it. Revert 012ab6c.

Notes

The choice prompt budget moves 51 → 53 because the row-count bound changes what the model writes on every card, the same reason earlier raises were taken.

A live reply (2026-11-20) closed with a five-option `futureos-choice` block
and reached the phone as `option:` source in a monospace block, clipped at the
right edge and readable only by panning: the prompt asks for 2–4 rows, and the
parser's `CHOICE_MAX_OPTIONS` had been the same 4, so the whole card was lost to
a row count only the guidance cared about.

The client and the prompt now answer two different questions. The prompt still
asks for 2–4 — that is the test of *whether* a block should be a card. The
client draws up to six: it decides whether a block that already exists can be
drawn at all, and a writer who slipped by a row still wrote a card.
`agent/src/prompt/choice_card.rs` mirrors the same bound, so the "waiting on
you" badge cannot promise a card the client refuses to draw. History is not
rewritten, but historical replies are re-parsed, so the card that exposed this
draws correctly without anything being migrated.

What the tolerance table still degrades now reads. A `futureos-choice` fence
that cannot be drawn folds its lines instead of hiding them behind a sideways
scroll, and stops printing the fence's own language label — `futureos-choice`
is the parser's notation, not something a reader was ever meant to see. That is
the promise §3 already made ("the reader sees the option list; nothing is
lost") and a 390pt phone could not keep.

Prompt budget 51 → 53: the row-count bound changes what the model writes on
every card, the same reason the earlier raises were taken.
@huichen
huichen enabled auto-merge (squash) November 20, 2026 15:24
@huichen
huichen merged commit 3b53cd9 into main Nov 20, 2026
29 checks passed
@huichen
huichen deleted the pr/huichen branch November 20, 2026 15:51
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.

1 participant