cial/.claude/skills.src/cial:build
Eliot M 8505981889 feat(self-edit): make POST /api/v1/self/deploy synchronous
Old behaviour returned 202 with a deployId and expected the agent to
poll GET /deploy/:id — but that route lives on the Better-Auth-gated
deploy module, so localhost curl from inside the container got 401 on
every poll. The agent had no terminal signal and no log visibility,
matching the symptoms Eliot observed (stale-looking session, repeated
401s in core-back logs, no build output).

Mirror old-Cial's ergonomics: one synchronous request, blocks until
the build (and post-build restart) reach a terminal state, returns
{ ok, status, durationMs, exitCode, errorSummary, logTail } with HTTP
200 on success or 500 on failure. logTail is the last 8KB of the
deploy log file so the agent has the failure context inline without
needing a second round-trip.

- DeployService.waitForDone(deployId, timeoutMs): EventEmitter-based
  promise that resolves on the next 'done'/'cancelled' event for the
  given deployId, or immediately if the row is already terminal.
- DeployService.getLogPath(deployId) + DeployRepository.getLogPath:
  surface the persisted log_path for tail reading.
- self/router.ts: await waitForDone, read log tail, respond once.
- cial:build skills (restricted + unrestricted): drop the polling
  loop, document the synchronous response shape.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 14:44:47 +00:00
..
restricted.md feat(self-edit): make POST /api/v1/self/deploy synchronous 2026-04-29 14:44:47 +00:00
unrestricted.md feat(self-edit): make POST /api/v1/self/deploy synchronous 2026-04-29 14:44:47 +00:00