Skip to content

feat(sessionservice): surface container exit reason in reconcile#271

Open
tildesrc wants to merge 1 commit into
mainfrom
panopticon/reconcile-container-failure
Open

feat(sessionservice): surface container exit reason in reconcile#271
tildesrc wants to merge 1 commit into
mainfrom
panopticon/reconcile-container-failure

Conversation

@tildesrc

@tildesrc tildesrc commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds get_container_failure(task_id) to LocalRunner: uses docker inspect to read the exit code and docker logs --tail 20 to capture recent output, returning a human-readable detail string when the container exited non-zero, None otherwise.
  • Adds a no-op default for get_container_failure on the Runner ABC so StubRunner and other backends need no changes.
  • Modifies reconcile() in Spawner: when a claimed in-flight container is gone, checks get_container_failure first — reports FAILED with the detail if the exit was non-zero, falls back to clear_lifecycle (→ down) for a clean exit or already-removed container.
  • Pins all new behaviour in tests: three test_local_runner.py cases for the docker command sequence and return values; two new test_spawner.py reconcile cases for the FAILED vs clear-lifecycle branches.

🤖 Generated with Claude Code

When a container exits non-zero before registering (e.g. docker-in-docker
timeout, broken image layer), reconcile() now calls get_container_failure()
on the runner and reports FAILED with the exit code + last 20 log lines
instead of silently composing `down` with no context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant