Repository navigation
cli: add an unattended execution contract - #815
Open
reinainblood wants to merge 1 commit into
Open
reinainblood wants to merge 1 commit into
reinainblood wants to merge 1 commit into
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
This was referenced Aug 31, 2026
reinainblood
marked this pull request as ready for review
September 4, 2026 02:20
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
This adds an opt-in
openhands runcommand for callers that need a fullyunattended process contract, while leaving the existing TUI and
--headlessbehavior unchanged.Concrete downstream consumer and end-to-end validation:
harbor-framework/harbor#3009
(ready for review; merge remains blocked on this PR, with Modal V2 validated downstream).
The command:
LLM_API_KEYandLLM_MODELprocess configuration anddoes not load a workspace
.envfile;--offline/--no-public-skillsso startup does not clone thepublic extensions repository;
events.jsonlwhile the SDK alsopersists individual conversation events continuously;
run.json, including while the run is active;and terminal artifacts even when a provider request does not stop
cooperatively; and
2), configuration (3), provider (4), agent (5),and internal CLI (
6) failures.Why
The existing headless mode is useful for humans invoking a one-off task, but
benchmark and CI harnesses need a stronger boundary: fresh-home execution with
no TTY, no surprise startup fetches, an explicit workspace, incremental
machine-readable output, partial crash evidence, and trustworthy exit status.
This is also a concrete follow-up to #147 and the unresolved offline startup
failure reported in #483. I kept the new behavior opt-in because existing users
may depend on the current Textual-backed headless output.
I noticed that this repository was recently marked as no longer actively
maintained. A downstream Harbor adapter is being built against this exact
public command, but I would appreciate maintainer guidance on whether this CLI
repository remains the right home for the execution surface or whether it
should move elsewhere in the current OpenHands architecture.
Reproduction evidence
Released
openhands==1.16.0was installed into a fresh Python 3.12 Linux imageand exercised with stdin from
/dev/null, no TTY, a fresh HOME, and adeterministic OpenAI-compatible endpoint:
1; no run artifact0; JSONL and SDK session events persisted (the endpoint intentionally made no tool call)137)137)The new command was then built from this branch and run in a disposable Linux
container with GitHub mapped to an unavailable address after installation:
0; requested file created; 5 persisted SDK events; stdout exactly matchedevents.jsonl; zero public-skills paths3;configuration_errorsummary andrun.failedrecord4;provider_error,ConversationErrorEvent, andrun.failedrecord143; atomicinterruptedsummary, 3 partial SDK events, and final interrupt recordThe deterministic endpoint uses a real HTTP transport and the real OpenHands
SDK execution path; it is not used as a substitute for downstream live-model
benchmark validation.
Verification
make lintmake test(1,366 passed)make test-binary(3 passed; existing pytest warnings only)pycodestyle, Pyright)
Compatibility
Existing
openhands,openhands --headless, ACP, web, cloud, and GUI commandpaths are unchanged. The new command creates a fresh runtime agent from process
environment values, ignores persisted agent settings, disables the critic, and
uses the SDK's existing process workspace rather than introducing Docker or
another sandbox.
This PR was prepared by Codex on behalf of Kirsten Ruge.