You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️Disclaimer: This issue is primarily focused on defining interfaces and service boundaries. Implementation details, data models, and internal wiring are intentionally pushed to later phases — the goal right now is to agree on the shape of the system before writing any code.
Tracking issue for the Go HTTP Daemon lane of the backend rewrite.
Goal
Replace the current Next.js API routes with a single Go binary on 127.0.0.1:3001 that serves:
/api/v1/* — REST endpoints (25 routes, path-parity with current TS)
The daemon is spawned as a sidecar child process by the Electron main process, supervised over loopback only. No auth, no CORS, no public URL.
Approach: phase-by-phase, contract-first
feat/go-http-daemon is the lane integration branch: every sub-PR branches off it and merges into it; the whole lane lands on main as one unit once complete.
1. Electron main spawns ./ao-daemon
2. Daemon binds :3001, starts listening
3. Main polls /healthz until ready
4. Renderer connects and loads UI
TODO — open question: How are agent sessions & projects loaded on daemon startup?
Warm cache from disk, lazy-load on first request, or explicit restore step?
PR sequence
Phase 1 — HTTP server skeleton + Electron integration
1a — Skeleton — Go module init, config (port, env), 127.0.0.1 bind, 5-middleware stack (recoverer → request ID → logger → real IP → timeout), /healthz + /readyz, graceful shutdown (10s timeout, SIGTERM/SIGINT)
1b — Route shell — All 25 routes registered under /api/v1 as 501 Not Implemented stubs; subrouter layout (/events, /mux, /api/v1, /) with correct middleware applied per surface
1c — Electron integration — embed.FS static serving, Electron main process spawns + supervises daemon, health-check polling before renderer connects, dev proxy (Next.js :3000 → Go :3001), packaged build with extraResources
Tracking issue for the Go HTTP Daemon lane of the backend rewrite.
Goal
Replace the current Next.js API routes with a single Go binary on
127.0.0.1:3001that serves:/api/v1/*— REST endpoints (25 routes, path-parity with current TS)The daemon is spawned as a sidecar child process by the Electron main process, supervised over loopback only. No auth, no CORS, no public URL.
Approach: phase-by-phase, contract-first
feat/go-http-daemonis the lane integration branch: every sub-PR branches off it and merges into it; the whole lane lands onmainas one unit once complete.Design doc & HTML overview: https://htmlpreview.github.io/?https://gist.githubusercontent.com/neversettle17-101/00c659adf978b80b1e2eb600d451932a/raw/ao-backend-rewrite-phase1.html
Startup sequence
PR sequence
Phase 1 — HTTP server skeleton + Electron integration
1a — Skeleton — Go module init,
config(port, env),127.0.0.1bind, 5-middleware stack (recoverer → request ID → logger → real IP → timeout),/healthz+/readyz, graceful shutdown (10s timeout, SIGTERM/SIGINT)1b — Route shell — All 25 routes registered under
/api/v1as501 Not Implementedstubs; subrouter layout (/events,/mux,/api/v1,/) with correct middleware applied per surface1c — Electron integration —
embed.FSstatic serving, Electron main process spawns + supervises daemon, health-check polling before renderer connects, dev proxy (Next.js:3000→ Go:3001), packaged build withextraResourcesSessions — list (with
?project,?active,?orchestratorOnly,?fresh), get, spawn, kill, message, send, restoreProjects — list, get, reload
Issues, backlog, PRs —
GET /issues,GET /backlog,POST /prs/:id/mergeMeta —
GET /version,POST /update,POST /webhooks/*Unclear routes remain explicit no-ops —
/remap,/patches,/orchestrators,/observability,/verify,/setup-labelsKey decisions (settled)
http.Handler-compatible, subrouters, standard middleware ecosystemlocalhost:3001— same-origin, no CORS, one token, one lifecycle/mux) only/api/v1; unclear routes ship as no-ops127.0.0.1only; default 3001; fail fast on conflictsignal.NotifyContext; 10s hard timeout; SSE connections just closed (EventSource auto-reconnects)/api/v1only)Open items
/api/v1versioning strategyembed.FScache-control headers/api/v1/filesystem/browse) — native machine FS design pending/muxfull design (mux semantics, framing, backpressure, auth on upgrade)Architecture overview
Open contract questions — for integration partners
LifecycleStoreadapter: does the storage layer expose what the Go daemon needs for session read-model? (Tom)/api/v1/issues+/api/v1/backlogneed to read? (adil)sessions,prs,ci) actually emit, and what are the payload shapes? (all lanes)Owner: @neversettle17-101