Repository navigation
feat(choice): put choice cards behind an off-by-default switch; fix remote transcripts - #1639
Merged
Merged
Conversation
The multi card's row mark was the same circle as a single card's radio: the only thing telling the two apart was the 11px mode label in the corner. Shape now carries the mode — a 3px-rounded square on desktop (card and edit popover), a 4px-rounded box with a check on the phone — while the single card keeps its ring. Co-Authored-By: FutureOS <[email protected]>
`th_choice` only ever asked a single-choice question, so nothing in the screenshot harness could show the multi card's square mark — the state this shape rule exists for. `?choiceMode=multi` swaps the fence's mode line and nothing else, and `choice-card-multi` asserts the boxes by computed border-radius (3px) rather than by class name, so the capture fails if the mark ever goes back to a circle. Co-Authored-By: FutureOS <[email protected]>
A history page cannot say a reply is still being written: the projector folds an exchange into a complete (or ailed) turn, so the page's copy of a running reply arrived looking settled and MessageBlock did what it does with a settled reply — folded the work behind 'show process', offered copy and fork over words that were still arriving, and dropped the generating dot. The host's own answer is the only statement about 'now' in the picture, so the timeline now exposes the run get_state.activeRun names and the transcript wears it on the row (markInFlightReply). The same identity fixes the other half: a run whose terminal frame was lost on at-most-once NATS left streaming set for ever, with the composer still offering Stop. A settled record, an idle state read older than the run's last frame, or a low-frequency recheck while streaming now ends it.
A reply's `futureos-choice` card becomes the reader's choice, not the product's default: - Settings -> General gains a "Choice cards" switch, persisted as `choice_cards` in `app.db` (packages/app-settings) and defaulting to off. - Off means *no trace*: the desktop and phone renderers drop the card node and the fence itself, the malformed-fence fallback included, so the block never resurfaces as a code block. The conversation list's "waiting on your choice" mark follows the same switch. - Off also means the fence is not taught: the host pushes `set_choice_cards` before every run (best-effort — an agent that predates the command still accepts the prompt), the session keeps it, and `PromptOptions.choice_cards` decides whether `choice.md` enters the system prompt. `grep futureos-choice` finds nothing in a prompt built with the switch off. - The card format, its fields and its single/multi semantics are untouched, and stored history is never rewritten: an existing card renders per the current switch. - The phone mirrors the desktop instead of holding its own value (`get_desktop_settings.choiceCards` / `SettingsPatch.choice_cards`). - The phone's card test mock only stubbed `ListChecks`, so `ChoiceCard.test.ts` was already red on `origin/dev-huichen` once the multi-choice rows began drawing their `Check` mark; the mock now lists both icons (test-only, no product change). - `set_choice_cards` is registered in the shared command policy; without that the agent answers `unknown command`. Tested: desktop `ChoiceCardsToggle.test.tsx` (off: zero card nodes and no `futureos-choice` in the text; on: rows, pick, answer), mobile `ChoiceCardsToggle.test.ts`, `prompt_omits_the_choice_card_fence_when_cards_are_off`, `choice_cards_switch_adds_and_removes_the_prompt_section`, `choice_card_switch_is_pushed_from_the_store`, `settings_patch_accepts_the_choice_card_toggle`, and the default-off assertions in `future-app-settings`. Falsified by forcing the renderer to always draw, always pushing the prompt section, and shipping the default as on: each turns exactly those assertions red.
Every way the remote lane can stop drawing a reply was silent: a fragment dropped at its terminal frame, a content lane that failed and took the frames still in it, a run log the host refused or a read that errored, and a record that settled a run the host still had in flight. From outside all four read the same — 'my answer stops halfway' / 'this conversation looks finished and it isn't' — so a report arrives without the fact that decides where the defect is. warnRemoteLane says which one happened, once per conversation, reason and run, with the error passed through. It follows the shape this app already uses for its own runs (warnLivePreviewFallback): a bracketed prefix, no UI, and the conversation named so a line out of a window with several remote conversations open is still addressable.
The General page gained the off-by-default `Choice cards` switch in 7a8ffc3, and the Settings wiki page is what enumerates that page's rows. Adds the row in both languages, matching the switch's own copy: while off the card is not drawn and the agent is not told the format exists.
…draw its cards The switch shipped only in this app's own Settings, which left a headless host stuck: its value decides whether *its* agent is taught the `futureos-choice` fence, and a machine with no window of its own had no surface to turn it on. So: - Remote -> that computer -> Automation gains a "Choice cards" switch, written to the host's own `app.db` through `update_desktop_settings` (`SettingsPatch.choice_cards`, already accepted by the host). - A remote transcript now draws cards on **that machine's** value, not on this one's: `useRemoteChoiceCards` reads `get_desktop_settings.choiceCards` through the cached per-host catalogue (the same read the skill row uses, so it costs one command per connection and follows `app_settings_changed`). The value is passed into `RemoteConversationView` from the shell, and its own switch is the fallback only for a caller that has not read it. - A host that does *not* answer the question (a build older than the switch, which teaches the fence unconditionally) counts as **on** for drawing: hiding its cards would delete the closing question it legitimately asks, source included. Only an explicit `false` — the shipped default — hides. A refused read falls back to this machine's own switch, because an unreachable host is not a host that said no. - The phone's mirrored value follows the same rule: only `false` from that desktop hides anything, so an older desktop's cards keep drawing. Tested: `useRemoteChoiceCards.test.tsx` (host off wins over local on; host on wins over local off; an older host's silence is on; a refused read falls back to local; no machine, no opinion), `RemoteChoiceCards.test.tsx` (off: no card node and no `futureos-choice` in the text, prose intact; on: rows and title; omitted: this machine's switch), `RemotePeerSettings.test.tsx` (the row shows the host's value and writes only `choiceCards`). Falsified by ignoring the host's answer in the hook, by ignoring the prop in the transcript, and by reading a missing key as off: each turns the matching assertion red.
perfectionist/sort-imports flagged three imports that landed out of path order when the choice-card switch was wired into the layout: ChoiceCardsContext before PeerIconGlyph / agentStateCache, and useRemoteChoiceCards before useRemoteSkillCatalog. Moves the three lines; no behaviour change.
huichen
enabled auto-merge (squash)
November 17, 2026 15:32
The shutdown_bounded case connected a client and let `select!` poll the serving future for the first time only afterwards. `RunningAgent::serve` enters the service's admission on its first poll, while `AgentHandle::request_shutdown` closes that admission synchronously, so a stop that won the race to the first poll made `serve` refuse with "Agent service is stopping" and the case reported that refusal as a failed serving future, with the stop itself reporting Stopped. Measured in CI run 44114695942 (job 134149753884), and reproduced locally by composing the same two steps in that order. Every host polls `serve` before it can ask for a stop; poll it once here as well, before the client connects. The ordering is then explicit instead of scheduler-dependent, and the assertion that the serving future is still running is kept.
auto-merge was automatically disabled
November 17, 2026 18:42
Pull request was closed
huichen
enabled auto-merge (squash)
November 17, 2026 18:43
auto-merge was automatically disabled
November 17, 2026 20:37
Pull request was closed
huichen
enabled auto-merge (squash)
November 17, 2026 20:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Choice cards — the single/multi-pick card a reply can close with — become opt-in, and the remote lane stops guessing: a transcript draws what that host allows and shows a reply the host is still writing as unfinished. Every silent way the remote lane can stop drawing a reply now names itself in the console, and the card's row mark carries its mode.
Commits
b0a710ad4test(agent): poll the serving future before a stop can close admission — the bounded-shutdown case letselect!poll the serving future for the first time only after a client had connected, so a stop that won the race to that first poll madeserverefuse with "Agent service is stopping" and the case reported it as a failed serving future. It now polls once before the client connects, as every host does, keeping the assertion that the future is still running. Test only, no product code.84d9856e1fix(cli): list the choice-card switch in the desktop settings help —choiceCardswas added to the settings table without its line inhelp::DESKTOP_HELP; one line added, which is what the TUI/CLI help test checks.6f23fa0d1fix(desktop): order the choice-card imports lint expects — three import lines moved to the path orderperfectionist/sort-importsrequires; no behaviour change.6a5f661a1feat(remote): expose the choice-card switch on a remote desktop, and draw its cards — Remote → that computer → Automation gains a "Choice cards" switch written to the host's ownapp.dbthroughupdate_desktop_settings; a remote transcript reads that machine's value (one cached command per connection, followingapp_settings_changed) instead of this machine's, and treats a host that does not answer as on. The phone mirrors the same rule.eed201f4edocs(settings): list the choice-card switch in the Settings reference — the new row in the English and Chinese Settings wiki pages.e6189e2a3feat(desktop): say why a remote reply stopped being drawn live —warnRemoteLanelogs, once per conversation, reason and run, which of the four silent stops happened (a fragment dropped at its terminal frame, a failed content lane, a refused or failed run log, a settled record over a run the host still has in flight), with the error attached. Console only, no UI.7a8ffc3cbfeat(settings): gate choice cards behind a switch, off by default — Settings → General gains a "Choice cards" switch persisted aschoice_cardsinapp.db(packages/app-settings, default off). Off drops the card node and the fence itself on both renderers (malformed-fence fallback included), hides the conversation list's "waiting on your choice" mark, and leaveschoice.mdout of the system prompt through the per-runset_choice_cards/PromptOptions.choice_cardspath. Stored history is never rewritten; the card format and its single/multi semantics are untouched.60e1bdfd9fix(desktop): draw a remote run the host is executing as unfinished — the timeline exposes the runget_state.activeRunnames and the transcript marks that row in flight, so a running reply is no longer folded as settled or offered copy and fork; a settled record, an idle state read older than the run's last frame, or a low-frequency recheck ends a run whose terminal frame was lost on at-most-once NATS.f6457ec40test(shot): capture the multi-choice card's checkbox marks —?choiceMode=multiswaps the fence's mode line, andchoice-card-multiasserts the box by computed border-radius so a regression to a circle fails the capture.c3bb4dd69fix(choice): draw multi-choice rows with a checkbox mark — a 3px-rounded square on desktop (card and edit popover), a 4px box with a check on the phone; the single card keeps its ring.Verification
Local, at
921738869(this head), pinned Rust 1.99.1 with the Homebrew 1.96.0 shadowed off PATH,ulimit -n 8192:cargo fmt --all -- --check→ cleancargo clippy -p future-agent --all-targets -- -D warnings→ cleancargo test -p future-agent --test shutdown_bounded→ 3 passed, run three timesLocal, at
af21e1e89(the tree of this branch apart from the three import lines reordered in6f23fa0d1):cargo check -p future-agent -p future-host -p future-app-settings -p future-rpc --all-targets→ cleancargo clippy -p future-agent -p future-host -p future-app-settings -p future-rpc --all-targets -- -D warnings→ cleancargo test -p future-rpc --lib→ 286 passedcargo test -p future-app-settings→ 23 passedcargo test -p future-host --lib→ 2289 passed / 0 failed / 15 ignored (455.7s)cargo test -p future-agent --lib→ 3104 passed / 0 failed / 7 ignored (146.0s)make check-docs→ 423 docs OK, 0 pairs pending, provider matrix 13 rowsnpx tsc --noEmitclean; the CI-exactnpx --no-install eslint 'src/**/*.{ts,tsx}' 'shot/**/*.{ts,tsx}' vite.shot.config.ts→ 0 errors at this head (threesort-importserrors ataf21e1e89are fixed by6f23fa0d1; the remainingjsdoc/no-multi-asteriskswarning inliveRunProjection.tspredates this branch);npx vitest runon the 14 touched suites → 297 passednpx tsc --noEmitclean;npx eslinton the touched files clean;npx jeston the 3 touched suites → 64 passedNotes
desktop/src/components/layout/AppShell.tsxshows ~945 changed lines because the newChoiceCardsProviderwraps the shell's JSX and re-indents it; the whitespace-insensitive diff is 13 added lines.f6457ec40is screenshot-fixture only,eed201f4eis documentation only, andb0a710ad4is test only.User-visible changes
futureos-choicecard drew, and the system prompt taught the model the fence. After: Settings → General → "Choice cards" starts off, so nothing draws — not the card node, not a code-block fallback — the conversation list's "waiting on your choice" mark is hidden, and the prompt section is left out so nothing produces a card. Turning it on restores both halves; stored history is never rewritten. Revert7a8ffc3cb.app.db; a remote transcript draws by that machine's value, an older host that does not answer counts as on (its cards keep drawing), and an unreachable host falls back to this machine's switch. Revert6a5f661a1.c3bb4dd69.get_state.activeRun, and a settled record, a stale idle read, or a periodic recheck ends a stranded run. Revert60e1bdfd9.e6189e2a3.