Skip to content

fix(cli): sandbox get returns currently active runtime policy - #880

Merged
TaylorMutch merged 3 commits into
mainfrom
tmutch/include-runtime-policy-revision-sandbox-get-output
Apr 20, 2026
Merged

fix(cli): sandbox get returns currently active runtime policy#880
TaylorMutch merged 3 commits into
mainfrom
tmutch/include-runtime-policy-revision-sandbox-get-output

Conversation

@TaylorMutch

@TaylorMutchTaylorMutch commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the root cause described in #837: openshell sandbox get now fetches the effective runtime policy via GetSandboxConfig for all output modes — including hot-reloaded updates and gateway-global overrides. The base output also surfaces the policy source (sandbox or global) and revision number, so callers no longer need to stitch together sandbox get and policy get --full output.

A --policy-only flag is also added for scripting workflows:

openshell sandbox get my-sandbox --policy-only > current.yaml
# edit current.yaml, then:
openshell policy set my-sandbox --policy current.yaml --wait

Related Issue

Fixes#837

Changes

  • sandbox get now always calls GetSandboxConfig to retrieve the active runtime policy (replaces creation-time spec lookup)
  • Base output now includes Policy source (sandbox/global) and Revision fields
  • Added --policy-only flag to openshell sandbox get; when set, prints only the active policy YAML to stdout
  • Added sandbox_get_policy_only_round_trip integration test; updated get_sandbox_config mock to return a real SandboxPolicy
  • Updated CLI reference docs and docs/sandboxes/manage-sandboxes.mdx with the new flag and updated output

Testing

  • mise run pre-commit passes
  • Unit tests added/updated (sandbox_get_policy_only_round_trip)
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@TaylorMutchTaylorMutch self-assigned this Apr 17, 2026
@copy-pr-bot

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@TaylorMutchTaylorMutch added the test:e2e Requires end-to-end coverage label Apr 17, 2026
@TaylorMutch
TaylorMutchforce-pushed the tmutch/include-runtime-policy-revision-sandbox-get-output branch from a632319 to 19be372CompareApril 20, 2026 15:51
@TaylorMutch
TaylorMutchforce-pushed the tmutch/include-runtime-policy-revision-sandbox-get-output branch from 19be372 to 3a7b177CompareApril 20, 2026 16:42
@github-actions

Copy link
Copy Markdown

@TaylorMutchTaylorMutch changed the title feat(cli): show active runtime policy when retrieving sandboxfeat(cli): add --policy-only flag to sandbox getApr 20, 2026
@TaylorMutchTaylorMutch changed the title feat(cli): add --policy-only flag to sandbox getfix(cli): sandbox get now shows live runtime policy with source and revisionApr 20, 2026
@TaylorMutchTaylorMutch changed the title fix(cli): sandbox get now shows live runtime policy with source and revisionfix(cli): sandbox get returns currently active runtime policyApr 20, 2026
@TaylorMutch
TaylorMutch marked this pull request as ready for review April 20, 2026 17:27
@TaylorMutch
TaylorMutch requested a review from a team as a code ownerApril 20, 2026 17:27
@TaylorMutch

Copy link
Copy Markdown
CollaboratorAuthor

I have read the DCO document and I hereby sign the DCO.

@TaylorMutch
TaylorMutch merged commit 9ac725f into mainApr 20, 2026
12 of 13 checks passed
@TaylorMutch
TaylorMutch deleted the tmutch/include-runtime-policy-revision-sandbox-get-output branch April 20, 2026 23:44
@miyoungcmiyoungc mentioned this pull request Apr 27, 2026
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2eRequires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: include runtime policy revisions in sandbox get output

3 participants

@TaylorMutch@johntmyers@kirit93