Fix: run exec-form commands as container Command (agent-server CrashLoop on OpenHands V1) - #11
Open
maiconfontana wants to merge 1 commit into
Open
Conversation
OpenHands V1 (app_server, e.g. 1.8.0) sends the sandbox command in exec form, e.g. ["/usr/local/bin/openhands-agent-server", "--port", "60000"]. The agent-server image ENTRYPOINT is ["tini","--","/usr/local/bin/openhands-agent-server"], so passing the command through as container Args ran `tini -- openhands-agent-server /usr/local/bin/openhands-agent-server --port 60000` -- the binary received its own path as a positional argument and aborted with "unrecognized arguments", CrashLoopBackOff. When the command starts with an absolute path (exec form), set it as the container Command so it replaces the image ENTRYPOINT and runs verbatim. Non-absolute multi-arg commands still pass as Args to the ENTRYPOINT, and single-string commands still run via `bash -c`. Co-Authored-By: Claude Fable 5 <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.
Problem
Running this runtime against OpenHands V1 (the
app_serverarchitecture, e.g. release1.8.0) fails: every sandbox pod goes intoCrashLoopBackOffand OpenHands times out withSandboxError: Sandbox failed to start within 120s.The
agent-servercontainer logs:Root cause
OpenHands V1 sends the sandbox command in exec form, e.g.:
The official
ghcr.io/openhands/agent-serverimage (1.27.0-pythonat the time of writing) has:createPodputs a multi-elementreq.Commandinto the container Args while leaving the image ENTRYPOINT in place, so the effective process is:The agent-server binary receives its own path as a positional argument and aborts.
Fix
When
req.Commandis in exec form (starts with an absolute path), set it as the container Command so it replaces the ENTRYPOINT and runs verbatim. Existing behaviors are preserved:update-ca-certificatesthenexec "$@");bash -c.One file,
pkg/k8s/client.go(+24 / -5).Testing
Verified end-to-end against OpenHands
1.8.0: with this change the sandbox pod starts,openhands-agent-serverserves on:60000, and the conversation advances pastWAITING_FOR_SANDBOX(no moreSandboxError). The currentagent-server:1.27.0-pythonENTRYPOINT was confirmed via the registry image config.Thanks for building this — glad to adjust the approach if you'd prefer a different shape.