Skip to content

fix(sandbox): devops sandbox logs fails on a real Docker engine because the docker SDK's logs call takes no demux argument #2520

Description

@dan-petty

Problem

devops sandbox logs cannot read the logs of a sandbox from a real Docker engine. DockerEngineService.container_log_stream (src/devops_cli/docker/engine.py) calls container.logs(..., demux=True), and the docker SDK has no demux argument on logs. Every call raises TypeError, which the service turns into DockerEngineError("Container log stream failed: ..."). sandbox/engine.py _fetch_container_logs_raw is the only caller.

Evidence

  • docker-py 7.2.0 (the pinned version): ContainerApiMixin.logs(self, container, stdout=True, stderr=True, stream=False, timestamps=False, tail='all', since=None, follow=None, until=None) has no demux. Only exec_start and attach take demux.
  • Against a local Docker Engine 29.9.2 (API 1.56), on 2026-10-28: container.logs(stdout=True, stderr=True, stream=False, follow=False, tail="all", timestamps=False, demux=True) raised TypeError: ContainerApiMixin.logs() got an unexpected keyword argument 'demux'. The same call without demux returned b'out\nerr\n'.
  • The tests did not see it: tests/test_sandbox_logs.py::test_engine_logs_demux_stream_preservation gives the service a mock client that accepts any argument.
  • Found while building the Docker engine fake and its contract suite (refactor(infra): DockerEngineService is the Docker engine seam, with a shared in-memory engine fake and its contract suite #1316). The fake mirrors the SDK's logs signature, so a sandbox test that moves to the fake fails on this call.

Acceptance criteria

Key questions

  • Which SDK call keeps the two streams apart? attach(..., logs=True, demux=True) has no tail or timestamps. Two logs calls (stdout only, stderr only) lose the order between the streams. The design records the choice and the rejected options with evidence.

Activity

  1. added
    source/agent
    type/bug
    status/new
    value/high
    effort/low
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The code passes an unsupported keyword to the SDK, causing a TypeError on every real Docker engine call.
    • Priority: P1-High. devops sandbox logs is completely broken against any real Docker engine; every call raises TypeError.
    • Value: High. The command is non-functional for all users who run it against a real Docker engine.
    • Effort: Low. The fix replaces one SDK call with a supported alternative and updates one test; the design choice is small.
    • Related: refactor(infra): DockerEngineService is the Docker engine seam, with a shared in-memory engine fake and its contract suite #1316, which asks for a different change. Both work on DockerEngineService and sandbox logs, but the candidate fixes a production TypeError while 1316 builds the test fake and contract suite.
  3. added
    priority/p1-high
    on Oct 28, 2026
  4. added 2 commits that reference this issue on Oct 28, 2026
    e7216d5
    ef6e028
  5. removed
    status/new
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p1-highsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions