Skip to content

Keep no Docker daemon log of agent containers (#165) - #190

Merged
mchwang merged 5 commits into
mainfrom
fix/165-agent-log-driver
Oct 21, 2026
Merged

mchwang merged 5 commits into
mainfrom
fix/165-agent-log-driver

Conversation

@mchwang

@mchwang mchwang commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #165

What changes

  • Agent containers are created with --log-driver=none (agents/container/profile.ts). The supervisor already reads the agent's output only through docker start --attach and bounds it there. With the default driver, the daemon also kept its own copy, which a fast writer could grow before the supervisor stopped the container. Now the daemon keeps none.
  • validateContainer (agents/container/run.ts) refuses a container unless keepsNoDaemonLog(HostConfig.LogConfig) holds before it starts: driver none, and only cache--prefixed options. A daemon copies its own cache-* log options into every container whatever the driver (moby v27.4.0 logcache.MergeDefaultLogConfig), and with none no logger or cache starts.
  • Choice recorded (issue acceptance): none, not local with max-size/max-file. Nothing reads the daemon's log (no docker logs, no reattach). The design table and the T9 gate table record it.

Scope

Agent containers only, as the issue's title says. The runner's own task-storage script containers (docker run --rm in agents/container/storage.ts) keep the daemon's default log until they exit. The client bounds what it reads from them. The docs say so. This could be a follow-up.

Tests

  • Real Docker (test/agent-container.test.ts):
    • "creates the agent container with no Docker daemon log": docker inspect of the created container shows driver none and the rule holds.
    • "refuses an agent container with %s before it starts": a json-file log and a bounded local log are refused.
    • Every existing probe that returns output shows that attach still delivers it under none.
  • Unit (test/agent-daemon-log.test.ts): the rule for configurations that only the API can set. The CLI refuses --log-opt with none, but the daemon stores whatever the API gives (checked on Docker 27.4.0).
  • npm run typecheck passes.
  • Real Docker runs in CI's real-docker job. No real-Docker suite was run locally; only one-off throwaway containers were used, to check CLI and API behaviour.

Review record

Base aced300 for every round. Each independent round was a fresh general-purpose agent with no shared context, reviewing the full diff.

Round Reviewer Head Findings What changed
Self author d640ae2 Dropped a refusal case for "the daemon's default driver", which would wrongly pass on a daemon whose default is none in d640ae2
1 independent agent d640ae2 Minor: a daemon copies its cache-* log options into every container, so an exact "no options" check would refuse every agent on such a host. Minor: the "no options" half of the check was untested. Scope note: other containers keep the default log e952276: keepsNoDaemonLog allows cache-* keys; unit cases cover options only the API can set
2 independent agent e952276 Minor: the inspect test demanded Config: {}. Minor: the unit test ran only in the Docker project. Minor: scope missing from docs. Nits: comment wording; an always-true created status check. Declined: none dd67147
3 independent agent dd67147 Nits: the test name said "before it starts" but it checks validation; a log-lifetime wording 20430ce
4 independent agent 20430ce Minor: the docs scope list missed the keeper and the egress proxy. Nit: "unbounded" assumed json-file defaults 362fe8f
5 independent agent 362fe8f CLEAN. It confirmed the CLI refusal and the API acceptance on Docker 27.4.0, and that attach delivers stdout and stderr with none —
Copilot Copilot 362fe8f Requested after the clean round 5. No open issues. Its summary-only concern was that the real-Docker result and the exact-head review evidence were unconfirmed Answered under "Validation at the reviewed head" below. No code change

Validation at the reviewed head (362fe8f, base aced300):

  • real-docker (Agent isolation) passed in 21m57s, run 39525946071. It ran the new real-Docker tests in test/agent-container.test.ts.
  • test (CI) is pending.
  • Locally, npm run typecheck passes and test/agent-daemon-log.test.ts passes.
  • The clean independent pass for this exact base/head pair is round 5 above.

Review lessons (merge gate):

  • The cache-* copy (round 1) is covered by CLAUDE.md, "Review readiness": where the versions or setups the code meets answer differently, the code must not depend on that answer.
  • The untested half of the check (rounds 1 and 2) is covered by "Treat every behavioural claim … give it a test that fails if the claim is false".
  • The rest were one-off wording and doc fixes.
  • Copilot's evidence concern is covered by CLAUDE.md, "Before requesting automated Copilot review, report the current head, CI state…": this record now gives the head's CI.

🤖 Generated with Claude Code

mchwang and others added 5 commits October 20, 2026 17:52
The supervisor reads an agent's output through `docker start --attach` and
bounds it there. Agent containers now use `--log-driver=none`, so the daemon
keeps no copy that a fast writer could grow before the supervisor stops the
container, and validation refuses a container with any other log setting
before it starts.

Closes #165

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…165)

Review round 1: a daemon copies its own cache-* log options into every
container, so an exact empty-options check would refuse every agent on such a
host. The rule is now keepsNoDaemonLog, with unit cases for the options only
the API can set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…165)

Review round 2: the inspect test accepts the daemon's cache-* options as the
validator does; the rule's unit test runs in the parallel project
(agent-daemon-log); docs record that only agent containers are covered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 3 nits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mchwang
mchwang marked this pull request as ready for review October 21, 2026 01:28
@mchwang
mchwang requested a balanced review from Copilot October 21, 2026 01:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Real-Docker validation results and the required exact-head independent-review evidence remain unconfirmed.

No open issues 🎉

What changed in this PR

Disables Docker daemon logging for agent containers, addressing #165 while preserving the supervisor’s bounded output capture.

Changes:

  • Creates agent containers with --log-driver=none and validates that configuration before launch.
  • Adds unit and real-Docker regression tests.
  • Documents the logging choice and its agent-container-only scope.
File Description
test/​agent-daemon-log.test.ts Tests accepted and rejected logging configurations.
test/​agent-container.test.ts Adds real-Docker inspection and rejection tests.
docs/​implementation/​plan-library-alignment.md Records #165’s resolution and scope.
docs/​implementation/​agent-isolation.md Documents the logging isolation requirement and coverage.
docs/​designs/​codeboost-plan-indexed-review.md Records the no-daemon-log design choice.
agents/​container/​run.ts Validates logging configuration before launch.
agents/​container/​profile.ts Sets --log-driver=none for agent containers.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bound the Docker daemon log of agent containers

2 participants