Skip to content

feat(runtime): add durable host-local inference lifecycle - #8069

Open
ericksoa wants to merge 15 commits into
feat/podman-host-local-inference-runtimefrom
feat/host-local-inference-durable-lifecycle
Open

feat(runtime): add durable host-local inference lifecycle#8069
ericksoa wants to merge 15 commits into
feat/podman-host-local-inference-runtimefrom
feat/host-local-inference-durable-lifecycle

Conversation

@ericksoa

@ericksoa ericksoa commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This B4-E1 slice gives dormant provider-owned host-local inference durable lifecycle authority for OpenClaw, Hermes, and LangChain Deep Agents Code. It persists canonical ownership through onboarding and registry state, fences snapshot and restore mutations, and retires only the exact managed runtime after durable deletion.

Podman remains absent from the production provider registry. No supported workflow is activated, and the hidden, default-off --temp-managed-runtime experiment gate remains intentionally undocumented.

Changes

  • Persist and validate the complete secret-free host-local inference receipt on every registry read and write.
  • Reserve proved inference-route ownership and carry it through all-agent sandbox registration and same-name recreation.
  • Add provider-neutral lifecycle contracts that re-prove exact runtime authority before backup, restore, rebuild, and deletion.
  • Fence snapshot publication and restore mutations against receipt drift and stale lifecycle generations.
  • Make managed cleanup idempotent across retries, preserve durable ownership after partial failure, and delete only after exact provider-native authority is reconfirmed.
  • Keep host-owned inference processes external and reject unsupported MXC lifecycle mutation explicitly without central Podman switches.
  • Incorporate the durable-lifecycle source material formerly staged in feat(runtime): complete host-local inference lifecycle #8076 while preserving one review thesis in this PR.

Quality Gates

  • Tests added or updated for changed behavior
  • All-agent and provider-neutral contract coverage
  • Hidden/default-off activation boundary preserved
  • Documentation writer review complete
  • Exact-head advisor, CI, CodeRabbit, and protected E2E qualification complete

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: This patch extends dormant provider-neutral host-local inference authority into durable registry persistence, snapshot backup and restore fencing, and post-deletion exact managed-runtime retirement. Podman remains absent from the production provider registry, no supported workflow is activated, and the existing hidden, default-off --temp-managed-runtime flag remains intentionally undocumented.
  • Agent: Codex Desktop

Verification

  • Signed commits and DCO
  • 449 changed-file tests passed, plus the focused destroy lifecycle rerun after the exact result-contract fix
  • Plugin typecheck, CLI build, CLI typecheck, and focused host-local authority tests passed
  • Repository checks, source architecture, test conditionals, source-shape, test-size, diff, formatting, lint, secret scan, and commitlint passed
  • Normal commit hooks passed without bypass
  • Exact-head GitHub qualification is pending

Exact head: 4fa744cffdbab8b3691df3a770dff5d09fd07333. Stable base-relative patch ID: 3d43b8f38566a87126fdf265b748e561c37ab47b.


Signed-off-by: Aaron Erickson aerickson@nvidia.com

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2dffd763-c838-46e2-9084-439c0ad26d54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Host-local inference setup now serializes receipts and stores them with reserved sandbox routes. Registry registration, normalization, loading, and saving validate and preserve canonical receipts. Route fingerprints exclude the receipt. Tests cover transport, preservation, clearing, and malformed values.

Changes

Host-local inference receipt transport

