Skip to content

feat(tui+deploy): wire TUI to live ReasoningLoop via agent_bridge; add Docker deployment#4

Merged
marcuspat merged 7 commits into
mainfrom
feat/tui-agent-bridge
Jun 17, 2026
Merged

feat(tui+deploy): wire TUI to live ReasoningLoop via agent_bridge; add Docker deployment#4
marcuspat merged 7 commits into
mainfrom
feat/tui-agent-bridge

Conversation

@marcuspat

Copy link
Copy Markdown
Owner

Summary

Wires the Sentinel TUI to a live ReasoningLoop via the async agent_bridge module, and adds Docker/Compose deployment artifacts.

sentinel-tui changes

agent_bridge.rs (prior commit)

  • AgentConfig struct: goal, host, dry_run, backend_name, api keys, model
  • run_agent_session(): async bridge that drives ReasoningLoopSessionUpdate channel + ApprovalRequest channel

app.rs

  • New fields: pending_goal, host, dry_run, session_update_rx, approval_rx, approval_responder
  • start_session() sets pending_goal so the event loop can spawn the agent task on the next tick
  • apply_session_update() dispatches all SessionUpdate variants to TUI state
  • poll_session_updates() / poll_approval() drain channels each tick

main.rs

  • run_app() event loop: drains updates, polls approval, spawns run_agent_session tokio task when pending_goal is set
  • --dry-run CLI flag on tui subcommand
  • Model default: claude-opus-4-8

Deployment

  • Dockerfile: multi-stage rust:1.82-slim builder → debian:bookworm-slim runtime; PTY-safe binary
  • docker-compose.yml: ANTHROPIC_API_KEY guard, TTY wiring (stdin_open, tty), default tui --host localhost

How to run

# Docker
ANTHROPIC_API_KEY=sk-... docker compose up

# Native
cargo run --bin sentinel -- tui --host localhost

Lifecycle

Goal input → start_session() → pending_goal set → run_app() spawns run_agent_session() → ReasoningLoop drives investigate→plan→approve→act → SessionUpdate stream updates TUI in real time

Implements run_agent_session() which drives the full investigate → plan → approve → act
lifecycle in a background tokio task, emitting SessionUpdates into the TUI channel.

Part of feat/tui-agent-bridge: TUI wired to live ReasoningLoop + Dockerfile.
Replace hardcoded default host with app state values for session start.
@marcuspat marcuspat merged commit 42e7c77 into main Jun 17, 2026
3 checks passed
@marcuspat marcuspat deleted the feat/tui-agent-bridge branch June 17, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant