Add agent binary pre-flight check and degraded pod diagnostics#47
Merged
Conversation
When a devcontainer image lacks the agent binary, the container
previously exited with a generic shell error 127. Add a command -v
check before the exec so the startup script exits with
devaipod-specific code 42 and a structured stderr message instead.
The binary name is parameterized via the format string ({agent_binary})
so the same pattern works for any future agent framework. Both the
primary agent and worker startup scripts include the check.
Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: arewm <arewm@users.noreply.github.com>
Inspect exited agent containers during pod cache refresh to detect known failure modes. Exit code 42 (agent binary not found) populates a new PodDiagnostics struct with a machine-readable code, message, and recovery suggestion, surfaced in the /api/devaipod/pods response. Container exit codes are also exposed via a new optional ExitCode field on UnifiedContainerInfo for frontend visibility. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: arewm <arewm@users.noreply.github.com>
Wire the new diagnostics field through to PodInfo and render a warning banner with the error message and recovery suggestion when present. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: arewm <arewm@users.noreply.github.com>
cgwalters
approved these changes
Apr 7, 2026
|
|
||
| // Docker connection for inspecting exited agent containers (exit codes). | ||
| // This reuses the same socket but needs its own connection since the | ||
| // enrichment future consumed its one. |
Owner
There was a problem hiding this comment.
Hmm but presumably we could avoid consuming it
arewm
added a commit
to arewm/devaipod
that referenced
this pull request
Apr 7, 2026
…n test Address PR cgwalters#47 review feedback: create the bollard Docker connection once before the enrichment future and reuse it for exit-code inspection, rather than opening a redundant second connection afterward. Add an integration test that exercises the full diagnostics pipeline by creating a pod without mock-agent mode so the agent container hits the pre-flight check (exit 42). This required adding start_without_mock() and create_pod_expect_degraded() to DevaipodHarness. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: arewm <arewm@users.noreply.github.com>
arewm
added a commit
to arewm/devaipod
that referenced
this pull request
Apr 14, 2026
…n test Address PR cgwalters#47 review feedback: create the bollard Docker connection once before the enrichment future and reuse it for exit-code inspection, rather than opening a redundant second connection afterward. Add an integration test that exercises the full diagnostics pipeline by creating a pod without mock-agent mode so the agent container hits the pre-flight check (exit 42). This required adding start_without_mock() and create_pod_expect_degraded() to DevaipodHarness. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: arewm <arewm@users.noreply.github.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.
When a devcontainer image lacks the agent binary (e.g. opencode), the
agent container exits with shell error 127 and the UI shows "agent down"
with no explanation.
This adds a three-layer diagnostic pipeline:
Startup script:
command -vcheck beforeexec-ing the agentbinary. If missing, exits with devaipod-specific code 42 and a
structured error message to stderr. The binary name is parameterized
via format string so the pattern works for any agent framework.
Backend: During pod cache refresh, exited/degraded agent containers
are inspected via bollard. Exit code 42 populates a
PodDiagnosticsstruct (code, message, suggestion) in the unified pod list response.
Frontend: Diagnostic banner on pod cards shows the error and
suggests recreating with the dotfiles devcontainer or a different image.