Repository navigation
feat(desktop): localized quit confirmation; fix(host): keep a queued run queued - #1699
Merged
Merged
Conversation
…nd counts what is generating The quit prompt was the last native dialog with hardcoded English copy, and all it said was "Agent work is still active" — a user could not tell one streaming conversation from a queue of background maintenance. Updates have carried the window's language into their dialogs for months; this one is raised from a window/run event and had no invoke to carry it. The window now registers the language it resolved (`set_ui_language`, pushed on start and on every switch, the same way the caption colors are handed over), and the confirmation is built from the bundled `quit.*` catalogues in both languages: how many conversations are still generating a reply, what quitting costs for this agent's ownership, then the question. The count comes from splitting the same activity snapshot the decision already read — `running` is "still generating", everything else is "other work" — so the total that decides Proceed/Confirm is unchanged, and a status that cannot be read still says so instead of guessing. The trigger is deliberately untouched: any agent work (queued runs, approvals, compaction, background) still prompts, as does an unreadable one. Narrowing that to local streaming sessions is a product decision still with the user.
…nd counts what is generating (#task quit-dialog-locale)
…t running A prompt the Agent accepts while another run is executing is *queued* behind it. The prompt path wrote that status, and `run_prepared_prompt_inner` — the wrapper the remote (mobile) prompt and scheduled-task paths go through — knew only complete/incomplete, so it restamped the row `failed` a moment later. The settled-run repair then read the Agent ledger, saw the run alive, and revived it as `running`: the one status that wins the "latest run" read. The open conversation therefore anchored its live preview on a run with no events and drew a second, empty "thinking" bubble for a turn that had not started (2026-11-26: two assistant bubbles under one prompt, the lower one counting from the queued row's own start). Measured on the affected conversation: the queued prompt's row was settled `failed` (error_type `run_queued`) at 09:41:1x and revived `running` at 09:41:41, holding the latest-run seat until the executing turn ended at 09:54. - `run_prepared_prompt_inner`: a `run_queued` ending no longer rewrites the row; it still returns Err, because the turn is owed and no caller may record a finished answer. - `plan_settled_run_reconciliation` splits the live answer into Alive (executing) and Held (queued), and `revive_unverified_run` takes which shape to restore — `running` or `queued` (with the `queue_accepted` marker `mark_run_queued` writes). Red-first: the wrapper test failed with status `failed` / error_type `run_queued` before the fix; the revive tests failed with `running` where `queued` was required.
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.
What this does
This PR makes the desktop quit confirmation speak the window's language and say what it is actually about to interrupt, and stops a prompt the Agent accepted into its queue from being reported as a failed run (then revived as running) — the cause of a second, empty "thinking" bubble under one prompt.
Commits
set_ui_language) and the native quit dialog is built from the bundledquit.*English/Chinese catalogues; it reports how many conversations are still streaming, distinguishes other work (queued runs, approvals, compaction, background), and says what quitting costs for an owned vs. attached agent. The prompt trigger itself is unchanged.run_prepared_prompt_innerno longer rewrites arun_queuedending tofailed; settled-run reconciliation now revives a live row asrunning(executing) orqueued(held), so a held turn no longer takes the latest-run seat and opens an empty live preview.Verification
Local, on the branch tip
046fb82c7with the pinned toolchain 1.99.1 fromrust-toolchain.toml:cargo fmt --all -- --check— cleancargo check -p future-host -p futureos --all-targets— cleancargo clippy -p future-host -p futureos --all-targets -- -D warnings— cleancargo test -p future-host --lib— 2365 passed, 0 failed (15 ignored; 471.86s)cargo test -p futureos --lib— 369 passed, 0 failed (66.33s); a first run hit one failure incommands::agent::tests::sandbox_maintenance_commands_parse_agent_results, a test this branch does not touch — it passes alone and on rerun, and the mock-agent tests share global script statenpx tsc --noEmitclean;npx eslint src/lib/nativeLanguage.ts src/lib/nativeLanguage.test.ts src/main.tsxclean;npx vitest run— 443 files / 6300 tests passedUser-visible changes
c1f8d5756.failedand then revived asrunning, so the open conversation drew a second, empty "thinking" bubble for a turn that had not started. After: the row staysqueueduntil the Agent executes it, and reconciliation restores a held row asqueuedrather thanrunning. Rollback: revert466d40f88.Notes
None: no migrations, defaults, feature switches or permission changes.