Repository navigation
feat(openshell-provider): launch sandboxes from a generic launch - #13157
Merged
Merged
Conversation
…refs Provider types identify each other through separately passed strings, such as a sandbox's workspace name, so OpenTofu cannot check that the pieces belong to one object or say which resource type they came from. The provider redesign in #13131 replaces these with a computed `ref` object on the producing type and an object input on the consumer. Definitions gain `exports` and `references`. The structured adapter derives `ref` from the row, so backends never see it, and parts the row does not know yet stay unknown. A reference input is one object attribute whose declared attributes travel to the backend as row fields; its `type` must match the exporting type, because OpenTofu drops object attributes a consumer does not declare and would otherwise accept a ref of another type with matching fields. A changed ref replaces its consumer when the carried fields are immutable, and plans report the reference attribute as the replacement path. The fixture provider gains a ref-exporting workspace and a ref-taking sandbox. Unit tests cover the schema, planning with known and unknown refs, type checks, and refresh. A contract test through OpenTofu 1.12.6 covers create, an unchanged plan, replacement propagating to the consumer, and rejecting a ref of another type.
OpenShell profiles, registrations, and sandboxes named their workspace, scoped profile, and provider registrations with separate strings, so OpenTofu could not check that each name meant an object of the right type. Each OpenShell resource now exports a computed `ref`. Profiles, registrations, and sandboxes take `workspace` as a workspace ref, registrations take an optional `profile` ref in place of `profile_name`, and sandboxes take `providers`, a list of registration refs, in place of `provider_names`. The framework gains list references and a schema version; these schemas move to version 1, so OpenTofu rejects state from the earlier schema rather than upgrading it, and the SDK record version moves to 8 with a message pointing to the original release for recovery or teardown. The SDK compiler emits ref expressions, and `nemoclaw_openshell::flatten` turns refs in state, plans, and planned values back into the row fields the SDK compares. Sandbox readiness reads the workspace from the sandbox ref. Regenerated the OpenShell contract fixtures and schema snapshot, and updated the hand-written contract HCL and provider docs. Closes #13141. Part of #13131.
The openshell and fabric providers took one gateway connection in provider configuration, so a fresh deployment had to defer configuring the provider until the gateway existed, and every object in a graph had to share that one connection. `data.openshell_gateway` now takes the endpoint and the names of the credential and mutual-TLS variables, and exports them as a `ref`. Every OpenShell object, `fabric_agent_configuration`, and `fabric_sandbox_readiness` takes `gateway` as that ref; provider configuration keeps only `destroy`. Clients are cached per connection. The framework gains carried fields: inputs a backend uses without observing, which refresh and apply keep from the recorded or desired row. Objects carry their gateway connection that way, so refresh and removal reach the same gateway without provider configuration, and backends see rows without it. Credential and TLS references rotate in place; another endpoint is another gateway, so retained and stateful objects refuse it. The Fabric configuration schema moves to version 1. The SDK emits the gateway connection on the data source and `gateway = data.openshell_gateway.current.ref` on objects, carries the connection in target rows so state comparisons hold, and gives teardown graphs, which read no data sources, the same ref as a literal object. Closes #13142. Part of #13131.
The OpenShell provider parsed Fabric's runtime binding to start each sandbox: it required `agent_runtime` to be `fabric`, built the command and environment from the binding, and merged the image runtime's policy and executables into the sandbox policy. OpenShell depended on Fabric. Sandboxes now take `launch_json`: a command, environment, the policy used when none is authored, the executables managed grants allow, and opaque metadata. OpenShell merges that policy with the authored policy and managed grants, records the launch in an annotation, and compares it on refresh. `agent_name`, `agent_runtime`, and `runtime_json` are gone, and so are the checks that the runtime is Fabric. `fabric_capabilities` returns `launch_json` for its configured agent; Fabric records the agent name and runtime binding in the launch metadata and reads them back for configuration, readiness, and the bridge. The bridge refuses a binding that differs from the launch the sandbox records, which the gateway checks against the live sandbox. OpenShell schemas move to version 2 and the SDK record to version 9. Part of #13143. Part of #13131.
# Conflicts: # crates/fabric-provider/src/sandbox_readiness.rs # crates/fabric-provider/tests/contract/fixtures/main.tf # crates/nemoclaw-sdk/src/state/mod.rs # crates/openshell-provider/src/lib.rs # crates/openshell-provider/tests/contract/fixtures/explicit-policy.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-claude.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-codex.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-hermes.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-mini-swe-agent.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-nooa-bench.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-nooa.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-openclaw.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-pi.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric-remote-agent.tf.json # crates/openshell-provider/tests/contract/fixtures/fabric.tf.json # crates/openshell-provider/tests/contract/fixtures/hermes-auth.tf.json # crates/openshell-provider/tests/contract/fixtures/hermes-interfaces.tf.json # crates/openshell-provider/tests/contract/fixtures/inference-tuning.tf.json # crates/openshell-provider/tests/contract/fixtures/inline-inference.tf.json # crates/openshell-provider/tests/contract/fixtures/local.tf.json # crates/openshell-provider/tests/contract/fixtures/multiple-models.tf.json # crates/openshell-provider/tests/contract/fixtures/multiple-providers.tf.json # crates/openshell-provider/tests/contract/fixtures/multiple-sandboxes.tf.json # crates/openshell-provider/tests/contract/fixtures/openclaw-dashboard.tf.json # crates/openshell-provider/tests/contract/fixtures/openclaw-web-search.tf.json # crates/openshell-provider/tests/contract/fixtures/tavily-web-search.tf.json # crates/openshell-provider/tests/contract/standalone/main.tf # crates/openshell-provider/tests/schema.txt # docs/provider.md
Contributor
Convert the sandbox state row through fabric_binding before calling the Fabric bridge, matching the generic launch contract.
cv
added a commit
that referenced
this pull request
Oct 14, 2026
Closes #13143 (with #13157). Part of #13131. Stacked on #13157. ## Failure Fabric images were read only through `fabric_capabilities`, which takes a whole agent configuration and returns a catalog assessment. No data source named a single harness, so there was no typed source a sandbox could take its launch from, and the type's name didn't match what it lists. ## Decision - `fabric_capabilities` is renamed `fabric_harnesses`: the catalog listing and compatibility assessment, unchanged in behavior. Rust module paths keep their names. - New `fabric_harness` data source: selects one harness by `image` and `adapter_id`, returns the `launch_json` that starts it for `agent_name`, and exports a `ref` with `type = "fabric_harness"`, `adapter_id`, and `image`. It reuses the catalog read and fails when the image installs no runtime for the adapter. - The SDK keeps compiling sandboxes from `fabric_harnesses` (now under that name). Switching the compiled graphs to `fabric_harness`, and adding the Fabric revision and contract version to its ref, can follow with the typed `fabric_agent` work (#13144). ## Validation - New unit test: a harness selects the Pi adapter from a fixture image, launches the named agent with the adapter's executables, exports its ref, and rejects an adapter the image doesn't install. - Regenerated the OpenShell contract fixtures and Fabric schema snapshot; updated docs. - `cargo ci` passed locally on linux_arm64, including all 138 contract and system tests.
Closed
8 tasks
cv
added a commit
that referenced
this pull request
Nov 11, 2026
Brings the platform guides under `docs/` in line with `v1` at `637bdb6276`: they now name that revision and OpenShell 0.1.7, publish the generated configuration reference instead of a stale snapshot, restore guide text that the reorganization dropped, and correct what they say about policy changes, OpenShell resource schemas, and onboarding. ## Problem The reorganization in #14195 pinned the guides to `86b8d94273` and still describes that revision, 114 commits behind `v1`: - The published "YAML Configuration Reference" is a hand-kept snapshot of the generated reference at `86b8d94273`. It predates the typed application container options (#14166), network middleware bindings, the dropped Deep Agents Code harness, and the multi-GPU fields, and says that `docs/reference/configuration.md` differs from it on three field types. - The guides name OpenShell 0.1.6 and link its `ac7f615` sources, while `versions.json` pins 0.1.7 (`5d25211b`, #14245). #14245 left this for the next refresh of the inspected revision. - #14195 was written at `86b8d94273` and merged after #14186, #14132, and #14166, so it overwrote their guide changes: the `agents` field with each agent's runtime ID, the OIDC sign-in details for a managed Kubernetes gateway, and the application container example. - `docs/security/sandbox-network.md` and `docs/security/security.md` say apply rejects a policy change that needs a new sandbox. Since #13375, a changed sandbox specification, policy included, replaces the sandbox, as the same page's recovery section and `docs/build-deploy/usage.md` already say. - `docs/references/provider.md` says the OpenShell resource schemas are version 1; they're version 2 since #13157. - `docs/references/cli.md` says onboarding needs a verified bundle to read the target; since #12579 it reads the target directly, with no bundle or OpenTofu. - `docs/references/fabric-harnesses.md` says onboarding offers every catalog harness; since #14233 it offers OpenClaw and Hermes, and keeps a template's other harness as the suggestion. - The troubleshooting table lacks the errors that #14141 and #14133 added for retained gateway storage owned by another state directory and a missing kubeconfig context. ## Change - **Revision:** `docs/README.md`, the architecture overview, the container services page, and the first-deployment tutorial and its prerequisites now name `637bdb6276`, with OpenShell 0.1.7 and `5d25211b` from its `versions.json`. Links to NemoClaw sources at the old revision become repository-relative links, and the two test fixtures they named moved to `crates/nemoclaw-e2e/tests/integration/rust/`. - **OpenShell links:** every OpenShell link in these pages moves from `ac7f615` to `5d25211b`. The line ranges for the Docker, Podman, and Kubernetes proxy settings in OpenShell's `configuration.mdx` are recomputed for the new file; they cover the same blocks. - **Field reference:** `fern/pages.json` publishes `docs/reference/configuration.md`, which `cargo run -p nemoclaw-build -- schema` generates and CI checks, and `docs/references/v1-configuration.md` is removed. Links to it, including one in `docs/agents-inference/inference.md` and one in the user-guide skill, point at the generated reference. Refreshing the snapshot instead would keep a hand-copied file that goes stale with the next schema change. - **Restored from #14186:** the tutorial and the headless OpenClaw example in `docs/agents-inference/agents.md` read the runtime ID from `nemoclaw plan -o json` instead of `terraform.tfstate`; `docs/references/cli.md` lists the `agents` field and the **Agents** text; `docs/references/sdk.md` names `agents` in plan and apply results (`OperationResult::agents`). - **Restored from #14132:** the OIDC steps in `docs/build-deploy/kubernetes.md` cite the manual run in #14131 and describe the CLI's `http://127.0.0.1:<port>/callback` redirect and `SSL_CERT_FILE` trust, and the matching row in `docs/resources/limits.md` no longer says the steps never ran. OpenShell 0.1.7's `oidc_auth.rs` still builds that redirect. - **Restored from #14166:** `docs/build-deploy/usage.md` links `examples/application-container.yaml`. - **Policy changes:** both security pages and the change table in `usage.md` say a policy change replaces the sandbox, deleting its files and conversations (except on mounted volumes), the wording of #14141's CLI warning; `openshell_sandbox` has no mutable fields (`crates/openshell-provider/src/lib.rs`). - **Schema version:** `docs/references/provider.md` says version 2, as `crates/openshell-provider/tests/schema.txt` records, and drops the repeated sentence. - **Onboarding:** `docs/references/cli.md` says onboarding reads the target without a bundle (`nemoclaw_onboarding::author`) and that the saved file holds only authored values, a sentence #13978 added to the tutorial before #14195 replaced onboarding there with a copied example. - **Onboarding harnesses and troubleshooting:** `fabric-harnesses.md` names the harnesses onboarding offers and drops a past rehearsal list; the troubleshooting table gains rows for the two errors above, with their messages from `gateway_storage.rs` and `observation.rs`. - **Smaller fixes:** `tls: terminate` and `passthrough` are rejected by OpenShell 0.1.7 (its `l7/mod.rs` is unchanged from 0.1.6); OpenShell 0.1.7 still keeps GPU filesystem additions local to the workload (`boundary_server.rs`); `interfaces.md` points to the prerequisites for the tutorial's OpenShell version; `migration.md` links the onboarding guide; the internal evidence pages record that this change removed the snapshot; the prerequisites table no longer limits non-OpenClaw, non-Deep Agents images to ARM64, which `docker-bake.hcl` and `docs/build-deploy/build.md` contradict. Checked against the code and left unchanged: the Kubernetes namespace binding after #13756 (`operations.rs` binds an existing namespace by UID), agent replacement rules (`fabric-provider/src/agent.rs`), state paths and Fabric adapter pins in `docs/build-deploy/state.md` (`f33fa19a`, as `versions.json`), the harness table and its examples, CLI options against `args.rs`, SDK signatures and timeouts, provider versions, the 32-sandbox and 32-provider limits, the multi-GPU limit (#14384 is open, and `container.gpuDevices` still takes one entry), the compatibility page's state-version error, and the threat model. ## Beyond CI - The first-deployment tutorial hasn't been rerun at `637bdb6276`; its commands were checked against the CLI parser, `examples/openclaw.yaml`, and the result types. - The OIDC `SSL_CERT_FILE` behavior was observed in #14131 with OpenShell 0.1.6 and hasn't been rechecked with 0.1.7.
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.
Part of #13143 (the
fabric_harnessdata sources follow in the next PR). Part of #13131. Stacked on #13153.Failure
The OpenShell provider parsed Fabric's runtime binding to start each sandbox. It required
agent_runtimeto befabric, built the start command and environment from the binding, and merged the image runtime's policy and executables into the sandbox policy (network.rs). OpenShell depended on Fabric's types, and could not launch anything else.Decision
As decided on #13143 (option 1), the launch carries the runtime's policy contribution and OpenShell merges it:
openshell_sandboxtakeslaunch_json:command,environment,policy(used when no explicit policy is authored),binaries(executables managed grants allow), and opaquemetadata.agent_name,agent_runtime, andruntime_jsonare removed, along with the checks that the runtime is Fabric.Launch::policy/granted_policy, moved from the runtime binding), records the launch in an annotation, and compares it on refresh.fabric_capabilitiesreturnslaunch_jsonfor its configured agent. Fabric records the agent name and runtime binding in the launch metadata and reads them back (fabric_binding) for configuration, readiness, and the bridge.runtime_jsoncomparison gave.launch_jsonis a JSON string rather than a typed object: the framework maps nested objects to blocks, which can't be assigned from a data source. A typed object input can follow once the framework supports object attributes.Validation
Launch, since the binding's policy delegates to it.launch_json.cargo cipassed locally on linux_arm64, including all 138 contract and system tests.