.:.
  OPTA CODE
   ':'
reference Guide

Code Desktop Masterclass

A definitive guide to the Opta Code native application. Explore Tauri architecture, global telemetry, timeline virtualization, and desktop integration.

Updated 2026-03-04

Ecosystem Role

Opta Code Desktop is the canonical, high-fidelity visual interface for the Opta ecosystem. Built with Tauri v2, React 18, and Vite, it acts as a native macOS and Windows wrapper over the underlying Opta CLI daemon. It does not run inference or orchestrate agents itself; it acts purely as a stateless viewport into the daemon's brain.
Opta Desktop (Tauri)
WebSocket :3456
← StateCommands →
Daemon
Node.js

The Dynamic Composer

The heart of the Desktop UI is the Composer. This isn't just a text box; it is an intelligent context router. Inline pills above the input field allow you to inject per-turn overrides. You can instantly switch a single message from the fast local LMX provider to a universal provider like DeepSeek, or toggle "Dangerous Mode" on/off for specific shell executions without altering your global config.
DO MODE
DeepSeek (Universal)
Level 4 (Dangerous)
Write a deployment script and push it...|
Cmd + Enter to Send

Holographic Telemetry Dashboard

Replacing the raw terminal output, the Desktop App features a "Neon Nodes" aesthetic Telemetry Dashboard. It listens to the daemon's v3 HTTP endpoints to visualize live tool progress bars, sub-agent dependency graphs, and resource usage. If LMX spikes your GPU VRAM, you will see it visually represented in the side-panel in real-time.
// Daemon Emits:
{
  "type": "telemetry",
  "metrics": { "vramUtilized": 28, "vramTotal": 32, "tokensPerSec": 94.2 }
}

Timeline Virtualization & Hydration

High-throughput local models can stream hundreds of tokens per second. Standard React applications crash under this DOM thrashing. Opta Code utilizes a custom useStreamingMarkdown hook to debounce raw markdown streams, paired with react-window/virtuoso to aggressively unmount off-screen chat cards. If you restart the app, it instantly hydrates its state from the persistent daemon, exactly where you left off.
Virtual Node (Unmounted)-200 DOM elements
Virtual Node (Unmounted)-150 DOM elements
Active Node (Rendered)

Session Triage Workflow (First 10 Minutes)

When a desktop session starts behaving strangely, operators need a deterministic triage loop instead of ad-hoc clicking. Begin by validating session identity and routing: confirm the active workspace, provider pill, and permission level in the Composer header before sending any new instruction. Next, inspect the live telemetry side panel and verify the expected model is receiving tokens, the stream rate is non-zero, and VRAM pressure is not in sustained saturation. Then review the most recent timeline cards for the exact event where latency or behavior changed: model switch, tool escalation, context injection, or daemon reconnect. If symptoms are still ambiguous, issue one minimal probe prompt and observe whether UI rendering, daemon response, and tool approval flow all complete in a single cycle. This isolates whether the fault is interaction state, orchestration state, or inference state.

Operator checklist: 1) Confirm route + permissions, 2) verify telemetry heartbeat, 3) identify divergence point in timeline, 4) run a single probe turn, 5) classify failure domain before attempting fixes.

Failure Analysis & Recovery Routine

Recovering quickly from desktop failures is mostly about preserving evidence before restarting components. If the Composer freezes, do not immediately relaunch the app. Capture the active timeline node, recent tool event, and telemetry snapshot first; these three artifacts usually identify whether the fault came from UI hydration drift, WebSocket transport interruption, or daemon-side task deadlock. For transport issues, prefer a soft reconnect path so session state is retained and unsent context is not lost. For daemon contention, reduce concurrent workload by pausing non-critical runs, then replay the failing prompt with a smaller context window to test determinism. After recovery, record the incident in a short postmortem note: trigger, observable symptom, containment action, and confirmed fix. This creates reusable runbooks and makes future incidents faster to diagnose.
Recovery mini-runbook
1. Capture: timeline event ID + telemetry metrics + last tool invocation.
2. Contain: stop new high-risk tasks and keep current session state alive.
3. Reconnect: restore transport first, then validate one probe turn.
4. Replay: rerun failing prompt with reduced context to isolate root cause.
5. Document: trigger, fix, and prevention rule for operator handoff.