Layer / File(s) Summary
Receipt contract and canonicalization
src/lib/state/registry/types.ts, src/lib/state/registry/host-local-inference.ts, test/helpers/host-local-inference-receipt.ts, src/lib/state/registry/host-local-inference.test.ts
The sandbox entry stores an optional receipt. The registry canonicalizes valid serialized receipts and rejects invalid, incomplete, secret-bearing, or oversized values.
Registry transport and persistence
src/lib/state/registry.ts, src/lib/state/registry/persistence.ts, test/registry.test.ts
Registration and route reservation persist receipts. Runtime normalization and disk serialization validate receipts and retain canonical values.
Onboarding propagation and preservation
src/lib/onboard/setup-inference.ts, src/lib/onboard/sandbox-registration.ts, src/lib/onboard/sandbox-recreate-transaction.ts, test/onboard-host-local-inference-routing.test.ts, src/lib/onboard/*test.ts
Host-local setup serializes receipts after route preparation. Registration preserves existing receipts, supports explicit clearing, and excludes receipts from registry fingerprints. Routing tests verify stored receipt fields.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: feature, area: inference, area: onboarding, area: routing

Suggested reviewers: cv

Sequence Diagram(s)

sequenceDiagram
  participant HostLocalSetup
  participant RouteReservation
  participant SandboxRegistry
  participant RegistryPersistence
  HostLocalSetup->>HostLocalSetup: prepare and serialize host-local route receipt
  HostLocalSetup->>RouteReservation: submit route reservation with receipt
  RouteReservation->>SandboxRegistry: store receipt on sandbox entry
  SandboxRegistry->>RegistryPersistence: validate and serialize registry entry
  RegistryPersistence-->>SandboxRegistry: load canonical receipt
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the durable host-local inference lifecycle changes implemented across runtime setup, routing, registration, and registry persistence.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/host-local-inference-durable-lifecycle

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

@github-code-quality

github-code-quality Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 4fa744c in the feat/host-local-infe... branch remains at 96%, unchanged from commit 2b90d18 in the feat/podman-host-loc... branch.

TypeScript / code-coverage/cli

The overall coverage in commit 4fa744c in the feat/host-local-infe... branch remains at 81%, unchanged from commit 2b90d18 in the feat/podman-host-loc... branch.

Show a code coverage summary of the most impacted files.
File feat/podman-host-loc... 2b90d18 feat/host-local-infe... 4fa744c +/-
src/lib/onboard...strap/docker.ts 69% 60% -9%
src/lib/onboard...atcher-lease.ts 0% 75% +75%
src/lib/onboard...ne-lifecycle.ts 0% 83% +83%
src/lib/onboard...al-inference.ts 0% 83% +83%
src/lib/onboard...ne-authority.ts 0% 84% +84%
src/lib/onboard...trap-journal.ts 0% 86% +86%
src/lib/onboard...-replacement.ts 0% 88% +88%
src/lib/onboard...-transaction.ts 0% 88% +88%
src/lib/onboard...eld-workload.ts 0% 88% +88%
src/lib/onboard...ate-mutation.ts 0% 93% +93%

Updated August 05, 2026 12:06 UTC

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Blocking findings reported

Advisor assessment: Blockers require maintainer review
Next action: Review the blockers below.
Findings: 1 blocker · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 1 blocker · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized terminology decisions differ; normalized E2E selections differ; Nemotron reported 1 fewer blocker, the same number of warnings, the same number of suggestions.
6 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • lifecycle authority at src/lib/onboard/runtime-provider/host-local-inference-lifecycle.test.ts:81: selected only by the second-opinion lane as established.
  • provider-neutral at src/lib/state/registry/host-local-inference.ts:10: selected only by the second-opinion lane as established.
  • host-local inference at src/lib/onboard/runtime-provider/host-local-inference-lifecycle.ts:35: selected only by the second-opinion lane as established.
  • exact managed runtime at src/lib/onboard/runtime-provider/host-local-inference-lifecycle.ts:145: selected only by the second-opinion lane as define.
  • reprove at src/lib/onboard/runtime-provider/host-local-inference-lifecycle.ts:54: selected only by the second-opinion lane as define.
  • receipt at src/lib/actions/sandbox/destroy-host-local-inference.test.ts:7: selected only by the second-opinion lane as justified.

Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

3 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • justified — host-local inference authority at src/lib/onboard/runtime-provider/host-local-inference-lifecycle.ts:73: Keep this term for the receipt-bound host-local service authority.
  • justified — exact provider-owned runtime at src/lib/onboard/runtime-provider/host-local-inference.ts:137: Keep this term where teardown scope distinguishes managed provider resources from host processes.
  • justified — provider snapshot authority at src/lib/actions/sandbox/snapshot/restore-authority.ts:46: Keep this term for snapshots that require provider-bound restore authority.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: inference-routing, network-policy, onboard-repair, onboard-resume, rebuild-openclaw, state-backup-restore, cloud-onboard

1 optional E2E recommendation
  • snapshot-commands

Blockers

PRA-1 Blocker — Clear stale host-local ownership when inference selection changes

  • Location: src/lib/onboard/setup-inference.ts:374
  • Category: correctness
  • Problem: A non-host-local inference setup omits hostLocalInferenceReceipt from its route reservation. The registry preserves the existing field, so a sandbox changed from host-local inference to a remote provider retains authority for the former host-local runtime.
  • Impact: A later destroy can retire a runtime no longer selected by the sandbox, and snapshot or restore can require stale host-local authority after a switch to remote inference.
  • Fix: Pass hostLocalInferenceReceipt: null for non-host-local route reservations, while retaining the serialized receipt only for a selected host-local route.
  • Verification: Inspect a reservation after changing a registered sandbox from host-local inference to a remote provider; its hostLocalInferenceReceipt must be null or absent.
  • Test coverage: Add a setup-inference regression test that switches a sandbox from host-local inference to a remote provider and verifies the persisted reservation clears hostLocalInferenceReceipt.
  • Evidence: src/lib/onboard/setup-inference.ts:374 conditionally omits hostLocalInferenceReceipt when no host-local route is selected. src/lib/state/registry.ts:230 spreads the existing sandbox row and only assigns hostLocalInferenceReceipt when the route field is defined. src/lib/onboard/sandbox-registration.ts:217 carries an existing receipt when registration input omits one.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa changed the title feat(runtime): persist host-local inference lifecycle authority feat(runtime): persist host-local inference ownership Aug 2, 2026
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa

ericksoa commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/state/registry.ts`:
- Line 234: Update the same-name route reservation handling around
hostLocalInferenceReceipt so an omitted field is not converted to null; only
overwrite the existing receipt when the route provides a string or explicit
null, allowing the existing spread to retain prior values. Add a regression test
covering an existing receipt followed by a reservation without
hostLocalInferenceReceipt, and verify the receipt remains available to
registerCreatedSandbox().
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a69a50a1-ff56-467c-b4fa-d114f9138c8e

📥 Commits

Reviewing files that changed from the base of the PR and between b588f8b and ddb5feb.

📒 Files selected for processing (13)
  • src/lib/onboard/sandbox-recreate-transaction.test.ts
  • src/lib/onboard/sandbox-recreate-transaction.ts
  • src/lib/onboard/sandbox-registration.test.ts
  • src/lib/onboard/sandbox-registration.ts
  • src/lib/onboard/setup-inference.ts
  • src/lib/state/registry.ts
  • src/lib/state/registry/host-local-inference.test.ts
  • src/lib/state/registry/host-local-inference.ts
  • src/lib/state/registry/persistence.ts
  • src/lib/state/registry/types.ts
  • test/helpers/host-local-inference-receipt.ts
  • test/onboard-host-local-inference-routing.test.ts
  • test/registry.test.ts

Comment thread src/lib/state/registry.ts Outdated
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit 990a5f5634 in bottom-up stack order. This PR depends on #8066, which is not approval-ready. This ownership layer is still a draft and therefore cannot serve as an accepted base for qualification work. Review remains blocked until the parent is reconstructed or repaired, this branch is restacked on the accepted parent commit, and current CI, security, and documentation evidence passes for the resulting commit. No approval is granted for the current branch.

@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: routing Request routing, policy routing, model selection, or fallback logic feature PR adds or expands user-visible functionality integration: dcode LangChain Deep Code integration behavior integration: hermes Hermes integration behavior labels Aug 4, 2026
@wscurran wscurran added the integration: openclaw OpenClaw integration behavior label Aug 4, 2026
Base automatically changed from feat/host-local-inference-routing-integration to feat/podman-host-local-inference-runtime August 5, 2026 06:04
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa changed the title feat(runtime): persist host-local inference ownership feat(runtime): add durable host-local inference lifecycle Aug 5, 2026
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 5, 2026

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.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear stale host-local ownership when inference changes to a remote provider. The current route reservation omits hostLocalInferenceReceipt, while the registry preserves the existing field; later destroy, snapshot, or restore can then act on a runtime the sandbox no longer selects. Add a regression that switches from host-local to remote inference and proves the persisted receipt is removed. The stacked branch also has a failing E2E / PR Gate and cannot be approved until its parent and required checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: routing Request routing, policy routing, model selection, or fallback logic feature PR adds or expands user-visible functionality integration: dcode LangChain Deep Code integration behavior integration: hermes Hermes integration behavior integration: openclaw OpenClaw integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants