Repository navigation
Description
Warning
This issue has a refined plan but no product-scope acceptance record. It should only be implemented by @rsliter after a maintainer records Decision: Accept.
Parent Epic: #9802
Outcome
Route OpenShell inference configuration reads and updates through NemoClaw’s typed, asynchronous OpenShell interface without changing supported behavior.
Scope authority and ownership
- Confirmed scope authority: Not confirmed. This issue still requires an explicit
Decision: Acceptwith reason, placement, accountable maintainer, and validation plan. - Assigned implementation owner:
@rsliter. - Typed interface and CLI implementation:
src/lib/adapters/openshell/. - Current route-read owner:
src/lib/inference/live.ts,src/lib/inference/config.ts, andsrc/lib/inference/gateway/command-args.ts. - Current route-update owners:
src/lib/actions/inference-set.ts,src/lib/onboard/inference-providers/remote.ts, andsrc/lib/actions/sandbox/connect.ts.
Dependencies and related work
- Slice 1, Phase 1 slice 1: Route sandbox inventory and readiness through the OpenShell adapter #9803, merged through refactor(cli): use typed sandbox readiness observations #10574.
- Slice 5, Phase 1 slice 5: Route providers and credentials through the OpenShell adapter #9806, completed through refactor(cli): route credentials through OpenShell provider adapter #10149, refactor(messaging): route provider preparation through adapter #10895, fix(messaging): complete typed provider lifecycle #11009, refactor(inference): route provider lifecycle through adapter #11008, refactor(mcp): route provider lifecycle through adapter #11224, refactor(onboard): route provider consumers through adapter #11234, refactor(recovery): route managed providers through adapter #11246, and refactor(providers): centralize destructive cleanup in typed adapter #11488.
- refactor(inference): route provider lifecycle through adapter #10724 closed without merging. refactor(inference): route provider lifecycle through adapter #11008 replaced it and explicitly deferred inference route transport to this issue.
- Phase 1 slice 11: Complete the OpenShell CLI consumer sweep #9813 owns the plugin runner and final executable-consumer sweep.
- Phase 2 slice 8: Migrate inference routing to a generated gRPC client #9828 owns the later generated gRPC implementation.
- Before a read-only partial delivery merges, the partial-delivery policy in Isolate the OpenShell integration and migrate eligible CLI operations to the SDK or gRPC #9802 requires an accepted, assigned follow-on issue for route mutations.
First capability slice: Typed inference route observation
Outcome
Add one typed route-read contract and CLI implementation. Migrate every in-scope src/ consumer so command construction, gateway fallback, ANSI removal, output parsing, timeout handling, and error mapping remain private to the CLI implementation.
The consumers include inference commands, onboarding route checks, provider recovery, connect, launch readiness including NemoCUA, status, doctor, list, and configuration export.
Acceptance evidence
- Configured and unconfigured routes return typed results.
- Named gateway reads remain scoped to that gateway.
- A named non-default gateway never falls back to an unscoped read.
- Partial, malformed, authentication, timeout, and transport results remain distinct.
- No migrated consumer inspects argv, exit status, stdout, or stderr.
Shortest tests
- Add a co-located CLI adapter test for exact argv, parsing, timeout, and error mapping.
- Convert existing consumer tests to use a typed route fake.
- Keep the existing inference-get, onboarding-route, provider-recovery, connect, launch-readiness, status, doctor, list, and configuration-export behavior tests.
- Run focused CLI tests and
npm run test:changed.
Deferred scope
- Route mutations and rollback, in an accepted and assigned follow-on issue.
- Plugin runner migration, under Phase 1 slice 11: Complete the OpenShell CLI consumer sweep #9813.
- Generated gRPC implementation, under Phase 2 slice 8: Migrate inference routing to a generated gRPC client #9828.
- Provider credential lifecycle, gateway lifecycle, inference health probes, validation requests, and new routing semantics.
Acceptance criteria
1. Consumers read typed routes
- Observable behavior: A configured or unconfigured live route becomes a typed result. Consumers never parse CLI output.
- Current owner:
src/lib/inference/live.tsand its production consumers. - Positive test: Configured CLI output returns the expected provider and model through the typed fake.
- Negative test: Partial or malformed output returns a schema error. A named non-default gateway never triggers an unscoped fallback.
- Evidence timing: Deterministic tests before merge; repeat the production-consumer inventory after merge before deleting obsolete helpers.
- Dependencies and related PRs: Phase 1 slice 1: Route sandbox inventory and readiness through the OpenShell adapter #9803/refactor(cli): use typed sandbox readiness observations #10574 and Phase 1 slice 5: Route providers and credentials through the OpenShell adapter #9806.
- Exclusions: Plugin runner and gRPC transport.
- Stop and ask: A consumer needs raw output as user-visible behavior or requires a new executable-level exception.
2. Valid updates preserve verification
- Observable behavior: A valid provider and model update preserves named-gateway targeting, current verification,
--no-verify, timeout, rollback, and state-publication decisions. - Current owner:
src/lib/actions/inference-set.ts,src/lib/onboard/inference-providers/remote.ts,src/lib/actions/sandbox/connect.ts, and their recovery helpers. - Positive test: The CLI implementation receives the expected gateway, provider, model, timeout, and verification intent; the action publishes state after verified success.
- Negative test: Reuse the tests that do not write sandbox state after
inference setfails and restore the prior route after convergence fails. - Evidence timing: Deterministic tests before merge; existing
inference-routing,openclaw-inference-switch, andhermes-inference-switchlive E2E during the mutation delivery. - Dependencies and related PRs: Phase 1 slice 5: Route providers and credentials through the OpenShell adapter #9806 and refactor(inference): route provider lifecycle through adapter #11008.
- Exclusions: New providers, models, API families, or verification semantics.
- Stop and ask: Preserving current verification requires a product behavior change.
3. Failures remain distinct
- Observable behavior: Missing provider, invalid route, authentication, transport, timeout, and verification or schema failures return distinct typed results.
- Current owner:
src/lib/inference/live.ts,src/lib/actions/inference-set-error.ts, onboarding failure classification, and the future CLI adapter. - Positive test: A table maps each trusted CLI result shape to one typed error.
- Negative test: Unknown output remains generic and redacted. It cannot masquerade as a known failure.
- Evidence timing: Deterministic tests before merge; existing TC-INF-06 and TC-INF-07 during live E2E.
- Dependencies and related PRs: Phase 1 slice 5: Route providers and credentials through the OpenShell adapter #9806’s provider error contract.
- Exclusions: New provider diagnostics or classifications unsupported by current evidence.
- Stop and ask: CLI evidence cannot support a distinction without parsing ambiguous text or guessing.
4. Failed or ambiguous mutations remain safe
- Observable behavior: A timed-out or connection-lost update does not become success and is not retried automatically. Recovery rereads the same named gateway before any later mutation.
- Current owner: Inference set, onboarding retry policy, connect recovery, and the future mutation adapter.
- Positive test: Verified success performs one mutation and publishes state once.
- Negative test: Null status, timeout, or connection loss performs one mutation call, publishes no state, and requires an exact-gateway reread.
- Evidence timing: Deterministic tests before merge. Do not manufacture a live ambiguous mutation.
- Dependencies and related PRs: The accepted mutation follow-on and refactor(inference): route provider lifecycle through adapter #11008.
- Exclusions: Automatic cross-transport fallback and speculative rollback.
- Stop and ask: Any retry or rollback policy cannot prove whether the remote mutation took effect.
Sensitive workflow and security boundaries
- A successful read returns configured or unconfigured. Command, transport, and malformed-output failures return typed errors and stop.
- A successful update publishes state only after current verification. A definite failure follows current rollback rules.
- A timeout or lost transport assumes a possible remote write. It does not trigger an automatic retry.
- A failed rollback reports possible split state and stops.
- Provider credentials remain in OpenShell gateway custody under Phase 1 slice 5: Route providers and credentials through the OpenShell adapter #9806. Route requests contain no provider credential values.
- Existing OpenShell authentication material remains scoped to the
openshellchild-process environment and its process lifetime. - The CLI implementation must reject competing gateway endpoint overrides, validate provider and model input, bound and redact output, preserve route locks and publication order, and keep raw process results private.
Known failure classification
- Candidate-owned: None. No candidate PR exists for this issue.
- Inherited: Current production consumers construct route argv or parse raw CLI output.
- Environmental: Historical refactor(inference): route provider lifecycle through adapter #11008 local-review and Advisor failures caused by missing tooling, HTTP 429/403 responses, and timeouts.
- Dependency-blocked: The former Phase 1 slice 1: Route sandbox inventory and readiness through the OpenShell adapter #9803 and Phase 1 slice 5: Route providers and credentials through the OpenShell adapter #9806 blockers are resolved. Product-scope acceptance and an assigned mutation follow-on remain decision blockers.
Delivery order and stop conditions
- Record an accepted product-scope decision.
- Create and assign the route-mutation follow-on required by Isolate the OpenShell integration and migrate eligible CLI operations to the SDK or gRPC #9802.
- Deliver typed route observation and migrate all in-scope
src/readers. - Deliver typed route mutation and rollback through the follow-on.
- Leave plugin migration to Phase 1 slice 11: Complete the OpenShell CLI consumer sweep #9813 and gRPC migration to Phase 2 slice 8: Migrate inference routing to a generated gRPC client #9828.
Stop and ask before implementation if scope remains unaccepted, the mutation follow-on is absent, a behavior change is required, an ambiguous mutation would be retried, or a production consumer needs a new executable-level exception.
Activity
cv commentedon Aug 28, 2026
docs/changelog/2026-08-14.mdx:27— Inference-routing call or contract.docs/deployment/deploy-to-headless-server.mdx:502— Inference-routing call or contract.docs/reference/cli-selection-guide.mdx:178— Inference-routing call or contract.docs/reference/cli-selection-guide.mdx:200— Inference-routing call or contract.docs/reference/cli-selection-guide.mdx:22— Inference-routing call or contract.docs/reference/troubleshooting.mdx:2012— Inference-routing call or contract.docs/reference/troubleshooting.mdx:320— Inference-routing call or contract.docs/security/best-practices.mdx:84— Inference-routing call or contract.scripts/nemoclaw-start.sh:1324-1344— Inference-routing call or contract.scripts/nemoclaw-start.sh:1328— Inference-routing call or contract.scripts/nemoclaw-start.sh:5966— Inference-routing call or contract.scripts/nemoclaw-start.sh:6126— Inference-routing call or contract.scripts/nemoclaw-start.sh:987— Inference-routing call or contract.scripts/walkthrough.sh:36— Inference-routing call or contract.scripts/walkthrough.sh:39— Inference-routing call or contract.scripts/walkthrough.sh:85— Inference-routing call or contract.scripts/walkthrough.sh:91— Inference-routing call or contract.src/lib/actions/sandbox/connect.ts:995— Inference-routing call or contract.src/lib/actions/sandbox/destroy-flow.test.ts:177— Inference-routing call or contract.src/lib/actions/sandbox/doctor.ts:382— Inference-routing call or contract.src/lib/inventory/index.ts:624— Inference-routing call or contract.src/lib/onboard.ts:2722— Inference-routing call or contract.src/lib/onboard/bedrock-runtime.ts:197— Inference-routing call or contract.src/lib/onboard/compatible-endpoint-smoke.ts:211— Inference-routing call or contract.src/lib/onboard/docker-gpu-local-inference.ts:196— Inference-routing call or contract.src/lib/onboard/local-inference-route.ts:56— Inference-routing call or contract.src/lib/onboard/openrouter-runtime.ts:102— Inference-routing call or contract.src/lib/onboard/provider-recovery.ts:262— Inference-routing call or contract.src/lib/shields/inference-convergence.test.ts:22— Inference-routing call or contract.src/lib/shields/inference-convergence.test.ts:23— Inference-routing call or contract.src/lib/shields/inference-convergence.test.ts:28— Inference-routing call or contract.src/lib/shields/inference-convergence.test.ts:30— Inference-routing call or contract.src/lib/shields/inference-convergence.test.ts:43— Inference-routing call or contract.src/lib/subprocess-env.ts:76— Inference-routing call or contract.src/lib/subprocess-env.ts:79— Inference-routing call or contract.src/lib/subprocess-env.ts:80— Inference-routing call or contract.src/lib/subprocess-env.ts:83— Inference-routing call or contract.src/lib/subprocess-env.ts:87— Inference-routing call or contract.src/lib/subprocess-env.ts:91— Inference-routing call or contract.src/lib/verify-deployment.ts:611— Inference-routing call or contract.test/e2e/e2e-cloud-experimental/checks/03-deepagents-code-nemotron-ultra-profile.sh:395— Inference-routing call or contract.test/e2e/live/agent-turn-latency-helpers.ts:446— Inference-routing call or contract.test/e2e/live/agent-turn-latency-helpers.ts:510— Inference-routing call or contract.test/e2e/live/cloud-inference.test.ts:121— Inference-routing call or contract.test/e2e/live/full-e2e.test.ts:539— Inference-routing call or contract.test/e2e/live/full-e2e.test.ts:547— Inference-routing call or contract.test/e2e/live/gpu-e2e.test.ts:297— Inference-routing call or contract.test/e2e/live/gpu-e2e.test.ts:371— Inference-routing call or contract.test/e2e/live/hermes-inference-switch.test.ts:170— Inference-routing call or contract.test/e2e/live/hermes-inference-switch.test.ts:224— Inference-routing call or contract.test/e2e/live/inference-routing-helpers.ts:151— Inference-routing call or contract.test/e2e/live/issue-4434-tui-unreachable-inference.test.ts:251— Inference-routing call or contract.test/e2e/live/jetson-nvmap-gpu.test.ts:342— Inference-routing call or contract.test/e2e/live/kimi-inference-compat-helpers.ts:182— Inference-routing call or contract.test/e2e/live/launchable-smoke.test.ts:373— Inference-routing call or contract.test/e2e/live/llama-cpp-generic-gpu.test.ts:454— Inference-routing call or contract.test/e2e/live/openclaw-inference-switch.test.ts:292— Inference-routing call or contract.test/e2e/live/openclaw-inference-switch.test.ts:299— Inference-routing call or contract.test/e2e/live/openclaw-inference-switch.test.ts:468— Inference-routing call or contract.test/e2e/live/pi-agent-qualification.test.ts:441— Inference-routing call or contract.test/e2e/live/telegram-injection.test.ts:181— Inference-routing call or contract.test/e2e/live/telegram-injection.test.ts:97— Inference-routing call or contract.test/e2e/support/public-nvidia-switch-provider.test.ts:30— Inference-routing call or contract.test/installer-integration/install-preflight.test.ts:678— Inference-routing call or contract.test/onboarding/onboard-build-recreate-credential-reuse.test.ts:43— Inference-routing call or contract.test/onboarding/onboard-resume-provider-recovery.test.ts:449— Inference-routing call or contract.test/onboarding/onboard-resume-provider-recovery.test.ts:451— Inference-routing call or contract.tools/openshell-agent/runtime.mts:265— Inference-routing call or contract.refactor(inference): route provider lifecycle through adapter (#11008)
refactor(config): make export contracts explicit (#11065)
refactor(config): export SDK policy and tighten adapter checks (#11345)
rsliter commentedon Sep 14, 2026
Product scope decision
Decision: Accept
Accepted capability: The first capability slice only, typed inference route observation.
Reason and placement: Replace raw OpenShell CLI result handling in the in-scope
src/route readers with one typed, asynchronous read contract undersrc/lib/adapters/openshell/. Preserve current supported behavior while keeping argv construction, gateway fallback, ANSI removal, parsing, timeout handling, and error mapping private to the CLI implementation.Accountable maintainer: @rsliter
Validation plan: Add co-located CLI adapter tests for configured and unconfigured routes, exact named-gateway targeting, absence of non-default unscoped fallback, malformed and partial output, authentication, timeout, and transport failures. Convert migrated consumer tests to typed route fakes, retain the existing consumer behavior tests, run focused tests,
npm run test:changed, local review, PR validation, and required CI. No new live E2E is required because this slice preserves externally observable routing behavior and performs no mutation.Explicit exclusions: Route mutation and rollback, plugin migration (#9813), generated gRPC transport (#9828), provider credential lifecycle, gateway lifecycle, health probes, validation requests, and new routing semantics.
The partial-delivery dependency from #9802 still applies: a separate accepted and assigned route-mutation follow-on is required before this read-only slice merges.
refactor(inference): route reads through typed adapter (#11770)
fix(openshell): preserve route observation bounds (#12082)
rsliter commentedon Sep 18, 2026
Accepted slice completion
The accepted typed route-observation slice is complete through #11770 and follow-up #12082. Canonical
maincontains merge commits39607dd7c9and0be7cd44f5.Criterion-to-evidence ledger
inference get -g <gateway>and reject unscoped fallback.outputLimitBytes; synchronous capture usesmaxBuffer. The adapter overflow test and config-export wrapper assertion protect the one-MiB boundary.Validation
validate:pr, publication checks, required CI, and all twelve CLI shards passed.35373793877completed all nine specialists with a clear blocker gate.0be7cd44f5onmain.Follow-ons and exclusions
parseGatewayInferenceandbuildGatewayInferenceGetArgswith no production consumers; their definitions and dedicated parser tests remain as separately deferred cleanup and were intentionally excluded from refactor(inference): route reads through typed adapter #11770/fix(openshell): preserve route observation bounds #12082.Closing #9809 as complete for its accepted read-only capability slice.
refactor(inference): remove legacy route helpers (#12094)