Platform View

Documentation is adapted for macOS.

Shell commands, launchd paths, and Apple runtime guidance

CLI Version Context

Installed CLI: 1.1.0 (latest compatibility profile)

Support Bundle

Capture a complete diagnostics artifact for support triage.

macos
OUT=~/Desktop/opta-support-$(date +%Y%m%d-%H%M%S).txt; { echo "# Opta Support Bundle"; echo "# Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"; echo; opta doctor; echo; opta daemon status; echo; opta daemon logs --lines 200; echo; opta config list; } > "$OUT" && echo "Saved $OUT"
Support FAQ

Learn About

Deep workflow guides aligned to this documentation section.

Browse all Opta Learn guides

Troubleshooting

Resolve the highest-frequency daemon failure patterns with deterministic recovery steps. For incidents outside this guide, inspect opta daemon logs first and escalate with the exact error trace.

Daemon Exits Immediately

If opta daemon start exits without error output, the most common cause is a port conflict.

Port in Use

The daemon tries to bind to port 9999. If that port is taken, it scans ports 10000 through 10020. If all ports are occupied, the daemon fails to start.

Check what is using port 9999
lsof -i :9999
COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    12345  matt   22u  IPv4  0x...  0t0  TCP localhost:9999 (LISTEN)

If another process owns the port, either stop that process or configure the daemon to use a different port range:

Stop the conflicting process and restart daemon
kill 12345 && opta daemon start
Multiple daemon instances
Never run two daemon instances. If you see a daemon already listening, use opta daemon status to check whether it is a legitimate Opta daemon before killing it.

WebSocket Drops

WebSocket connections can drop for several reasons. The most common is the LMX server becoming unreachable during inference.

LMX Unreachable

If the daemon cannot reach the LMX server at lmx-host.local:1234, it will emit a turn.error event with code LMX_UNREACHABLE. The WebSocket connection itself stays open, but inference fails.

1

Check LMX is running

curl http://lmx-host.local:1234/healthz
{"status":"ok"}
2

Check network connectivity

Verify LAN connection to dedicated Apple Silicon host
ping -c 3 lmx-host.local
3

Check LMX has a model loaded

curl http://lmx-host.local:1234/readyz
{"ready":true,"model":"qwen3-30b-a3b"}
Network routing guidance
Prefer direct LAN routing to the LMX host for lowest latency and fewer connection edge cases. Overlay networks can work, but usually increase jitter and troubleshooting complexity.

Permission Requests Hang

If a turn appears stuck, it may be waiting for a permission approval that was never resolved. This happens when a client disconnects while a permission.request event is pending.

To unblock the session:

1

Check for pending permissions

Connect to the WebSocket or poll events to find any unresolved permission.request events.

2

Cancel the stuck turn

Replace SESSION_ID and TOKEN with actual values
curl -X POST http://127.0.0.1:9999/v3/sessions/SESSION_ID/cancel -H 'Authorization: Bearer TOKEN'
3

Submit a new turn

After cancelling, you can submit a new turn to continue the conversation.

Automatic timeout
Permission requests that are not resolved within 5 minutes are automatically denied by the daemon. The turn will receive a tool denial and continue without the tool result.

State File Corrupt

If the state file at ~/.config/opta/daemon/state.json becomes corrupt (e.g., due to a power loss during write), the CLI will fail to connect to the daemon.

Fix: delete the state file and restart the daemon.

Remove corrupt daemon state and restart
rm ~/.config/opta/daemon/state.json && opta daemon start
Session data is safe
Deleting state.json only removes the daemon process metadata (PID, token, port). Your session history is stored separately in ~/.config/opta/sessions/ (or %APPDATA%\\opta\\sessions\\ on Windows) and will not be affected.

Crash Recovery

If the daemon crashes, the CLI automatically detects the stale state file on the next command. The ensureDaemonRunning crash guardian performs these steps:

  • Reads the PID from state.json
  • Sends a signal-zero check to verify the process is alive
  • If the process is dead, removes the stale state file
  • Spawns a new daemon with a fresh token
  • Retries the original command

This happens transparently — in most cases, you will see a brief delay while the daemon restarts, then your command proceeds normally.

opta doctor

The opta doctor command runs a comprehensive diagnostic check across the entire Opta Local stack:

opta doctor
Checking daemon...        ● running (pid 12345, port 9999)
Checking LMX...           ● reachable (lmx-host.local:1234)
Checking model...         ● loaded (qwen3-30b-a3b)
Checking config...        ● valid
Checking permissions...   ● ok

All checks passed.

Use opta doctor --fix to attempt automatic fixes for common issues (stale state files, dead processes, missing config directories):

Run diagnostics and auto-fix issues
opta doctor --fix

Log Analysis

The daemon log at ~/.config/opta/daemon/daemon.log is your primary debugging tool. Key patterns to look for:

text
# Successful start
[10:00:01] INFO  daemon started on 127.0.0.1:9999

# LMX connection failure
[10:00:05] ERROR lmx preflight failed: ECONNREFUSED lmx-host.local:1234

# Permission timeout
[10:05:00] WARN  permission request perm_001 timed out (5m), auto-denying

# OOM in tool worker
[10:10:00] ERROR tool worker crashed: heap out of memory

# Session directory creation race
[10:00:02] WARN  session dir already exists, skipping mkdir

Reset Everything

If targeted remediation fails, run a controlled full daemon reset. This sequence stops the daemon, clears daemon state artifacts, and starts a clean process while preserving session history.

Step 1: Stop the daemon
opta daemon stop
Step 2: Remove daemon state and logs
rm ~/.config/opta/daemon/state.json ~/.config/opta/daemon/daemon.log
Step 3: Start fresh
opta daemon start
Do not delete the sessions directory
The ~/.config/opta/sessions/ directory (or %APPDATA%\\opta\\sessions\\ on Windows) contains all persisted session data. Deleting it permanently erases conversation history.