feat(tui): surface build & turn completion via toast + bell#11
Merged
Conversation
Long-running bash tasks (`notify_on_complete: true`) now push a green/red toast into the TUI when they finish, and assistant turns that ran ≥8s do the same — so you can step away during a build or a long agent turn and notice the moment it's done. - core: add `completionToast` (Option<bool>, default true) and `bellOnComplete` (default false) settings, merged hierarchically. - tools: replace `CompletionNotifier(Fn(String))` with a structured `BgTaskCompletion` payload (task_id, command, success, exit_info, output_tail, duration_secs) so consumers can fan-out to system- message injection, TUI toasts, and a terminal bell from one source of truth. - cli: drain a new `bg_completion_rx` channel each main-loop tick and feed `App::signal_bg_task_completion`, which pushes a Success/Error notification (sticky on failure, 8s on success) and rings `\x07` when the bell flag is on. - tui: same toast+bell on `QueryEvent::TurnComplete` for turns past `completion_toast_min_secs` (8s). Brighten the idle "✽ Worked for…" status line into a bold green ✓ so it reads as "done" at a glance instead of dim gray. Four new unit tests cover the toast routing and duration formatting. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
notify_on_complete: truenow push a green ✓ / red ✗ toast into the TUI the moment they finish — so you can step away during a build and notice when it's done.TurnComplete, and the idle "✽ Worked for…" status line is brightened into a bold green ✓ that reads as done at a glance instead of dim gray.~/.coven-code/settings.json:completionToast(defaulttrue) — show the toastbellOnComplete(defaultfalse) — also ring\x07Implementation
CompletionNotifiernow carries a structuredBgTaskCompletion { task_id, command, success, exit_info, output_tail, duration_secs }instead of a flat string, so consumers can fan out to system-message injection, TUI toasts, and the terminal bell from one source of truth.bg_completion_rxchannel each tick and callsApp::signal_bg_task_completion, which routes Success (auto-expires 8s) vs Error (sticky until acknowledged).completionToastOption<bool>cleanly distinguishes "default" from "explicitly disabled," sidestepping the bool-default-false bug that affects sibling fields likenotifications.Test plan
cargo checkclean acrossclaurst-core,claurst-tools,claurst-tui,claurstbg_task_success_pushes_success_toast,bg_task_failure_pushes_error_toast_no_autoexpire,bg_task_toast_disabled_pushes_nothing,format_duration_secs_bucketsclaurst-tui/claurst-coreconfirmed to fail on cleanmain— not regressions from this changecargo buildvia Bash withrun_in_background: true, notify_on_complete: trueand confirm the toast appears"bellOnComplete": truein settings.json and confirm the terminal beeps on a long turn🤖 Generated with Claude Code