Skip to content

feat(fabric-provider): stop the Fabric agent when fabric_agent is removed - #13298

Merged
cv merged 2 commits into
v1from
feat/stop-agent-on-removal
Oct 16, 2026
Merged

cv merged 2 commits into
v1from
feat/stop-agent-on-removal

Conversation

@cv

@cv cv commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #13234. Part of #13131.

Failure

Removing a fabric_agent forgot its binding but left the agent running in the sandbox, with its configuration applied. OpenTofu users expect removing an attachment-style resource to stop what it started and leave the thing it's attached to.

Decision

Fabric stops its own runtime, using an operation the bridge host already has, so the agent image needs no change.

  • What removal does: it calls the host's existing prepare operation with the agent's last applied configuration and the host's current generation. prepare stops the Fabric runtime through Fabric's native stop() and clears the applied configuration. The sandbox and its host stay.
  • Edge cases:
    • If the sandbox is already gone, removal succeeds.
    • If the host is already stopped with no configuration, nothing changes.
    • If stopping fails, removal fails and keeps the binding, so the next apply or destroy retries.
    • A different sandbox under the same name is refused, as read refuses it.
  • No compatibility handling: the issue's "image without the operation" case doesn't apply, because every agent image already has prepare.
  • Docs: provider.md, agents.md and design/fabric-management.md describe the new removal.

Stacked on #13296, which fixes a build error in openshell-provider without its installation feature. The Fabric contract tests hit that error when built on their own.

Validation

  • New contract test removing_an_agent_stops_it_and_keeps_its_sandbox. Removal stops the agent, clears its configuration, and keeps the sandbox. With the sandbox already gone, removal succeeds. It failed before the change at "removal stops the agent".
  • Updated test: pi_configuration_updates_without_replacing_the_sandbox. Destroy now stops Pi once (one prepare) before removing its sandbox, and never reconfigures it. The fake gateway's exec truncation, set earlier in that test, is turned off before the destroy.
  • cargo ci passes locally: 1530 unit tests, 144 lifecycle tests.
  • cargo ci live-docker passes: 11 tests.
  • fern check: 0 errors, the same single warning as before.

cv added 2 commits October 15, 2026 16:57
…ion feature

Removing mod external_inference left its feature gate on the next line,
gating gateway_source. Without the installation feature, as
fabric-provider depends on it, openshell-provider failed to compile.
…oved

Removing a fabric_agent forgot its binding and left the agent running.
Removal now calls the host's existing prepare operation, which stops the
runtime through Fabric's own stop and clears its configuration, leaving
the sandbox. A sandbox that is already gone needs nothing; a failed stop
keeps the binding for the next apply or destroy to retry.
Base automatically changed from fix/gateway-source-cfg to v1 October 16, 2026 00:26
@cv
cv enabled auto-merge (squash) October 16, 2026 00:26
@cv
cv merged commit fa88ba3 into v1 Oct 16, 2026
@cv
cv deleted the feat/stop-agent-on-removal branch October 16, 2026 00:59
@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression v1 NemoClaw v1 branch labels Oct 26, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants