Repository navigation
fix(onboard): bound chat tool-call validation output - #4532
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe Chat Completions tool-call validation request now includes ChangesChat Completions Tool-Call Probe Output Constraints
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: None Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 0 worth checking, 0 nice ideas This is an automated advisory review. A human maintainer must make the final merge decision. |
Selective E2E Results —
|
| Job | Result |
|---|---|
| gpu-e2e | ⏭️ skipped |
|
/run gpu-e2e |
|
/run kimi-inference-compat-e2e onboard-inference-smoke-e2e |
jyaunches
left a comment
There was a problem hiding this comment.
Requesting changes — E2E coverage gap
⚠️ Note on stance: We are being extremely cautious here given proximity to Computex. The fix itself is sound and low-risk in isolation, but the onboarding probe path is a launch-blocker if it regresses, so we are holding the bar higher than usual on regression coverage before merge.
Summary of findings
The change is well-scoped (adds max_tokens: 256 and stream: false to probeChatCompletionsToolCalling) and the unit test correctly asserts the retry payload shape. CodeRabbit and the PR Review Advisor both report 0 actionable findings. However, two coverage concerns warrant attention before merge:
1. The E2E Advisor flagged a missing hermetic regression guard — not yet added
Quoting the advisor's own recommendation on this PR:
strict Chat Completions tool-call probe payload (medium): Existing E2E coverage does not provide a cheap hermetic install/onboard flow that directly asserts strict Chat Completions validation sends bounded non-streaming payloads and succeeds/fails against a mock OpenAI-compatible endpoint without requiring GPU/Ollama.
Suggested test: Add a PR-safe hermetic E2E that onboards a custom/local OpenAI-compatible mock requiring structured tool_calls, captures the validation request, and asserts
tool_choice=required,max_tokens=256,stream=false, and bounded retry behavior.
This was not added in this PR. Verified:
- PR diff = 2 files only (
onboard-probes.ts,onboard-probes.test.ts). - No new entry in
test/e2e/or.github/workflows/regression-e2e.yaml. - No tracking issue filed.
requireChatCompletionsToolCalling: true is set in exactly one callsite (src/lib/onboard.ts:6012, the local Ollama onboard path), so gpu-e2e is currently the only test that exercises this code path end-to-end. That's a single point of failure for a probe that gates onboarding success.
2. Thinking-model carve-out gap
getChatCompletionsProbePayload already special-cases DeepSeek-V4-Pro and Kimi-K2.6 with chat_template_kwargs: { thinking: false } and tuned max_tokens (8192 / 8). The patched probeChatCompletionsToolCalling, however, applies the same 256-token cap to every model with no thinking: false hint.
Failure mode: a reasoning model that emits a thinking trace before the tool call could exhaust 256 tokens of internal reasoning and never emit tool_calls → false-negative onboarding probe failure for those models. Today this is theoretical (only Ollama hits this gate), but if the gate is ever extended to other providers it becomes a regression vector.
Requested changes before merge
Required:
- Add a hermetic E2E (per the advisor's suggestion) under
test/e2e/— onboard against an OpenAI-compat mock requiring structured tool_calls, assert the bounded-payload shape and retry behavior. Wire it intoregression-e2e.yaml.
Acceptable alternative if (1) is too large for this PR:
2. File a follow-up issue tagged e2e-gap capturing the advisor's hermetic-test suggestion AND the thinking-model carve-out concern. Reference the issue from a comment in probeChatCompletionsToolCalling. Merge this PR only after the issue is filed and linked.
Independent of (1)/(2):
3. Add a brief code comment near the new max_tokens: 256 noting that the cap assumes non-reasoning output and may need a thinking-model carve-out if requireChatCompletionsToolCalling is ever extended beyond Ollama.
Why we're holding this line
Pre-Computex, the onboarding flow is the most user-visible failure surface we have. A bounded-output cap that's too tight, or a stream: false mismatch, would silently break onboarding for whichever models slip into the strict probe path next. The unit test catches payload-shape regressions, but not behavioral regressions against a real (or hermetic) endpoint. Closing that gap before merge — even with a follow-up issue — keeps us covered through the launch window.
Summary
Bounds strict chat-completions tool-call validation requests by setting
max_tokensandstream: false. This keeps slow local inference models from continuing generation until the host-side curl process timeout kills onboarding validation.Related Issue
Refs #4501
Changes
max_tokens: 64andstream: falseto the strict chat-completions tool-call probe payload insrc/lib/inference/onboard-probes.ts.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Bug Fixes
Tests