Skip to content

fix(onboard): reject inference route on HTTP 404 from /v1/models - #12339

Merged
ericksoa merged 7 commits into
mainfrom
codex/pr10609-models-404
Sep 25, 2026
Merged

ericksoa merged 7 commits into
mainfrom
codex/pr10609-models-404

Conversation

@ericksoa

@ericksoa ericksoa commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Outcome

Onboarding now fails verification when an ordinary inference route returns HTTP 404 from /v1/models, instead of reporting a healthy deployment that immediately appears unhealthy in nemoclaw status.

Reason

The reported mismatch still exists on current main. This carries forward Harjoth Khara’s contribution in #10609 with the contributor commits preserved. A branch in NVIDIA/NemoClaw is needed because required CI restricts the reviewed OpenShell SDK package to same-repository PRs.

Related issues

Fixes #10543.
Supersedes #10609 after this replacement merges.

Changes

  • Reject an ordinary models-route 404, malformed HTTP status output, and unsuccessful probe commands through the existing verification retry path.
  • Preserve the Deep Agents Code/OpenRouter exception only when the bounded inference invocation succeeds. Keep existing 401/403 handling unchanged.
  • Pass onboarding’s agent, provider, model, and gateway context into verification, and move the unchanged dashboard port probe to its owning helper.
  • Add focused regressions and document the failed-verification recovery path.

Verification

  • Reproduced the ordinary-404 mismatch through the production verifier on main 7d02fef631c6fd04a8a69e9c096a4da40246d1d1: it reported both deployment and inference route healthy. The same check fails health verification with this change. Command and host-port boundaries were stubbed; this was not a live sandbox reproduction.
  • 158 focused tests passed across inference verification, dashboard readiness, onboarding finalization, and shared inference-route health, including the temporary main-versus-candidate reproduction.
  • CLI and plugin builds, CLI type checking, policy-boundary compilation, and catalog compilation passed.
  • npm run docs passed with zero errors and two existing warnings.
  • Normal commit hooks and git diff --check passed. The diff contains no secrets, API keys, or credentials.
  • Final commit fe9978aed03a234025613677d0c053aa7fe02ce4: required CI, Docker and rootless Podman all-agent activation, and security scanning passed. The final documentation correction also passed npm run docs in all three guide variants.

Review notes

Manual source and caller review covered the integrated change, including sensitive onboarding and dashboard paths. The review found no candidate-owned correctness or security blocker after the owning inference-route guide was corrected.

CodeRabbit completed review through the final commit without actionable comments. All nine Advisor specialist reports were read: seven were clear; the remaining architecture and test recommendations were classified as non-blocking for this scoped fix with source and test evidence. The Advisor's derived blocker job remains red because it counts those recommendations; it is not represented as a passed check.

The maintainer authorized admin merge after green CI and review disposition because this account opened the replacement and cannot approve its own PR. This does not claim an independent human approval. Manual full PR E2E was not required or run.


Signed-off-by: Aaron Erickson [email protected]

Summary by CodeRabbit

  • Bug Fixes

    • Deployment checks now validate inference endpoints more reliably. Persistent HTTP 404 responses from the model catalog cause onboarding to fail after its usual retry period, with guidance to check the provider, model, and endpoint. For the expected Deep Agents Code/OpenRouter catalog 404, onboarding confirms that an inference request succeeds before accepting the endpoint.
    • Onboarding checks the verification service through its forwarded port.
  • Documentation

    • Added troubleshooting guidance for inference endpoint 404 errors, including how to correct the endpoint and resume onboarding. Status checks also apply the 404 rule.

harjothkhara and others added 6 commits August 30, 2026 21:04
Onboarding verified the inference route by treating every HTTP status below
500 as healthy, so a sandbox whose `GET /v1/models` answered 404 was reported
as a verified deployment and exited 0. `status` was hardened to reject that
same route in #10228, so the two readiness paths disagreed about the same
route at the same moment, and automation gating on the onboarding exit code
saw success.

