Skip to content

feat(choice): open mode: multi to any card; mark a waiting choice; fix first-paint paging - #1626

Merged
huichen merged 10 commits into
mainfrom
pr/huichen
Nov 16, 2026
Merged

huichen merged 10 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Five commits have landed on dev-huichen since #1625. The choice card can now actually come out mode: multi — the prompt starts there and the parser reads the spellings it used to drop — a conversation waiting on a choice is marked in the same ink as a waiting approval, the host keeps a shelved workspace's rows out of the recent active stretch, and the RPC history helper cuts a first-paint page at an exchange boundary instead of wherever the byte budget ran out.

Commits

  • feat(choice): start a card from multi and keep its rows independent (ea300aa7d)
  • fix(choice): make mode: multi reachable, and read its spellings (2192b78c6)
  • feat(desktop,mobile): mark a waiting choice in the approval badge's ink (4985bf461)
  • fix(host): keep a shelved workspace's rows out of the recent active stretch (bef522b6e)
  • fix(rpc): cut a first-paint page at an exchange boundary (371d34fd3)

Verification

Run locally at the branch tip, pinned rustc 1.99.1, ulimit -n 8192:

  • cargo fmt --all -- --check — clean
  • cargo check -p future-agent -p future-rpc --all-targets — clean; cargo clippy same scope with -D warnings — clean
  • cargo test -p future-agent --lib — 3100 passed, 0 failed, 7 ignored
  • cargo test -p future-rpc --lib — 275 passed, 0 failed
  • cargo test -p future-host --lib — 2265 passed, 0 failed, 15 ignored (run at the tip carrying the same host/src/store/threads.rs blob)
  • desktop: tsc --noEmit clean, eslint on the three changed files clean, vitest ThreadListItem.test.tsx 18 passed
  • mobile: tsc --noEmit clean, eslint on the changed file clean, jest SessionList.test.ts 96 passed
  • packages test project: vitest choiceCard.test.ts 21 passed

Note on future-host: one full-suite run reported agent_bridge::tests::pipeline_tests::the_observer_records_a_reply_that_offered_a_choice failing once; it passes in isolation and the immediately repeated full run is 2265/2265 green. That test lives in host/src/agent_bridge/tests.rs, a file this branch does not touch, and it does not exercise the new threads.rs query. CI remains the judge.

Notes

  • Additive only: no new column, no migration, no settings or default value flipped outside the prompt contract. The packages/rpc edit is a pure history-paging helper with its own unit tests, not a wire-contract change.
  • The choice prompt ships with a rebuild: it is compiled in with include_str!, so an installed build keeps the old wording until it is rebuilt and restarted.

User-visible changes

  • A reply's choice card can now come out mode: multi: the prompt starts from multi and falls back to single only when the rows compete for one slot, and multiple / multi-select / the Chinese spelling are read as multi instead of silently collapsing to single. Before: every card came out single. Revert ea300aa7d + 2192b78c6.
  • A conversation whose last reply is waiting on a choice is marked in the desktop rail and the phone list in the approval badge's ink. Revert 4985bf461.
  • A shelved (archived) workspace no longer contributes rows to the recent active stretch, so the top of the list stops surfacing conversations from a workspace the user put away. Revert bef522b6e.
  • The first page of a conversation is now cut at the oldest whole exchange that still fits the budget rather than mid-run, so the reader no longer lands on a reply with no question above it; a single exchange larger than the budget still falls back to the row-by-row cut. Revert 371d34fd3.

huichen and others added 10 commits November 16, 2026 08:31
Both marks say the same thing to a reader scanning a list: this conversation
cannot move without you. The choice mark was drawn in the accent ink, so beside
the amber approval badge it read as a quiet, informational state — the loudest
thing on the row was the one an agent is blocked on, not the card waiting for a
pick.

Same ink as the approval badge (warning), same 20px slot and 14/16px glyph; the
shape is what still separates them — `circle-alert` is the agent blocked on a
command, `list-checks` is a reply that finished and is waiting for a pick.
Desktop (local and peer rows) and the phone's indicator slot.

