Uh oh!
There was an error while loading. Please reload this page.
feat(providers): support sandbox provider attach lifecycle - #1242
Conversation
Closes#1171 Adds sandbox provider list, attach, and detach API/CLI support while keeping provider policy and credential resolution derived from current sandbox attachments.
Adds provider environment revisions and generation-scoped sandbox credential snapshots so future SSH and exec launches pick up provider attach, detach, and credential updates without mutating already-running processes. Also blocks provider deletion while attached to prevent stale sandbox provider references.
Label |
1 similar comment
Label |
johntmyers
commented
May 7, 2026
Smoke Test ResultsRan manual smoke tests against a local Docker-backed gateway ( Test 1: Create-time provider composition
Test 2: Post-creation attach + policy update
Test 3: Env reloading (credential placeholders in new processes)
Test 4: Detach removes policy rules + credential placeholders
Bonus: Provider delete guard
Environment
|
Label |
Summary
openshell sandbox provider list|attach|detach.Related Issue
Closes#1171
Changes
SandboxSpec.providers, validate provider existence on attach, and make attach/detach idempotent.UX Changes
New sandbox provider commands
openshell sandbox provider list [sandbox]sandboxis omitted, the CLI uses the last active sandbox, matching other sandbox read commands.openshell sandbox provider attach <sandbox> <provider>openshell sandbox provider detach <sandbox> <provider>Running sandbox behavior
Effective policy behavior
providers_v2_enabledis false, default behavior remains the existing provider functionality.providers_v2_enabledis true, the sandbox's effective policy is composed just-in-time from the current sandbox policy plus currently attached provider profiles.Provider lifecycle guardrail
openshell provider delete <provider>now fails while that provider is attached to any sandbox.Implementation Note: Object Write Locking
objectstable, and several gateway paths perform read-modify-write updates against those sandbox objects.Testing
RUSTC_WRAPPER= cargo check -p openshell-server -p openshell-sandbox -p openshell-cliRUSTC_WRAPPER= cargo test -p openshell-sandbox provider_credentials --libRUSTC_WRAPPER= cargo test -p openshell-server provider_env_revision_changes_when_attached_provider_record_changes --libRUSTC_WRAPPER= cargo test -p openshell-server delete_provider_rejects_attached_provider --libRUSTC_WRAPPER= cargo test -p openshell-server sandbox_config_and_provider_env_follow_attached_provider_lifecycle --libRUSTC_WRAPPER= cargo test -p openshell-server custom_imported_profile_policy_and_env_follow_attach_detach_lifecycle --libRUSTC_WRAPPER= cargo test -p openshell-server provider_environment_resolution_is_unchanged_by_providers_v2_setting --libRUSTC_WRAPPER= cargo test -p openshell-server scoped_access --libRUSTC_WRAPPER= cargo test -p openshell-sandbox provider_env_is_replaced_with_placeholders --libRUSTC_WRAPPER= cargo test -p openshell-cli sandbox_provider_subcommands_parse --bin openshellRUSTC_WRAPPER= cargo test -p openshell-cli provider_attachment_table_formats_provider_counts --libRUSTC_WRAPPER= cargo test -p openshell-cli --test provider_commands_integration sandbox_providerRUSTC_WRAPPER= cargo clippy -p openshell-server -p openshell-sandbox --lib --tests -- -D warningsuv run ruff format --check e2e/python/test_sandbox_providers.pyuv run ruff check e2e/python/test_sandbox_providers.pyRUSTC_WRAPPER= mise run pre-commitE2E note:
e2e/python/test_sandbox_providers.py::test_attach_detach_updates_credentials_for_later_exec_launchesfor live sandbox attach/detach behavior.openshell-sandboxbinary.Checklist