Skip to content

fix(inference): bind health checks to sandbox gateway - #10306

Closed
apurvvkumaria wants to merge 1 commit into
mainfrom
codex/10228-gateway-evidence-repair
Closed

apurvvkumaria wants to merge 1 commit into
mainfrom
codex/10228-gateway-evidence-repair

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow up on #10228 by binding status, doctor, start, and launch-readiness inference evidence to the sandbox's recorded gateway. Deep Agents Code probes also retain the managed launcher identity, so health cannot be inferred through another gateway or a generic shell path.

Related Issue

Related to #10080 and follow-up to #10228.

Changes

  • Pass the recorded gateway to route and invocation health probes.
  • Preserve the Deep Agents Code identity when start and launch-readiness checks select the managed launcher.
  • Add focused coverage for non-default gateway bindings across status, doctor, start, and launch readiness.

Attribution

Dongni Yang authored the original #10228 change and remains the primary contributor to that behavior. Carlos Villela contributed its response-class correction. Apurv Kumaria contributed this limited post-merge repair and its tests.

Documentation

No documentation change is needed. This repair makes existing health checks use their recorded sandbox gateway and does not change commands, options, configuration, or supported workflows.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification:
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit: Not applicable; this PR does not change scripts/prepare-dgx-station-host.sh.
  • Station profile/scenario: Not applicable.
  • Result: Not applicable.
  • Supporting evidence: Not applicable.

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — 138 focused CLI tests passed across the seven changed behavior suites.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: Not applicable; this is a focused health-probe repair. npm run checks:repository and CLI type checking passed.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Apurv Kumaria [email protected]

Summary by CodeRabbit

  • Bug Fixes

    • Improved sandbox inference diagnostics by targeting the correct configured gateway during health and readiness checks.
    • Preserved agent identity when validating inference routes, including Deep Agents Code sandboxes.
    • Improved recovery and status reporting for configured and changing inference routes.
  • Tests

    • Expanded coverage for gateway and agent propagation across sandbox startup, status, recovery, and readiness scenarios.

@github-actions

Copy link
Copy Markdown
Contributor

This repository limits you to 10 open pull requests. Please close or merge an existing PR before opening another one.

@apurvvkumaria apurvvkumaria self-assigned this Aug 25, 2026
@github-actions github-actions Bot closed this Aug 25, 2026
@github-code-quality

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit 84b6a0a in the codex/10228-gateway-... branch remains at 96%, unchanged from commit f111fcc in the main branch.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a3ea4f0f-a630-4b79-8b45-80b18d4d7d04

📥 Commits

Reviewing files that changed from the base of the PR and between f111fcc and 84b6a0a.

📒 Files selected for processing (13)
  • src/lib/actions/sandbox/doctor-inference.test.ts
  • src/lib/actions/sandbox/doctor-inference.ts
  • src/lib/actions/sandbox/doctor.ts
  • src/lib/actions/sandbox/inference-route-health.test.ts
  • src/lib/actions/sandbox/inference-route-health.ts
  • src/lib/actions/sandbox/launch-readiness-gateway-health.test.ts
  • src/lib/actions/sandbox/launch-readiness/health.ts
  • src/lib/actions/sandbox/start.test.ts
  • src/lib/actions/sandbox/start.ts
  • src/lib/actions/sandbox/status-inference.test.ts
  • src/lib/actions/sandbox/status-snapshot-inference-health.test.ts
  • src/lib/actions/sandbox/status-snapshot-recovery.test.ts
  • src/lib/actions/sandbox/status-snapshot.ts

📝 Walkthrough

Walkthrough

Inference diagnostics and readiness checks now propagate persisted sandbox gateway identities. Deep Agents Code checks also pass the resolved agent name. Tests verify gateway and agent arguments across doctor, start, launch-readiness, and status flows.

Changes

Gateway identity propagation