Docs: choice-cards §5.9.3 (zh + en).
…tretch

The recent view reads its "Active" stretch whole from `list_active_threads`
while the rest of the list comes from the paged `Recent` scope, and only the
page applied the workspace rule. Shelving a workspace leaves every member's own
status `active` — the container is what leaves — so a member with a run still
going came back through the stretch alone and was drawn under "Active" in a
folder the reader had just archived.

Read the stretch under the same workspace condition as the page, on both of its
routes: the run query, and the by-id append for a session another client reports
as streaming. A conversation's own status stays out of the condition — the rail
hides a shelved conversation from the status on its row, and what no listing can
express is the folder's shelf.

The archive guards are unaffected: `active_members` answers the archive refusal
by reading `runs` directly, and the dialogs treat an unreadable activity read as
idle and let the archive name the running member itself.
Every card this agent has written came out single. Two causes, one on each side.

The prompt: `multi` was described as a conditional add-on ("omit the line, and
`single` is what an omitted line means"), the test asked what the *reader* would do
("if the reader ticked two rows…"), and the only worked example was a single card.
Models answered the hypothetical conservatively and never wrote the line. The test
now sits on the rows (one deliverable in parts, or jobs that do not compete for the
same step), the prompt carries a worked `multi` card, and it names the failure it
kept producing: do not default to `single` to be safe.

The parser: `first("mode").trim().toLowerCase() === "multi"` turned `multiple`,
`multi-select` and `多选` into a silent `single` — the card looked right and only
refused the second tick, which nothing on screen would show. Those spellings now
read as multi; anything else (absent, `single`, `单选`, a typo) stays single.

Measured before the change: the three real cards in this machine's agent database
are 2× `single` and 1× omitted, 0× `multi`.

Also worth knowing for whoever ships this: the prompt is compiled in with
`include_str!`, so an old build keeps the old wording (the installed
`futureos.exe` still carried "the default, so usually omit it" — two rewrites
behind the repository). A prompt change ships with a rebuild and a restart, not
with a merge.
A first paint completes the page back to its question, and when the window
that walk accumulates busts the budget the page is cut. The cut was made row
by row, so it landed wherever the byte count ran out — mid-run — and the
reader landed on a reply with no question above it.

Measured on this machine's Agent store (1,873 conversations, 2026-11-16):
107 of 1,158 conversations with a question opened on a page whose first row
needs a prefix. Cutting at the oldest whole exchange that still fits leaves
5, and none of those begin mid-run that could be avoided.

The row-by-row cut was never wrong about how much to send, only about where
to cut, so it stays as the fallback for a single exchange larger than the
budget. `truncated` keeps its meaning: it is set when the page really does
start mid-run, which is now the exception rather than the common case.
Both marks in a list mean the same thing — this cannot move without you — and a
list-shaped "what next" is usually several separable pieces (a figure, its caption,
a legend, a table column) rather than one slot filled by one of them. The prompt
still treated `single` as the resting state and every card came out single, so the
default is now reversed: start from `mode: multi`, and fall back to the omitted line
(`single`) only when the rows compete for one slot.

That only works if the rows are independent, so the same paragraph states it: no row
may contain another (「调卡片」 next to 「卡片和气泡一起调」 is one job written twice),
no two rows may be the same work, and any subset ticked has to be a coherent request.
On a single card that overlap is noise; on a multi card it is double work.

The multi example now leads the two worked examples — the card the model is being
nudged toward is the one it sees first — and the test pins both the default and the
independence rule, plus the example order.

Docs: choice-cards §3 and §4 (zh + en) record the third revision and why.
@huichen
huichen enabled auto-merge (squash) November 16, 2026 01:41
@huichen
huichen merged commit fa7ac31 into main Nov 16, 2026
33 checks passed
@huichen
huichen deleted the pr/huichen branch November 16, 2026 02:17
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