Repository navigation
feat: add daemon-backed TUI client - #482
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a new ChangesDaemon TUI Feature
Sequence DiagramssequenceDiagram
participant RemoteClient
participant Consumer
participant WireMessage
RemoteClient->>RemoteClient: stream_prompt_or_run_request(display_consumer)
RemoteClient->>RemoteClient: _stream_prompt_like_request(display_consumer)
RemoteClient->>RemoteClient: _handle_prompt_like_sse_event(sse_event, display_consumer)
alt display_consumer provided
RemoteClient->>RemoteClient: _handle_prompt_like_sse_event_with_consumer
RemoteClient->>WireMessage: translate SSE payload to WireMessage
RemoteClient->>Consumer: asyncio.run(emit(WireMessage))
alt is ApprovalRequest
RemoteClient->>Consumer: asyncio.run(request_approval(ApprovalRequest))
Consumer-->>RemoteClient: ApprovalResponse
RemoteClient->>RemoteClient: _submit_approval(response)
end
else no consumer
RemoteClient->>RemoteClient: default legacy stdout handling
end
sequenceDiagram
participant User
participant CliCommand
participant DaemonLocalSession
participant StreamPrompt
participant TUIConsumer
User->>CliCommand: daemon tui --goal "..." --url ...
CliCommand->>CliCommand: CodingAgentTUI().__enter__()
CliCommand->>DaemonLocalSession: _create_daemon_local_session
DaemonLocalSession-->>CliCommand: session_id
CliCommand->>StreamPrompt: stream_prompt_or_run_request(display_consumer=tui.consumer)
StreamPrompt->>TUIConsumer: emit(StreamDelta), emit(TurnEnd), etc
TUIConsumer-->>StreamPrompt: ack
StreamPrompt-->>CliCommand: status_code
CliCommand->>DaemonLocalSession: optionally delete session (finally block)
CliCommand->>User: SystemExit(status_code)
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Manual P1/P2 fallback review because CodeRabbit remained pending and has not produced review findings. Scope reviewed:
Focus:
Result: no actionable P1/P2 correctness, security, data-loss, or agreed-scope findings found. Verification:
|
Summary
coding_agent daemon tuito create a local-path daemon session and render display-event SSEs through Rich TUITests
uv run pytest tests/cli/test_remote_client.py -k "daemon_command_starts or local_daemon or daemon_run or daemon_repl or daemon_tui or emit_display_events or stream_prompt_requests_display_event" -vuv run pytest tests/cli/test_entrypoint_contract.py -k "daemon or subcommand_help" -vuv run ruff check src/coding_agent/cli/serve_command.py src/coding_agent/remote/client.py tests/cli/test_remote_client.py tests/cli/test_entrypoint_contract.pySummary by CodeRabbit
New Features
daemon tuicommand to run a single prompt through a local daemon with a Rich terminal interface.Documentation