fix(onboard): guide users to a compatible endpoint or agent when Chat Completions is missing#6769
fix(onboard): guide users to a compatible endpoint or agent when Chat Completions is missing#6769laitingsheng wants to merge 3 commits into
Conversation
… Completions is missing When onboarding an agent that requires the OpenAI Chat Completions surface (such as Deep Agents) against an Anthropic-compatible endpoint that does not serve /v1/chat/completions, the validation failure now prints an actionable next step: use an OpenAI-compatible endpoint, or switch to an Anthropic-native agent (openclaw or hermes). The hint prints before the non-interactive exit and is gated on a missing-surface (404) probe result so genuine auth or server errors are not misdirected. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
📝 WalkthroughWalkthroughAdds OpenAI Chat Completions surface guidance to custom Anthropic endpoint validation and tests 404, native Anthropic, and authentication failure behavior. ChangesAnthropic validation guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage remains at 96%, unchanged from the branch. Updated |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings This is an automated review. Required findings need action before merge. Warnings and optional suggestions do not require a response or follow-up. A human maintainer makes the final merge decision. |
|
✨ Thanks for the fix, @laitingsheng. Adding actionable guidance when an Anthropic-only endpoint is used with an OpenAI-completions agent will help users self-correct. Ready for maintainer review. Related open issues: |
Hermes on a compatible-Anthropic endpoint is force-routed to the OpenAI Completions surface by resolveAgentInferenceApi (src/lib/inference/config.ts, #6289 duplicate message_start workaround), so recommending `nemohermes onboard` as an Anthropic-native fallback would hit the same missing /v1/chat/completions failure again. Guidance now only points to the supported OpenClaw path; the guidance test asserts nemohermes is absent. Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
cjagwani
left a comment
There was a problem hiding this comment.
Requesting one focused correctness change on exact head d40eb014cec20f591f0466591f351008acb8c747.
[P2] A raw HTTP 404 does not prove that /v1/chat/completions is absent. A valid Chat Completions endpoint can return 404 because the selected model is unknown or unavailable. NemoClaw already distinguishes that case: classifyValidationFailure recognizes model-not-found messages before its generic endpoint-404 classification, and this caller allows model retry. With a probe failure such as HTTP 404 + model foo not found, the current patch prints “the endpoint does not serve it” and recommends switching endpoints/agents while recovery simultaneously offers a model retry.
Please gate the new guidance on the existing endpoint failure classification (rather than status alone) and add a negative test for a model-specific 404. The bare-route 404 and auth 403 cases should retain their current behavior.
Separately, the implementation is correct to omit Hermes: current Hermes custom-Anthropic routing also requires Chat Completions due #6289. Please reconcile the PR body and linked issue, which still promise an OpenClaw-or-Hermes fallback, before closure.
E2E Target Results — ✅ All requested tests passedRun: 29272804761
|
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Summary
When onboarding selects an agent that requires OpenAI Chat Completions (such as Deep Agents) against an Anthropic-compatible endpoint that does not serve
/v1/chat/completions, validation now prints an actionable next step before exiting: use an OpenAI-compatible endpoint or switch to OpenClaw. The guidance uses the same failure classification as recovery, so a model-specific404continues to offer a model retry without incorrectly claiming the route is absent.Related Issue
Fixes #6765
Changes
intendedApi === "openai-completions"and the existing endpoint failure classification. Authentication errors, transport errors, and model-specific404responses do not print route-missing guidance.404, a model-specific404, a native Anthropic failure, and an authentication failure.No new abstraction, configuration, fallback, or compatibility path is introduced.
Type of Change
Quality Gates
Verification
Verifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpx vitest run --project cli src/lib/onboard/inference-selection-validation.test.ts→ 18 passed.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit