Repository navigation
Sandbox / coder autonomous container recovery - #171
Merged
Merged
Conversation
Three independent fixes so the agent can survive corrupted podman state on a VPS without an operator on hand: 1. Sandbox manager: detect image-corruption stderr from podman (manifest unknown, blob unknown, layer corrupt, etc.) and auto-recover by force-removing the local image, re-pulling, and retrying. Applied at startup AND on health-check restart, so a corrupted image discovered mid-session no longer wedges every slot. Off switch: sandbox.image_recovery_enabled = false. 2. Coder manager: same image-corruption recovery on spawn_container, plus a startup sweep of stale springdrift-coder-* containers (matches the existing sandbox sweep), plus a piggy-backed health check on the janitor tick that drops idle dead containers from the pool so the next dispatch spawns fresh. 3. New sandbox_reset cog-loop tool — last-resort escape hatch that bypasses both manager actors and talks to podman directly, so it works even when a manager is itself stuck. Force-removes springdrift-sandbox-* and (optionally) springdrift-coder-* containers; with repull_image=true it also rmi+pulls the configured images. Only registered when sandbox_enabled = true. The auto-recovery in (1) and (2) is the load-bearing piece — it fires without the agent having to notice anything is wrong. (3) exists for the cases the heuristics miss. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three independent fixes so the agent can survive corrupted podman state on a VPS without an operator on hand. Originated from a real incident where a corrupted sandbox image left the agent stuck calling `request_human_input` — fine in dev, fatal on a VPS.
The auto-recovery in (1) and (2) is the load-bearing piece — it fires without the agent having to notice anything is wrong. (3) exists for the cases the heuristics miss.
Files
Test plan
🤖 Generated with Claude Code