Skip to content

fix(sandbox): validate runtime command before launch — reject empty commands#3957

Open
Karry2019web wants to merge 1 commit into
orchestration-agent:mainfrom
Karry2019web:fix/sandbox-runtime-command-validation-9437
Open

fix(sandbox): validate runtime command before launch — reject empty commands#3957
Karry2019web wants to merge 1 commit into
orchestration-agent:mainfrom
Karry2019web:fix/sandbox-runtime-command-validation-9437

Conversation

@Karry2019web
Copy link
Copy Markdown

Summary

Validates that the command list is non-empty before mutating the agent state to STARTING. Previously, an empty command would cause subprocess.Popen to raise an OSError after state had already been set, resulting in inconsistent recovery.

Changes

  • src/agent/runtime.py: AgentRuntime.start() now validates command is a non-empty list upfront. If empty, it raises ValueError immediately — before any state mutation or process creation.

Acceptance Criteria

  • ✅ Empty commands are rejected before state is set to STARTING
  • ✅ State remains STOPPED when validation fails
  • ✅ Existing tests continued to pass
  • ✅ Behavior is clearly documented by the validation guard

Verification

# Before: empty command changes state -> Popen raises -> CRASHED
# After:  empty command is rejected immediately with ValueError

Fixes #3939

…ommands

Validates that the command list is non-empty before mutating the
gent state to STARTING. Previously, an empty command would cause
Popen to raise an OSError after the state had already been set.

Fixes orchestration-agent#3939
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