How Atomic Agent's desktop app is just a plain HTTP client to its OpenAI-compatible server
GapNew4766 · reddit · 2026-10-13
The team behind Atomic Agent (MIT-licensed) explains why its desktop app talks to the agent via a plain OpenAI-compatible HTTP server instead of the existing NDJSON sidecar: sidecar and server both boot the full runtime, so pointing them at one state directory spawns two task schedulers and cron jobs fire twice.
API highlights
- atag serve --host 127.0.0.1 --port <ephemeral> --api-key <random>; loopback only, new port and bearer token every launch; /health unauthenticated.
- Endpoints: POST /v1/chat/completions (stream/sync), /cancel, /api/sessions/{id}/steer for mid-turn steering, GET /api/events (SSE) for approvals, /api/approval/resolve, /compact.
Strict OpenAI subset + opt-in extensions
By default the stream is a strict subset of OpenAI's chat.completion.chunk — off-the-shelf clients like the Vercel AI SDK zod-validate every frame and break on unknown events. With X-Atomic-Extensions: 1 you get named frames: reasoningprogress, toolprogress, fusionworker (role, model, tool, step count, ETA, context tokens), steerapplied/steerundelivered, and a final usage frame.
Steering and approvals
- Steer messages fold into the running turn and are read at the next step; undelivered ones get parked (app keeps up to 20).
- Approvals ride a side SSE channel with allow-once/deny only; to be asked less, switch modes (Ask first, Plan, Auto, Bypass) instead of granting one by one.
Gotchas
- A turn waiting on approval once wrote nothing to the stream and Node's undici gave up after 300s; since v0.6.7 the server sends a : keepalive comment every 15 seconds — fix SSE parsers that trip on comments.
- serve boots the same runtime as the TUI (Telegram/Discord bots run in-process); channels take a lockfile so a second process reports already running. --no-approval forces full bypass for that process.
More from coding & agent
- Senior Engineer Benchmark: Muse Wonder scores 52%, well behind Claude and GPT coding models — danshipper · 2026-10-13
- Audit: CodeRabbit cost 174 engineers $41,760/yr to cut PR merge time by 6 minutes — Exciting_Item_2732 · 2026-10-13
- 'World's first autonomous digital organism' lives on a knockoff Roku with 4GB RAM — Kyrannio · 2026-10-13
- TBD Labs launches Muse Wonder agents for delegating real work — EdwardSun0909 · 2026-10-13
- Claude Code hand-builds a 16-frame Scratch Cat walk cycle — yoobinray · 2026-10-13
- Animating a cheetah via physics simulation reveals the limits of rigid-body skeletons — Kyrannio · 2026-10-13