docs(prd-0018): resolve TTY open question — keep exec -it
This commit is contained in:
@@ -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
|
`tea pr create` users will already have. Assume v2; if v1 is
|
||||||
detected, die with a pointer to upgrade.
|
detected, die with a pointer to upgrade.
|
||||||
|
|
||||||
2. **Foreground vs detached + attach for the agent.** Two viable
|
2. **How does `claude` reach the agent's TTY?** Decided: keep
|
||||||
shapes:
|
today's `docker exec -it` model. Agent runs `sleep infinity`
|
||||||
- **(a)** `docker compose up -d` everything, then
|
under compose; `DockerBottle.exec_claude` runs
|
||||||
`docker attach claude-bottle-<slug>` for the agent's TTY.
|
`docker exec -it claude-bottle-<slug> claude ...` exactly like
|
||||||
- **(b)** `docker compose up -d` sidecars only, then a
|
today. Compose owns the lifecycle (so `compose logs` includes
|
||||||
separate `docker run` for the agent in the foreground using
|
the agent's stdout, `compose down` tears it down), but the
|
||||||
the same project's networks (`--network claude-bottle-net-
|
user-facing exec model is unchanged. Rejected `docker attach`
|
||||||
<slug> --network claude-bottle-egress-<slug>`).
|
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`,
|
3. ~~TTY allocation under compose.~~ Resolved by #2: no `tty:` /
|
||||||
`compose logs`, `compose down` all see it). (b) avoids the
|
`stdin_open:` on the agent service — interactivity is per-exec.
|
||||||
`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.
|
|
||||||
|
|
||||||
4. **`docker compose logs` ordering.** The dumped log file
|
4. **`docker compose logs` ordering.** The dumped log file
|
||||||
interleaves services by timestamp. Confirm `--timestamps` is
|
interleaves services by timestamp. Confirm `--timestamps` is
|
||||||
|
|||||||
Reference in New Issue
Block a user