Skip to content

fix(tool-disclosure): default local Ollama/vLLM routes to direct - #12110

Closed
cestercian wants to merge 2 commits into
NVIDIA:mainfrom
cestercian:cursor/local-tool-disclosure-direct-4192
Closed

cestercian wants to merge 2 commits into
NVIDIA:mainfrom
cestercian:cursor/local-tool-disclosure-direct-4192

Conversation

@cestercian

@cestercian cestercian commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Progressive tool disclosure as the default breaks local Ollama/vLLM models that cannot drive nested tool_call / Tool Search (hundreds of malformed attempts, no reply). tools.toolSearch=false (direct) works immediately.

  • Default ollama-local and vllm-local to direct; cloud routes and llama-cpp-local stay progressive.
  • Config generation fail-safes to tools.toolSearch=false for those local routes even when NEMOCLAW_TOOL_DISCLOSURE=progressive is baked in, so managed startup can pick this up without a rebuild.
  • Recorded disclosure on reuse is unchanged (no forced recreate of an existing progressive local sandbox).

Fixes #12106

Test plan

  • CLI unit suites for tool-disclosure / registration / rebuild — 138 passed
  • Integration generate-openclaw + ollama-local propagation — 158 + 23 passed
  • Manual: local ollama sandbox gets direct in openclaw.json after start / does not loop on tool_call

Summary by CodeRabbit

  • Bug Fixes
    • Tool Search disclosure now adapts to the selected inference route.
    • Local Ollama and vLLM routes default to direct tool selection for safer, more reliable behavior.
    • Remote routes retain progressive Tool Search, including its configured limits.
    • Explicit disclosure settings continue to take precedence.
  • Tests
    • Added coverage for local and remote route defaults, sandbox creation, configuration generation, and rebuild flows.

Progressive Tool Search nests tool_call and breaks local Ollama/vLLM
models. Select direct for those routes by default and fail-safe
generated openclaw.json to tools.toolSearch=false when a local route
still has NEMOCLAW_TOOL_DISCLOSURE=progressive.
@copy-pr-bot

copy-pr-bot Bot commented Sep 19, 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 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

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: d8a1c693-af88-470f-8dd2-6f9ccf6caf57

📥 Commits

Reviewing files that changed from the base of the PR and between e38726c and d150f82.

📒 Files selected for processing (12)
  • scripts/generate-openclaw-config.mts
  • src/lib/actions/sandbox/rebuild-durable-config.test.ts
  • src/lib/actions/sandbox/rebuild-durable-config.ts
  • src/lib/onboard/machine/handlers/sandbox.ts
  • src/lib/onboard/sandbox-create/orchestration.ts
  • src/lib/onboard/sandbox-registration.test.ts
  • src/lib/onboard/sandbox-registration.ts
  • src/lib/onboard/tool-disclosure-flow.test.ts
  • src/lib/onboard/tool-disclosure-flow.ts
  • src/lib/tool-disclosure.test.ts
  • src/lib/tool-disclosure.ts
  • test/generation/generate-openclaw-tool-disclosure-config.test.ts

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


📝 Walkthrough

Walkthrough

Changes

The change adds route-aware tool disclosure resolution. ollama-local and vllm-local default to direct; remote and unknown routes default to progressive. Sandbox creation, registration, rebuilds, and generated configuration now use the selected provider route.

Tool disclosure routing

