feat: TUI remote connection to daemon via A2A protocol#679
Merged
Conversation
Add --daemon flag (daemon+a2a features) that bootstraps a full agent with LoopbackChannel, exposes an A2A JSON-RPC server under DaemonSupervisor, writes a PID file, and shuts down cleanly on SIGINT. Add --connect <URL> flag (tui+a2a features) that connects the TUI to a running daemon via A2A SSE, mapping TaskEvent to AgentEvent in real time. Final ArtifactChunk text is no longer discarded before Flush. Add LoopbackChannel / LoopbackHandle / LoopbackEvent to zeph-core as a headless channel for programmatic agent I/O. PID file creation uses O_CREAT|O_EXCL to prevent TOCTOU races. Refactor TaskProcessor::process to accept an mpsc::Sender<ProcessorEvent> and stream events instead of returning a synchronous ProcessResult. Server-side event type renamed to ProcessorEvent to avoid collision with the client-side TaskEvent. Expand command palette: new TuiCommand variants (Quit, Help, NewSession, ToggleTheme, DaemonConnect, DaemonDisconnect, DaemonStatus), shortcut hints, and fuzzy-match scoring with gap penalty replacing substring filter. Fixes app:theme incorrectly mapping to Help. Closes #582, #583, #584, #585, #678
Add daemon mode guide, update CLI reference with --daemon/--connect flags, expand command palette docs to 14 commands, add LoopbackChannel and streaming TaskProcessor to architecture pages, update channels reference with Loopback channel, and update feature flag descriptions.
Remove unused OllamaProvider import (src/main.rs:1544), fix unused mut on LoopbackChannel test handle, add missing struct fields (metadata, task_id, context_id) in multi-chunk test, use add_artifact instead of append_history for accumulated response text.
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
LoopbackChannelfor headless agent communication bridging A2ATaskProcessorwith agent loop via tokio mpsc (feat(core): add LoopbackChannel for headless agent communication #582)TaskProcessortrait to streaming model withProcessorEventandevent_txchannel (feat(a2a): streaming TaskProcessor routed through full agent loop #583)--daemonmode with fullAppBuilderbootstrap,DaemonSupervisor, PID lifecycle, graceful shutdown (feat(daemon): wire --daemon mode with DaemonSupervisor #584)--connect <url>TUI remote mode mapping SSETaskEventtoAgentEventin real-time (feat(tui): --connect mode to attach TUI to remote daemon via A2A SSE #585)ToggleThemevariant (feat(tui): expand command palette with daemon controls and fuzzy matching #678)--initwizard with daemon configuration step (host, port, auth token)OpenOptions::create_new(true)Closes #582, closes #583, closes #584, closes #585, closes #678
Test plan
cargo nextest run --workspace --lib --bins)cargo clippy --workspace -- -D warningscleancargo clippy --features tui,a2a -- -D warningscleancargo check --features daemon,a2acompilescargo +nightly fmt --checkcleancargo run --features daemon,a2a -- --daemonstarts A2A servercargo run --features tui,a2a -- --connect http://localhost:3000connects TUI