feat(channels,tui,a2a): migrate leaf spawns to TaskSupervisor, add TUI task registry#2979
Merged
feat(channels,tui,a2a): migrate leaf spawns to TaskSupervisor, add TUI task registry#2979
Conversation
…I task registry Closes #2961, #2962. TelegramChannel gains a with_supervisor() builder that migrates the dispatcher loop from bare tokio::spawn to supervisor.spawn_restartable with RestartPolicy::Retry { max: 5, base_delay: 2s }. Reconnect retries are now logged and visible in the supervisor registry. spawn_a2a_server in daemon.rs wraps A2aServer::serve() via supervisor with RestartPolicy::RunOnce. spawn_background_indexer in agent_setup.rs routes the indexer launch through supervisor when present. Per-file chunk supervision in zeph-index is deferred to #2978 due to a zeph-core -> zeph-index crate cycle. RunOnce factories use parking_lot::Mutex (infallible lock) and emit tracing::warn! when the factory cell is already consumed. TaskRegistryWidget added in crates/zeph-tui/src/widgets/task_registry.rs. Displays a live table of supervised tasks (name, origin crate, state, uptime-since-last-restart, restart count) with a spinner for Running tasks. Toggled via the /tasks command in the TUI command palette. Shows a placeholder when TaskSupervisor is not wired. Refreshes at the existing 10 fps render interval with no additional timer.
This was
linked to
issues
Apr 14, 2026
…t in doc-test scope)
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
TelegramChannelgainswith_supervisor()builder that migrates the dispatcher loop tosupervisor.spawn_restartablewithRestartPolicy::Retry { max: 5, base_delay: 2s }.spawn_a2a_serverwrapsA2aServer::serve()viaRunOnce.spawn_background_indexerroutes the indexer launch through supervisor. Per-file chunk supervision inzeph-indexdeferred to feat(index): per-chunk spawn_blocking supervision in CodeIndexer #2978 (zeph-core → zeph-index crate cycle).TaskRegistryWidgetincrates/zeph-tui/src/widgets/task_registry.rsrenders a live table of supervised tasks with spinner, name, crate, state, uptime-since-restart, and restart count. Toggled via/taskscommand. Shows placeholder when supervisor is unavailable.parking_lot::Mutexused in all RunOnce factories (infallible lock);Nonebranch emitstracing::warn!.Test plan
cargo nextest run --workspace --features full --lib --bins— 8263 tests passcargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— clean--tui, type/tasks— panel renders supervised tasks with spinner for Running state/taskswith no supervisor wired — shows "Task supervisor not available." placeholdera2a_servertask visible in/taskspanel/tasksduring startup indexing.local/testing/playbooks/task-supervisor-leaf-tui.mdFollow-up
spawn_blockingsupervision inCodeIndexer(requires breaking zeph-core → zeph-index cycle viatrait BlockingSpawner)