Layer / File(s) Summary
Route policy and resolution
src/lib/tool-disclosure.ts, src/lib/tool-disclosure.test.ts
Adds local-route detection and route-aware defaults. Session, sandbox, and generated configuration resolution preserve explicit values and apply local-route defaults.
Sandbox disclosure integration
src/lib/onboard/tool-disclosure-flow.ts, src/lib/onboard/machine/handlers/sandbox.ts, src/lib/onboard/sandbox-create/orchestration.ts, src/lib/onboard/sandbox-registration.ts, src/lib/actions/sandbox/rebuild-durable-config.ts, related tests
Sandbox creation and registration pass provider context into disclosure resolution. Durable rebuilds and fresh local registrations default to direct.
Generated configuration
scripts/generate-openclaw-config.mts, test/generation/generate-openclaw-tool-disclosure-config.test.ts
Generated configuration resolves disclosure from the environment, upstream provider, and provider key. Local routes use direct Tool Search, while remote routes retain progressive limits. Documentation comments describe the routing behavior.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant SandboxCreate
  participant ToolDisclosureFlow
  participant ToolDisclosure
  participant ConfigGenerator
  SandboxCreate->>ToolDisclosureFlow: pass selected provider
  ToolDisclosureFlow->>ToolDisclosure: resolve sandbox disclosure for route
  ToolDisclosure-->>SandboxCreate: return direct or progressive
  ConfigGenerator->>ToolDisclosure: resolve generated disclosure from environment and providers
  ToolDisclosure-->>ConfigGenerator: return route-aware disclosure
Loading

Suggested reviewers: ericksoa, laitingsheng

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning For [#12106], the PR implements direct defaults for ollama-local and vllm-local. It adds route-aware generated configuration and tests. It also preserves recorded disclosure for sandbox reuse and … Add a runtime fallback that detects the specified malformed tool-call patterns, switches the affected model or session to direct disclosure, and logs the fallback. Add and document a no-rebuild disclosure command or supported `openclaw conf…
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: local Ollama and vLLM routes now default to direct tool disclosure.
Out of Scope Changes check ✅ Passed The changed source and test files all support [#12106]. They implement route-aware disclosure defaults, generated configuration fallback, sandbox-state handling, and regression coverage. No unrelated …
Full details: Linked Issues check

Explanation

For [#12106], the PR implements direct defaults for ollama-local and vllm-local. It adds route-aware generated configuration and tests. It also preserves recorded disclosure for sandbox reuse and recreation unless an explicit request changes it. The PR does not implement the required runtime fallback after malformed tool_call attempts. It does not add a tools disclosure direct|progressive switch or document a no-rebuild operator path. The change list contains no troubleshooting documentation for Unknown tool id: tool_call, Provide a command to start, or repeated malformed attempts.

Resolution

Add a runtime fallback that detects the specified malformed tool-call patterns, switches the affected model or session to direct disclosure, and logs the fallback. Add and document a no-rebuild disclosure command or supported openclaw config path. Update the troubleshooting documentation with the required failure signatures and add automated tests for these requirements.

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

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

@wscurran wscurran added area: inference Inference routing, serving, model selection, or outputs area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior needs: rebase PR needs rebase or conflict resolution provider: ollama Ollama local model provider behavior provider: vllm vLLM local or hosted provider behavior labels Oct 5, 2026
ericksoa added a commit that referenced this pull request Oct 10, 2026
Use direct tools for a fresh managed OpenClaw sandbox on Ollama or vLLM.
Preserve explicit requests, established registry state, other agents,
cloud routes, and llama.cpp. Reuse the existing route reservation
classification and session checks.

Refs #12106
Replays the narrow default fix from #12110.

Co-authored-by: Cestercian <[email protected]>
Signed-off-by: Aaron Erickson <[email protected]>
@ericksoa

Copy link
Copy Markdown
Member

Thanks for the fix, @cestercian. The fresh managed OpenClaw default for local Ollama/vLLM is now on main through #12968, with you credited as co-author in the merged commit.

We replayed the narrow default change onto current code while preserving explicit requests and existing sandbox choices. CI passed, and the remaining branch E2E failures were reproduced on the exact base under our do-no-harm comparison.

Closing this as superseded by the merged replay. The replay addresses the initial default; it does not add runtime fallback for unsupported models.

@ericksoa ericksoa closed this Oct 10, 2026
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 area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior needs: rebase PR needs rebase or conflict resolution provider: ollama Ollama local model provider behavior provider: vllm vLLM local or hosted provider behavior

Projects

None yet

3 participants