docs(prd-0018): resolve TTY open question — keep exec -it
test / unit (pull_request) Successful in 18s
test / integration (pull_request) Successful in 1m3s

This commit is contained in:
2026-05-25 22:34:26 -04:00
parent 4760a09263
commit 3386cabe62
+13 -18
View File
@@ -310,25 +310,20 @@ existing prefix scan as a fallback for one release.
`tea pr create` users will already have. Assume v2; if v1 is
detected, die with a pointer to upgrade.
2. **Foreground vs detached + attach for the agent.** Two viable
shapes:
- **(a)** `docker compose up -d` everything, then
`docker attach claude-bottle-<slug>` for the agent's TTY.
- **(b)** `docker compose up -d` sidecars only, then a
separate `docker run` for the agent in the foreground using
the same project's networks (`--network claude-bottle-net-
<slug> --network claude-bottle-egress-<slug>`).
2. **How does `claude` reach the agent's TTY?** Decided: keep
today's `docker exec -it` model. Agent runs `sleep infinity`
under compose; `DockerBottle.exec_claude` runs
`docker exec -it claude-bottle-<slug> claude ...` exactly like
today. Compose owns the lifecycle (so `compose logs` includes
the agent's stdout, `compose down` tears it down), but the
user-facing exec model is unchanged. Rejected `docker attach`
because its default Ctrl-P-Ctrl-Q detach intercept buffers
keypresses Claude Code uses; rejected "agent outside compose"
because it gives up the unified `compose logs` view that
motivated the PRD.
(a) keeps the agent inside the compose project (so `compose ls`,
`compose logs`, `compose down` all see it). (b) avoids the
`docker attach` gotcha that `Ctrl-P Ctrl-Q` detaches without
tearing down, but loses the unified compose surface.
Leaning toward (a); flagging for review.
3. **TTY allocation under compose.** The agent needs `tty: true` +
`stdin_open: true` in the service stanza, and `docker attach`
has to be invoked with `-it`. Verify this works cleanly on
macOS Docker Desktop and Colima before committing.
3. ~~TTY allocation under compose.~~ Resolved by #2: no `tty:` /
`stdin_open:` on the agent service — interactivity is per-exec.
4. **`docker compose logs` ordering.** The dumped log file
interleaves services by timestamp. Confirm `--timestamps` is