Daemon Controls
Code Desktop includes a dedicated daemon panel for managing the Opta daemon lifecycle, handing off deeper operations to CLI mode, and monitoring connection health -- all from the graphical interface.
Daemon Panel
The daemon panel is a dedicated section of the Code Desktop interface that surfaces daemon status and control actions. It shows:
- Current state -- whether the daemon is running, stopped, or starting
- PID -- the process ID of the running daemon
- Uptime -- how long the daemon has been running since last start
- Port -- the port the daemon is listening on (default 9999)
- Session count -- number of active sessions
Lifecycle Controls
The daemon panel provides the following lifecycle actions:
- Stop -- sends a graceful shutdown signal to the daemon. Active sessions remain persisted on disk.
- Restart -- performs a stop/start cycle and triggers automatic reconnect once the daemon returns.
- CLI Ops -- opens the daemon operations view for command-first lifecycle and diagnostics workflows.
Log Viewer
The log viewer provides a real-time tail of daemon log output. Logs are streamed from the daemon's log file and displayed in a scrollable terminal-style panel with:
- Timestamp -- when each log entry was written
- Level -- color-coded severity (debug, info, warn, error)
- Component -- which daemon subsystem generated the log (e.g., session, tools, lmx)
- Message -- the log content
The log viewer auto-scrolls to the latest entry by default. Scrolling up pauses auto-scroll so you can inspect older entries; scrolling back to the bottom resumes auto-scroll.
Log entries can be filtered by severity level. Setting the filter to "error" shows only errors and warnings, which is useful for diagnosing issues without wading through verbose debug output.
Connection Status
The connection status indicator is always visible in the Code Desktop header. It shows one of three states:
| State | Indicator | Meaning |
|---|---|---|
| Connected | Green dot | WebSocket active, daemon responding to health checks |
| Reconnecting | Amber pulse | WebSocket disconnected, attempting reconnection with backoff |
| Disconnected | Red dot | Daemon unreachable, multiple reconnection attempts failed |
Auto-Discovery
On startup, Code Desktop bootstraps daemon metadata (host/port/token) in native runtime and probes configured endpoints in web/dev mode. It then binds the UI connection model to the resolved daemon endpoint.
The daemon configuration root follows the same cross-platform convention as Opta CLI: ~/.config/opta on macOS/Linux and %APPDATA%\\opta on Windows.