feat(tui): event-driven background task sync and log viewer#108
Merged
yishuiliunian merged 2 commits intomainfrom Apr 15, 2026
Merged
feat(tui): event-driven background task sync and log viewer#108yishuiliunian merged 2 commits intomainfrom
yishuiliunian merged 2 commits intomainfrom
Conversation
898898a to
504bfe2
Compare
Background tasks were invisible in the TUI because the agent process and TUI process had separate BackgroundTaskStore instances (noted as "future: sync from agent via IPC" in multiprocess.rs). Replace the polling-based reporter with event-driven sync matching the ToolProgress pattern: - BackgroundTaskStore emits SpawnNotification on insert, carrying Arc handles for per-task monitoring - bg_task_bridge subscribes and spawns per-task select! monitors: output sampler (2s delta) + completion watcher (await watch_rx) - Three protocol events: BgTaskSpawned, BgTaskOutput, BgTaskCompleted - Session state builds incrementally from events (IndexMap for O(1)) - TUI reads from session state; panel shows all tasks; Enter opens full-screen log viewer SubPage with auto-follow Removes TUI dependency on loopal-tool-background (bg_store was always empty in the TUI process).
504bfe2 to
79f200e
Compare
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
BgTaskSpawned→BgTaskOutput(2s delta) →BgTaskCompletedChanges
BgTaskDetail,BgTaskSpawned/Output/CompletedeventsSpawnNotification+subscribe_spawns()onBackgroundTaskStorebg_task_bridge.rs— per-taskselect!monitors in JoinSetbg_task_state.rs— incremental state machine with IndexMapbg_storedependencyTest plan
bazel build //...passesbazel build //... --config=clippyzero warningsbazel build //... --config=rustfmtpassesbazel test— all 4 affected test targets pass