Fail a 404 closed in the onboarding path and name the unvalidated model
catalog as the reason. A credential-gated 401 or 403 stays healthy here: that
route did answer, it just wants a key (#2342). An ordinary 404 keeps the
startup retry budget, because a route can answer before its catalog is
registered and the probe already recovers a late route (#6849).

Deep Agents Code on `openrouter-api` is the one models route that answers 404
by design (#9834). Reuse the shared `isDcodeOpenRouterModelsRoute404`
predicate rather than restating the rule, accept that 404 only after a bounded
inference request succeeds, and settle it without retrying a budget it can
never satisfy. When that request fails, point the user at the request rather
than at the catalog, which that agent and provider never serve.

Move the host-port probe closure out of the onboarding entry point into
`onboard/dashboard.ts` and cover it, keeping the entry point from growing.

Fixes #10543

Signed-off-by: harjoth <[email protected]>

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The models-route probe read its HTTP status with `parseInt`, which accepts
trailing garbage such as `200junk`, and it ignored a nonzero sandbox-command
result. Either case could hand a trusted status to the health branches and let
onboarding report the route healthy when nothing answered it.

Accept a status only when the command succeeded and stdout is exactly three
digits, matching what curl writes and the `000` the script echoes on failure.
Anything else keeps the existing unreachable result, so the probe still retries
and fails closed with no trusted HTTP code. The 404, 5xx, and accepted-status
branches are unchanged.

Signed-off-by: Harjoth Khara <[email protected]>
The invocation probe fails closed when either the model or the provider
was not recorded for the sandbox. The suite only exercised the missing
model. A regression that dropped the provider guard passed every test.

Add the case with a valid model and a null provider. Under a mutation
that removes the provider guard, this test fails and no other does.

Refs #10543

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: harjoth <[email protected]>
Keep the dedicated two-second reachability probe from #8046. An ordinary
404 fails closed within the existing startup retry budget (#6849).

Accept the Deep Agents Code OpenRouter expected 404 (#9834) only after a
successful invocation probe, awaited through main's async invocation probe.
HTTP 401 and 403 handling remains unchanged (#2342).
@ericksoa ericksoa self-assigned this Sep 25, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 25, 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.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/NemoClaw/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ae0affac-48db-4eab-8d84-5c96393db097

📥 Commits

Reviewing files that changed from the base of the PR and between a03e23d and fe9978a.

📒 Files selected for processing (1)
  • docs/inference/verify-inference-route.mdx

Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Onboarding now checks inference-route HTTP responses and applies route-specific 404 handling. For the matching Deep Agents Code/OpenRouter case, it uses an inference invocation probe to determine health. Documentation describes repeated 404 failures and recovery steps.

Changes

Inference Route Verification

Layer / File(s) Summary
Validate inference-route responses and retries
src/lib/verify-deployment.ts, src/lib/verify-deployment-inference-route.test.ts
Verification now requires a successful command and exactly three digits of HTTP output. It treats 404 and 5xx responses as unhealthy, retries ordinary 404s, and reports route-specific guidance. Tests cover response parsing, status classification, and retries.
Resolve expected 404s during onboarding
src/lib/verify-deployment.ts, src/lib/onboard.ts, src/lib/onboard/dashboard.ts, src/lib/onboard/dashboard.test.ts, src/lib/verify-deployment-inference-route.test.ts, docs/reference/troubleshooting.mdx, docs/inference/verify-inference-route.mdx
Onboarding passes agent and provider context and supplies route and invocation probes. A matching expected 404 is healthy only when the invocation probe succeeds; missing model or provider details fail closed. Tests cover the exception and onboarding probe. The documentation describes 404 failures and recovery steps.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: apurvvkumaria, dongni-yang

Merge Risk: ⚪ Minimal · up to fe997

Ordinary models-route failures remain unhealthy through retries and prevent onboarding completion; the matching Deep Agents Code/OpenRouter status exception requires a successful inference request. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies the coding objective in issue #10543. probeInferenceRouteOnce marks HTTP 404 as unhealthy, so onboarding cannot report a healthy inference route for the affected OpenClaw `openroute…
Out of Scope Changes check ✅ Passed The changed code supports issue #10543. The dashboard probe helper supports onboarding verification. The tests cover the new failure, retry, recovery, and exception behavior. The documentation describ…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: rejecting inference routes when /v1/models returns HTTP 404 during onboarding.
Full details: Docstring Coverage

Explanation

Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@ericksoa

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@github-actions

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit fe9978a in the codex/pr10609-models... branch remains at 96%, unchanged from commit 7d02fef in the main branch.

TypeScript / code-coverage/cli

The overall line coverage in commit fe9978a in the codex/pr10609-models... branch remains at 84%, unchanged from commit 7d02fef in the main branch.

Show a line coverage summary of the most impacted files.
File main 7d02fef codex/pr10609-models... fe9978a +/-
src/lib/onboard...cs/redaction.ts 96% 93% -3%
src/lib/verify-deployment.ts 99% 98% -1%
src/lib/inferen...hugging-face.ts 96% 96% 0%
src/lib/onboard...age/contract.ts 97% 98% +1%
src/lib/onboard...-transaction.ts 84% 86% +2%
src/lib/onboard/dashboard.ts 71% 73% +2%
src/lib/onboard...ence-routing.ts 89% 92% +3%
src/lib/agent/dashboard-ui.ts 91% 94% +3%
src/lib/inferen...anaged-state.ts 71% 75% +4%
src/lib/onboard...-mount/index.ts 92% 96% +4%

Updated September 25, 2026 18:36 UTC

@ericksoa

Copy link
Copy Markdown
Member Author

Reviewed all nine Advisor reports for a03e23d18536edb6ed70d53da24ab61062b544bd against main 7d02fef631c6fd04a8a69e9c096a4da40246d1d1.

  • Documentation: accepted. The owning inference-route guide must describe ordinary 404 failure, retained-session recovery, and the status exception. A narrow documentation correction follows.
  • Architecture and migration: the bare 401/403 acceptance and local shell probe are inherited, not introduced by this PR. Main’s probeInferenceRouteOnce already uses the same command and accepts those statuses; its existing test explicitly expects a 401 inference route to work. This PR fixes ordinary 404 handling and malformed/failed probe output. It does not claim to migrate every readiness policy or change credential-gated status handling. Replacing the shared verification architecture or changing 401/403 acceptance is outside this repair.
  • Customer behavior and verification evidence: the claimed Deep Agents onboarding failure is not reachable in the current supported flow. Its manifest declares a terminal runtime without forwards. handlePostVerifyState calls deployment verification only when shouldManageDashboardForAgent is true. The existing test, “skips dashboard and gateway verification for terminal agents without forwards,” exercises this exact agent and asserts that verification is not called. It passed in the focused validation. The generic verifier retains defensive support for the shared 404 exception, but adding startup invocation retries or an artificial production handoff for this terminal path is not required to fix [Ubuntu 24.04][Onboard] onboarding claims a healthy inference route and exits 0 for an OpenClaw openrouter-api sandbox that status reports unhealthy on /v1/models 404 #10543.
  • Other specialists: delivery, operability, reduction, and security reported no blocker. CodeRabbit completed its full review without actionable comments; its docstring-coverage suggestion is advisory.

The inherited behavior and terminal-path evidence are in the unchanged files src/lib/verify-deployment.test.ts:558, src/lib/onboard/dashboard-runtime.ts:42, src/lib/onboard/machine/handlers/finalization.ts:342,406-438, src/lib/onboard/machine/handlers/finalization.test.ts:578, and agents/langchain-deepagents-code/manifest.yaml:23. The complete current-main comparison and focused tests were reviewed before this disposition.

@ericksoa

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 25, 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.

@ericksoa

Copy link
Copy Markdown
Member Author

Final review disposition for fe9978aed03a234025613677d0c053aa7fe02ce4 against main 7d02fef631c6fd04a8a69e9c096a4da40246d1d1:

All nine Advisor specialists completed in run 36174519840. Seven report no blocker, including documentation, customer behavior, migration, and security. CodeRabbit also completed review of the documentation correction without actionable comments.

The two repeated recommendations are not accepted as blockers for this scoped fix:

  • F-architecture-standard-work-e4ce690f322a04a6c6b9: consolidating all onboarding/status acceptance and diagnostics is a broader refactor. The cited 401/403 divergence is present on the recorded base, including its explicit 401 regression test. This PR preserves that existing contract and shares the existing agent/provider 404 exception predicate. It fixes ordinary 404 rejection without changing credential-gated acceptance. No new incorrect classification is demonstrated within that scope.
  • F-verification-mistake-proofing-f123f6b4f39d44ee3e65: the proposed production Deep Agents onboarding test assumes a path its current terminal/no-forward manifest does not execute. The existing finalization test exercises this agent and asserts that deployment verification is not called. The source and passing-test evidence are recorded in the initial disposition. Introducing a synthetic supported onboarding path or changing terminal-agent behavior is outside this fix.

The Advisor's derived blocker job therefore remains red because it counts these recommendations; this is a maintainer disposition of the recommendations, not a claim that the job passed. Manual E2E recommendations remain advisory and no full PR E2E run is claimed.

Required CI is green on the final commit. The ShellCheck report job was retried once after GitHub's analysis-ingestion service returned Unknown Error; the retry succeeded without a code change. All seven commits are GitHub Verified. The runtime code is unchanged from the locally reproduced and tested candidate; the final added commit only corrects the owning inference-route guide.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit fe9978a. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

Request review only when Require no Advisor blockers is green.

All previous runs

@ericksoa
ericksoa marked this pull request as ready for review September 25, 2026 18:45
@ericksoa

ericksoa commented Sep 25, 2026 •

Copy link
Copy Markdown
Member Author

Merge decision for fe9978aed03a234025613677d0c053aa7fe02ce4: required code CI, security scanning, managed-image validation, and Docker/rootless Podman all-agent activation passed. CodeRabbit is clear, all seven commits are Verified, and no review threads remain open. The complete Advisor disposition is recorded above.

The local checker flags the latest metadata-only changes: SKIPPED context. The actual code run for this exact commit/base passed both changes and checks; the skipped metadata run does not replace that code evidence. No CI policy or test was weakened.

Applying the maintainer-authorized admin merge because this account authored the replacement and cannot submit a self-approval. The repository requires a squash merge. The contributor's signed commits remain intact in the PR history, and the squash commit will credit Harjoth as co-author.

@ericksoa
ericksoa merged commit 3a03ce7 into main Sep 25, 2026
124 checks passed
@ericksoa
ericksoa deleted the codex/pr10609-models-404 branch September 25, 2026 19:02
ericksoa added a commit that referenced this pull request Sep 25, 2026
## Outcome

PR description edits no longer make the maintainer checker reject
successful code CI as `changes: SKIPPED`. The checker recognizes the
current metadata-only workflow while retaining rejection of unknown or
incomplete job evidence.

## Reason

The current PR workflow defines 14 jobs. The checker still expects 11
names: it omits four current jobs and includes the retired
`wechat-runtime-audit` job. This mismatch reproduced during review of
#12339.

## Changes

- Match the current workflow by adding `compile-artifacts`,
`hugging-face-models`, `openshell-sdk-package`, and
`real-openclaw-dist-harness`, and removing `wechat-runtime-audit`.
- Update the synthetic workflow fixture and cover metadata edits before
and after a successful code run, plus rejection of an unknown job.
- Preserve existing repository, PR, head/base commit, branch, workflow,
event, run, attempt, job, and status validation.
- Include current main so the branch consumes the already-merged
onboarding lock repair in #10465. The net PR remains three files: the
checker job list and its tests.

## Verification

- 125 focused tests passed across `check-gates-actions-evidence`,
`check-gates-final-snapshot`, `check-gates-compliance`,
`triage-runtime`, and `onboard-session-cross-process-lock`.
- Replayed the 14-job shape from actual metadata run
[36175699914](https://github.com/NVIDIA/NemoClaw/actions/runs/36175699914)
through the checker with synthetic, authenticated run identities.
Current main rejected valid code evidence as `changes: SKIPPED`; the
candidate accepted it. Both rejected an added unknown job. The replay
used fake GitHub responses and a temporary home without host credential
environment variables.
- Confirmed the candidate's 14 names match both current
`.github/workflows/pr.yaml` and that actual metadata run, with no
missing or retired names.
- `git diff --check` passed. The diff contains no secrets, API keys, or
credentials.

## Review notes

This changes the protected maintainer checker at
`.agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts`. Manual
review of the five-line production diff and its tests found no weakened
identity or required-check control. Nine-category security review found
no blocker. The candidate checker is exercised as the subject of
isolated tests; it is not its own approval authority. Approval
validation uses the unchanged checker from canonical main plus direct
review of this correction.

This internal correction changes no end-user runtime or sandbox
behavior, so no live E2E or public documentation change is needed. Fresh
CI and scheduled review results are collected on this PR's published
commit.

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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Updated CI handling for pull request metadata edits so results remain
passing when edits occur before or after a successful workflow run.
* CI now flags edited workflows that contain an unrecognized skipped
job, helping surface incomplete or unexpected check results.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Apurv Kumaria <[email protected]>
Signed-off-by: Prekshi Vyas <[email protected]>
Signed-off-by: Rebecca Sliter <[email protected]>
Signed-off-by: Aaron Erickson <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Prekshi Vyas <[email protected]>
Co-authored-by: Prekshi Vyas <[email protected]>
Co-authored-by: Rebecca Sliter <[email protected]>
Co-authored-by: Aaron Erickson <[email protected]>
@wscurran wscurran added the area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow label Oct 14, 2026
@wscurran wscurran added area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior integration: hermes Hermes integration behavior integration: openclaw OpenClaw integration behavior labels Oct 14, 2026
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: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior integration: hermes Hermes integration behavior integration: openclaw OpenClaw integration behavior

Projects

None yet

3 participants