Skip to content

Workflow: Explicit sandbox image semantics - #134

Closed
robbycochran wants to merge 1 commit into
mainfrom
batch3-pr
Closed

Workflow: Explicit sandbox image semantics#134
robbycochran wants to merge 1 commit into
mainfrom
batch3-pr

Conversation

@robbycochran

Copy link
Copy Markdown
Collaborator

Summary

Establish explicit semantics for sandbox image resolution in Harness workflows:

  • Standardize image specification and override behavior across all execution contexts
  • Define clear precedence order for image selection (environment → explicit → versioned defaults)
  • Align with validated sandbox image architecture and Agent Runtime Contract (ARC)
  • Enable migration path to standardized container images across agent ecosystem

Validation Status

  • Branch created from main
  • Commit cherry-picked to batch3-pr
  • Git status clean (changes staged and committed)
  • Documentation added to cmd/sandbox_image.go
  • Push to origin successful
  • No pre-commit hook failures
  • Full integration tests pending
  • Review and acceptance pending

Files Changed

  1. cmd/sandbox_image.go (37 insertions)
    • Added comprehensive documentation to resolveSandboxImage() function
    • Explicit documentation of 3-level precedence order
    • Documentation of Agent Runtime Contract (ARC) requirements
    • Added documentation to versionedImage() with example outputs

Image Resolution Precedence

  1. HARNESS_OS_IMAGE environment variable (highest priority)

    • Operator override for all contexts
    • Enables local development and CI debugging
  2. spec.sandbox.image explicit field (workflow-level)

    • Per-workflow image override
    • Used when environment variable not set
  3. versionedImage("sandbox") default (fallback)

    • Versioned base image reference
    • Ensures stable, reproducible defaults

Execution Context Support

The documented semantics support:

  • Local OpenShell - uses active gateway, environment-based overrides
  • HyperShell Personal - user-authenticated gateway, explicit image selection
  • HyperShell Service-Account - constrained OIDC access, consistent image defaults

Risks & Mitigations

  • Integration impact: Changes affect all sandbox execution contexts
    • Mitigation: Documentation makes precedence explicit; no behavior changes
  • Backward compatibility: Existing image resolution must not change
    • Mitigation: Only added documentation, no code logic changes
  • Registry access: Validated image migration depends on quay.io/redhat-ai availability
    • Mitigation: Current implementation uses quay.io/rcochran/openshell; can migrate later
  • Cold-start timing: Thin-flavor architecture documentation may enable performance variance
    • Mitigation: ARC documents consistent runtime contract for all images

Not Included (Future Batches)

  • Provider or model image overlays
  • Image caching strategy optimization
  • Registry authentication changes
  • Agent-specific image defaults
  • Inline secrets or credential handling
  • Image build and distribution pipeline changes

Add comprehensive documentation to resolveSandboxImage and versionedImage
functions, making the image selection precedence explicit:

1. HARNESS_OS_IMAGE environment variable (operator override)
2. agentImage parameter (workflow spec.sandbox.image)
3. versionedImage() default (version-stamped fallback)

This clarifies the semantics for sandbox image resolution across all
execution contexts: local OpenShell, HyperShell personal access, and
HyperShell service-account modes. Documents the Agent Runtime Contract
(ARC) requirements that resolved images must satisfy.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@robbycochran

Copy link
Copy Markdown
Collaborator Author

Superseded by #136, which consolidates this change (and the other three batch drafts) into a single PR against main.

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