Skip to content

fix(agents): keep web_search runtime providers visible#76685

Merged
clawsweeper[bot] merged 1 commit intomainfrom
codex/web-search-runtime-provider-discovery
May 3, 2026
Merged

fix(agents): keep web_search runtime providers visible#76685
clawsweeper[bot] merged 1 commit intomainfrom
codex/web-search-runtime-provider-discovery

Conversation

@amknight
Copy link
Copy Markdown
Member

@amknight amknight commented May 3, 2026

Summary

  • Keep agent web_search on runtime/installed provider discovery when runtime web-search metadata is missing.
  • Preserve bundled-only lookup when runtime metadata explicitly selects a bundled provider.
  • Add regression coverage for configured runtime providers without runtime metadata.
  • Add an unreleased changelog entry.

Root Cause

The agent web_search wrapper derived preferRuntimeProviders from the presence of runtime metadata. When metadata was absent, it passed false, which made runWebSearch resolve only bundled web-search candidates. That could hide externally installed official providers such as Brave even though CLI web-search provider discovery found them.

Validation

  • pnpm test src/agents/tools/web-tools.enabled-defaults.test.ts
  • pnpm test src/agents/tools/web-tools.enabled-defaults.test.ts src/web-search/runtime.test.ts src/plugins/web-search-providers.runtime.test.ts src/secrets/runtime-web-tools.test.ts
  • pnpm exec oxfmt --check --threads=1 src/agents/tools/web-search.ts src/agents/tools/web-tools.enabled-defaults.test.ts CHANGELOG.md
  • pnpm check:changed

Fixes #76626.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels May 3, 2026
@amknight amknight marked this pull request as ready for review May 3, 2026 12:53
@amknight
Copy link
Copy Markdown
Member Author

amknight commented May 3, 2026

/clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 3, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 3, 2026

Codex review: passed.

Summary
The PR changes the agent web_search wrapper to keep runtime provider discovery enabled when runtime metadata is absent, adds focused regression coverage, and records an unreleased changelog fix.

Reproducibility: yes. at source level: current main passes preferRuntimeProviders: false when runtime web-search metadata is missing, which forces bundled-only resolution. The linked issue supplies live Brave CLI-vs-agent evidence; this read-only review did not rerun a live Gateway call.

Next step before merge
No repair lane is needed; the PR is already the narrow fix and should proceed through the exact-head CI/automerge gate.

Security
Cleared: The diff only changes existing provider-selection logic, a regression test, and changelog text; it adds no dependencies, workflows, permissions, downloads, or new secret-handling paths.

Review details

Best possible solution:

Land the PR after exact-head checks complete, keeping agent web_search aligned with CLI runtime provider discovery without changing the bundled-provider fast path for explicit bundled metadata.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main passes preferRuntimeProviders: false when runtime web-search metadata is missing, which forces bundled-only resolution. The linked issue supplies live Brave CLI-vs-agent evidence; this read-only review did not rerun a live Gateway call.

Is this the best way to solve the issue?

Yes. The PR makes the smallest maintainable change in the agent wrapper, preserving bundled-only behavior for explicit bundled metadata while allowing runWebSearch's runtime-provider discovery when metadata is absent.

What I checked:

  • Current-main bug path: On current main, createWebSearchTool derives preferRuntimeProviders from Boolean(runtimeProviderId), so absent runtime web-search metadata makes the agent pass false. (src/agents/tools/web-search.ts:100, fc570d0e58f7)
  • Bundled-only consequence: runWebSearch defaults preferRuntimeProviders to true, but when false the resolver uses resolvePluginWebSearchProviders with origin: "bundled", excluding installed external runtime providers. (src/web-search/runtime.ts:249, fc570d0e58f7)
  • Documented expected behavior: The docs say that after choosing/configuring a provider the agent can call web_search, and the Brave docs show tools.web.search.provider: "brave" plus plugins.entries.brave.config.webSearch as the canonical config shape. Public docs: docs/tools/web.md. (docs/tools/web.md:41, fc570d0e58f7)
  • Brave provider contract: The Brave plugin manifest declares the webSearchProviders contract for provider id brave while activation.onStartup is false, matching the linked issue's observation that forced startup activation works around provider invisibility. (extensions/brave/openclaw.plugin.json:34, fc570d0e58f7)
  • Patch behavior: The PR changes the agent wrapper to pass preferRuntimeProviders true when runtimeProviderId is missing, while still preserving bundled-only lookup when runtime metadata explicitly names a bundled manifest owner. (src/agents/tools/web-search.ts:100, e7f379c68d23)
  • Regression coverage: The PR adds a test for configured runtime providers without runtime metadata and asserts runWebSearch receives preferRuntimeProviders: true. (src/agents/tools/web-tools.enabled-defaults.test.ts:170, e7f379c68d23)

Likely related people:

  • steipete: Current blame for the agent web_search wrapper points to recent maintenance, and nearby history includes late-bound managed runtime config plus web-search abort-signal work in this area. (role: recent maintainer; confidence: high; commits: 5ab4e6f9d962, 44dd5d84942a, 1143f7384233; files: src/agents/tools/web-search.ts, src/agents/openclaw-tools.ts, src/agents/tools/web-tools.enabled-defaults.test.ts)
  • gumadeiras: Git history shows runtime web-search registry reuse and plugin-contract-derived provider metadata work, directly adjacent to the runtime-vs-bundled provider resolution boundary. (role: adjacent runtime registry owner; confidence: medium; commits: 9b405f88d43a, ee7f5825c85e, 3da66718f448; files: src/plugins/web-search-providers.runtime.ts, src/plugins/web-provider-runtime-shared.ts, src/web-search/runtime.ts)
  • obviyus: Recent agent tool work moved web-search provider loading away from registration-time behavior, which is adjacent to this execution-time provider visibility fix. (role: recent adjacent maintainer; confidence: medium; commits: 40b0b1bfe051; files: src/agents/tools/web-search.ts, src/agents/openclaw-tools.ts, src/web-search/runtime.ts)