Layer / File(s) Summary
Probe contracts and doctor flow
src/lib/actions/sandbox/inference-route-health.ts, src/lib/actions/sandbox/doctor-inference.ts, src/lib/actions/sandbox/doctor.ts, src/lib/actions/sandbox/*test.ts
Inference probes accept an optional gateway name. Doctor checks forward the resolved gateway name to gateway health probing.
Readiness and start propagation
src/lib/actions/sandbox/start.ts, src/lib/actions/sandbox/start.test.ts, src/lib/actions/sandbox/launch-readiness/health.ts, src/lib/actions/sandbox/launch-readiness-gateway-health.test.ts
Start and launch-readiness probes pass persisted gateway names and the Deep Agents Code agent name when applicable.
Status propagation and validation
src/lib/actions/sandbox/status-snapshot.ts, src/lib/actions/sandbox/status-inference.test.ts, src/lib/actions/sandbox/status-snapshot-inference-health.test.ts, src/lib/actions/sandbox/status-snapshot-recovery.test.ts
Status flows pass gateway names to health and invocation probes. Tests verify named gateways across route, recovery, and Deep Agents Code scenarios.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: dongni-yang, jyaunches

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/10228-gateway-evidence-repair

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

@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

This follow-up is now superseded by #10302. The complete gateway repair and its validation were transferred there: DCode inference health checks use the sandbox's recorded gateway, the managed DCode execution boundary is preserved, and the affected source and CLI tests pass.

#10302 records the contributor credit for the underlying #10228 work and limits Apurv Kumaria's added credit to the repair and integration. Continue review and CI follow-up on #10302.

rsliter pushed a commit that referenced this pull request Aug 25, 2026
## Summary

Follow up on #10228 by binding status, doctor, start, and
launch-readiness inference evidence to the sandbox's recorded gateway.
LangChain Deep Agents Code probes also retain the managed launcher
identity, so health cannot be inferred through another gateway or a
generic shell path.

## Related Issue

Related to #10080 and follow-up to #10228. Supersedes closed PR #10306.

## Changes

- Pass the recorded gateway to route metadata, route health, and
invocation health probes.
- Preserve the LangChain Deep Agents Code identity when start and
launch-readiness checks select the managed launcher.
- Keep Deep Agents Code test probes on direct OpenShell stdout while
marker-framed transports retain the execution marker.
- Add focused coverage for non-default gateway bindings across status,
doctor, start, and launch readiness.

The OpenClaw MCP credential-revision work was removed from this PR and
remains owned by focused PR #10307.

## Attribution

Dongni Yang authored the original #10228 change and remains the primary
contributor to that behavior. Carlos Villela contributed its
response-class correction. Apurv Kumaria contributed this limited
post-merge repair and its tests.

## Change Size

The effective PR diff has 158 additions and 109 deletions across 16
files. It is below the 500-line large-change threshold.

## Documentation

No documentation change is needed. This repair makes existing health
checks use their recorded sandbox gateway and does not change commands,
options, configuration, diagnostics, recovery procedures, or supported
workflows.

## Type of Change

- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior; justification: Not
applicable because this PR adds focused regression coverage.
- [ ] Tests not applicable; justification: Not applicable.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded; reviewer/approval link/justification: The independent
nine-category security review passed for exact commit
`13d3f702257781285a6c92777397e8da8f975c7b`:
#10302 (review)
- [ ] Non-success, skipped, or missing CI check accepted by maintainer;
check name, approval link, and follow-up issue: No CI exception is
accepted.

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit: Not applicable; this PR does not change
`scripts/prepare-dgx-station-host.sh`.
- Station profile/scenario: Not applicable.
- Result: Not applicable.
- Supporting evidence: Not applicable.

## Verification

- [x] PR description includes a `Signed-off-by:` line and all 11 commits
appear as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run validate:pr` passed after refreshing `origin/main` when hooks
were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set: 172
focused source tests and 32 affected CLI and rebuild integration tests
passed after a clean CLI build.
- [x] `npm run test:changed`, `npm run typecheck:cli`, and `npm run
checks:repository` passed.
- [x] Applicable broad gate passed: exact workflow run `32908938447`
passed all 12 CLI shards, aggregate CLI checks, build and type checks,
static checks, installer integration, plugin tests, and reviewed
dependency audit at commit `13d3f702257781285a6c92777397e8da8f975c7b`:
https://github.com/NVIDIA/NemoClaw/actions/runs/32908938447
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

## Documentation Writer Review

- [x] Documentation writer subagent reviewed the completed changes
- Result: `no-docs-needed`
- Evidence: Existing `docs/reference/commands.mdx` and
`docs/inference/verify-inference-route.mdx` already state that named
sandbox health checks use the sandbox's recorded owning OpenShell
gateway and exercise the inference route used by agent traffic. The
effective diff repairs that contract and adds no command, option,
configuration, diagnostic, recovery procedure, or supported surface.
- Agent: Codex Desktop independent documentation writer
<!-- docs-review-head-sha: 13d3f70 -->
<!-- docs-review-agents-blob-sha:
becb5c5 -->

---
Signed-off-by: Apurv Kumaria <[email protected]>

---------

Signed-off-by: Apurv Kumaria <[email protected]>
Co-authored-by: Carlos Villela <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@wscurran wscurran added area: inference Inference routing, serving, model selection, or outputs bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior labels Nov 16, 2026
@cv
cv deleted the codex/10228-gateway-evidence-repair branch November 21, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: inference Inference routing, serving, model selection, or outputs bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants