Files
ai-agent/sidecar/.gitignore
Gabriel Vidal b143d9a06f feat(ai-agent): spawn claude -p sessions from the home feed
Add a host-side FastAPI sidecar (services/ai-agent/sidecar/) that launches
`claude -p` natively as the repo owner — same ~/.claude auth, hooks and skills
as an interactive session. The ai-agent container reaches it over
host.docker.internal (behind a bearer token).

- backend: POST /api/spawn mints a session UUID, asks the sidecar to run
  `claude -p <prompt> --session-id <uuid> --output-format json`, seeds the
  conversation meta as running, and returns the id immediately.
- frontend: a SpawnBox pinned to the bottom of the Notifications home; the
  textarea grows on focus. On submit it starts the session, waits for the new
  transcript to sync into the viewer, then redirects to /conversation/<id>.
- compose: host.docker.internal:host-gateway + SIDECAR_URL/SIDECAR_TOKEN.
- sidecar/install.sh sets it up as a systemd --user service (uv venv).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 01:34:08 +02:00

26 B