Remaining risk / open question:

  • Exact-head CI was still in progress during this read-only review, so merge should wait for the automerge gate to finish on e7f379c.
  • No live Gateway plus Brave API call was run; the review relies on source inspection, docs, the linked issue's live evidence, and the PR's stated validation.

Codex review notes: model gpt-5.5, reasoning high; reviewed against fc570d0e58f7.

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 3, 2026

ClawSweeper 🐠 automerge status

ClawSweeper finished this automerge repair pass without changing the branch.

Executor outcome: source PR branch changed while the repair worker was preparing its push; requeue against the latest head.
Worker summary: this PR is the canonical, repairable in-place path for issue #76626. Current main still has the reported provider-resolution bug, the PR branch is writable and narrow, but merge/close are disallowed by the job and the hydrated check set still has one failed check plus pending checks, so the deterministic executor should repair or prove the CI failure unrelated, rerun review, and validate the same contributor branch.

Worker actions:

  • fix_needed on this PR: planned - Repair the contributor branch before any merge consideration because the canonical PR is writable and narrow but the hydrated check set is not clean and the required post-repair review gate is not present.
  • keep_related on #76626: planned - Issue Agent web_search cannot see configured Brave provider while CLI web search works #76626 is covered by the canonical PR path but should remain open because the fix has not landed and closure is outside this job.
  • build_fix_artifact on cluster:automerge-openclaw-openclaw-76685: planned - A cluster-scoped repair artifact is needed for the executor because the canonical PR is useful but not merge-ready from the hydrated artifact.

No push, rebase, replacement PR, merge, or ClawSweeper re-review happened on this pass.

fish notes: model gpt-5.5, reasoning high.

Automerge progress:

  • 2026-05-03 12:53:46 UTC review queued [`95ffd70f849c`](https://github.com/openclaw/openclaw/commit/95ffd70f849c33e5bf108ef9d875ac0be9336fc0) (queued)
  • 2026-05-03 12:54:57 UTC repair queued [`95ffd70f849c`](https://github.com/openclaw/openclaw/commit/95ffd70f849c33e5bf108ef9d875ac0be9336fc0) (autonomous) Run: https://github.com/openclaw/clawsweeper/actions/runs/25279749734
  • 2026-05-03 12:57:39 UTC review passed [`95ffd70f849c`](https://github.com/openclaw/openclaw/commit/95ffd70f849c33e5bf108ef9d875ac0be9336fc0) (structured ClawSweeper verdict: pass (sha=95ffd70f849c33e5bf108ef9d875ac0be9336...)
  • 2026-05-03 13:11:10 UTC review passed [`e7f379c68d23`](https://github.com/openclaw/openclaw/commit/e7f379c68d2363b37768aeec32d290f6778440a2) (structured ClawSweeper verdict: pass (sha=e7f379c68d2363b37768aeec32d290f677844...)
  • 2026-05-03 13:11:37 UTC merged [`e7f379c68d23`](https://github.com/openclaw/openclaw/commit/e7f379c68d2363b37768aeec32d290f6778440a2) (merged by ClawSweeper automerge)
  • 2026-05-03 13:15:56 UTC repair completed (no branch change) in 18m 11s Run: https://github.com/openclaw/clawsweeper/actions/runs/25279749734 source PR branch changed while the repair worker was preparing its push; requeue against the latest head

@amknight amknight force-pushed the codex/web-search-runtime-provider-discovery branch from 95ffd70 to e7f379c Compare May 3, 2026 13:07
@clawsweeper clawsweeper Bot merged commit ccce342 into main May 3, 2026
102 checks passed
@clawsweeper clawsweeper Bot deleted the codex/web-search-runtime-provider-discovery branch May 3, 2026 13:11
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
Summary:
- The PR changes the agent web_search wrapper to keep runtime provider discovery enabled when runtime metadata is absent, adds focused regression coverage, and records an unreleased changelog fix.
- Reproducibility: yes. at source level: current main passes preferRuntimeProviders: false when runtime web-se ... d issue supplies live Brave CLI-vs-agent evidence; this read-only review did not rerun a live Gateway call.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head e7f379c.
- Required merge gates passed before the squash merge.

Prepared head SHA: e7f379c
Review: openclaw#76685 (comment)

Co-authored-by: Alex Knight <15041791+amknight@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Summary:
- The PR changes the agent web_search wrapper to keep runtime provider discovery enabled when runtime metadata is absent, adds focused regression coverage, and records an unreleased changelog fix.
- Reproducibility: yes. at source level: current main passes preferRuntimeProviders: false when runtime web-se ... d issue supplies live Brave CLI-vs-agent evidence; this read-only review did not rerun a live Gateway call.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head e7f379c.
- Required merge gates passed before the squash merge.

Prepared head SHA: e7f379c
Review: openclaw#76685 (comment)

Co-authored-by: Alex Knight <15041791+amknight@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent web_search cannot see configured Brave provider while CLI web search works

1 participant