From 3386cabe62c56afb6ebf76d39b092663e8c63c92 Mon Sep 17 00:00:00 2001 From: didericis Date: Mon, 25 May 2026 22:34:26 -0400 Subject: [PATCH] =?UTF-8?q?docs(prd-0018):=20resolve=20TTY=20open=20questi?= =?UTF-8?q?on=20=E2=80=94=20keep=20exec=20-it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/prds/0018-compose-per-instance.md | 31 +++++++++++--------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/docs/prds/0018-compose-per-instance.md b/docs/prds/0018-compose-per-instance.md index 279a719..9539a53 100644 --- a/docs/prds/0018-compose-per-instance.md +++ b/docs/prds/0018-compose-per-instance.md @@ -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-` 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- - --network claude-bottle-egress-`). +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- 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