Skip to content

perf: enable OpenClaw Tool Search to reduce tool schema latency#4096

Merged
cv merged 1 commit into
mainfrom
codex/openclaw-tool-search-config
May 23, 2026
Merged

perf: enable OpenClaw Tool Search to reduce tool schema latency#4096
cv merged 1 commit into
mainfrom
codex/openclaw-tool-search-config

Conversation

@ericksoa
Copy link
Copy Markdown
Contributor

@ericksoa ericksoa commented May 22, 2026

Summary

  • Enable OpenClaw native Tool Search in generated openclaw.json via tools.toolSearch: true.
  • Preserve Brave/web search config by adding tools.web.search under the existing tools object.
  • Add focused generator tests for the default and web-search config shapes.

Context

This mitigates NemoClaw #2600/#2598 and upstream openclaw/openclaw#14785 by using the native Tool Search path available in OpenClaw 2026.5.18, so OpenClaw can expose compact tool-search controls instead of sending every full tool schema when many tools are available.

Tests

  • npx vitest run test/generate-openclaw-config.test.ts
  • npx vitest run test/openclaw-tool-catalog-patch.test.ts

Summary by CodeRabbit

Release Notes

  • New Features

    • OpenClaw tool search functionality is now enabled by default in generated configuration
  • Bug Fixes

    • Fixed configuration generation to properly preserve existing tool settings when web search is enabled, preventing accidental loss of tool configurations during updates
  • Tests

    • Expanded test coverage to verify tool search enablement and web search configuration handling across different scenarios

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

The pull request enables OpenClaw tool search by default and refactors web search configuration to merge settings into an existing tools object instead of overwriting it, ensuring tool search remains enabled when web search is configured.

Changes

OpenClaw Tool Search Configuration

Layer / File(s) Summary
Tool search and web search configuration
scripts/generate-openclaw-config.py
Adds tools.toolSearch: true to the base generated config. Updates web search configuration path from wholesale assignment to setdefault merging, preserving the tool search flag and any other pre-existing tool entries.
Configuration tests
test/generate-openclaw-config.test.ts
New test asserts tool search is enabled by default. Existing web search test now verifies tool search remains enabled alongside detailed web tool configuration. Omit-web-search test confirms tool search stays enabled when web tools are absent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

Integration: OpenClaw

Poem

A rabbit hops through configs bright,
Where tools can search with newfound might—
No overwrites, just gentle blend,
Tool search and web as loyal friends,
With tests to guard each feature's light! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: enabling OpenClaw Tool Search to reduce latency, which is the primary objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/openclaw-tool-search-config

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

@github-actions
Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 1 worth checking, 0 nice ideas
Top item: Runtime-validate native Tool Search sandbox behavior

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@github-actions
Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: brave-search-e2e, cloud-e2e
Optional E2E: cloud-inference-e2e

Dispatch hint: brave-search-e2e,cloud-e2e

Auto-dispatched E2E: brave-search-e2e, cloud-e2e via nightly-e2e.yaml at 6a2656cd0d48cba71bf5b617ae5b7c41f257f153nightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • brave-search-e2e (high; live Brave Search plus NVIDIA inference, ~45 minute timeout): Most directly covers the modified tools merge path: non-interactive OpenClaw onboard with BRAVE_API_KEY, validation of tools.web.search.provider=brave in openclaw.json, secret isolation, and an OpenClaw agent web-search turn.
  • cloud-e2e (high; live NVIDIA inference, ~45 minute timeout): Central install/onboard/user-flow smoke for OpenClaw. It validates that the generated openclaw.json is accepted in a real sandbox and that an OpenClaw agent can complete a live inference turn through inference.local after the new tools.toolSearch default is present.

Optional E2E

  • cloud-inference-e2e (medium-high; live NVIDIA inference, ~30 minute timeout): Additional confidence that the OpenClaw sandbox produced by onboarding still has a valid /sandbox/.openclaw layout/openclaw.json and that inference.local works from inside the sandbox. Useful if cloud-e2e is unavailable or flaky, but it does not specifically exercise tool search.

New E2E recommendations

  • native-openclaw-tool-search (medium): Existing E2E coverage validates Brave web search config and generic OpenClaw agent turns, but no E2E appears to assert that tools.toolSearch=true is present in the sandbox openclaw.json by default or that native OpenClaw Tool Search remains usable without BRAVE_API_KEY.
    • Suggested test: Add a small OpenClaw config/runtime assertion to an existing OpenClaw onboard E2E, or create a tool-search-config-e2e that onboards without web search, reads /sandbox/.openclaw/openclaw.json, asserts tools.toolSearch is true and tools.web is absent, then performs a basic OpenClaw agent turn.

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: brave-search-e2e,cloud-e2e

@github-actions
Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: None
Optional scenario E2E: None

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • None. No scenario workflow, scenario metadata, scenario runtime, or validation-suite files changed.

Optional scenario E2E

  • None.

Relevant changed files

  • None.

@github-actions
Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26313996026
Target ref: 6a2656cd0d48cba71bf5b617ae5b7c41f257f153
Workflow ref: main
Requested jobs: brave-search-e2e,cloud-e2e
Summary: 2 passed, 0 failed, 0 skipped

Job Result
brave-search-e2e ✅ success
cloud-e2e ✅ success

@cv cv changed the title Enable OpenClaw Tool Search to reduce tool schema latency perf: Enable OpenClaw Tool Search to reduce tool schema latency May 22, 2026
@cv cv changed the title perf: Enable OpenClaw Tool Search to reduce tool schema latency perf: enable OpenClaw Tool Search to reduce tool schema latency May 22, 2026
@cv cv merged commit 4c6c203 into main May 23, 2026
32 of 36 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 28, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants