fix(cron): warn when allowed web_search has no provider#97677
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 4:39 AM ET / 08:39 UTC. Summary PR surface: Source +149, Tests +170. Total +319 across 5 files. Reproducibility: yes. source-level reproduction is high confidence: current main can expose web_search while provider availability is only discovered if the tool executes, and cron diagnostics do not warn for a successful model apology response. I did not run a live cron job in this read-only review. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one native-aware, provider-selection-based cron diagnostic fix with regression coverage, then close the linked issue and supersede the remaining duplicate PRs. Do we have a high-confidence way to reproduce the issue? Yes, source-level reproduction is high confidence: current main can expose web_search while provider availability is only discovered if the tool executes, and cron diagnostics do not warn for a successful model apology response. I did not run a live cron job in this read-only review. Is this the best way to solve the issue? Yes, this is the right fix shape: a non-fatal cron preflight diagnostic using the existing tool-policy matcher, native-search suppression check, and runtime provider-selection path. Failing the run hard or only warning at job creation would be less compatible and less reliable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ff1e7e1305cc. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +149, Tests +170. Total +319 across 5 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
What Problem This Solves
web_searchthroughtoolsAlloweven when no managed web search provider is actually selected.web_searchtool cannot produce useful results.Why This Change Was Made
toolsAllowrequestsweb_searchbut provider selection resolves to empty.web_searchis intentionally suppressed.User Impact
web_searchtool.Evidence
Real behavior proof
Behavior addressed: Explicit cron
toolsAllowrequests forweb_searchnow produce diagnostics when runtime provider selection has no selected managed provider.Environment tested: Linux, Node with
tsx, local OpenClaw source checkout on branchfix/97654-web-search-tools-allow-diagnostic.Steps run after the patch: Called the actual runtime provider selection function and the actual cron diagnostic helper from source.
Evidence after fix:
node --import tsx --no-warnings -e "import { resolveWebSearchProviderId } from './src/web-search/runtime.ts'; import { createCronRunDiagnosticsFromMissingWebSearchProvider } from './src/cron/run-diagnostics.ts'; const providers = [{ id: 'duckduckgo', pluginId: 'duckduckgo', requiresCredential: false }]; const selectedProvider = resolveWebSearchProviderId({ config: {}, providers }); const diagnostics = createCronRunDiagnosticsFromMissingWebSearchProvider({ toolsAllow: ['web_search'], hasWebSearchProvider: Boolean(selectedProvider), nowMs: () => 123456 }); console.log(JSON.stringify({ selectedProvider: selectedProvider || null, diagnostics }, null, 2));"Output:
{ "selectedProvider": null, "diagnostics": { "summary": "web_search tool requested in toolsAllow but no web search provider is selected. Configure one with: openclaw configure --section web, or set tools.web.search.provider.", "entries": [ { "ts": 123456, "source": "cron-preflight", "severity": "warn", "message": "web_search tool requested in toolsAllow but no web search provider is selected. Configure one with: openclaw configure --section web, or set tools.web.search.provider.", "toolName": "web_search" } ] } }Observed result: Provider selection was empty and the cron diagnostic contained the warning that tells operators to configure or select a provider.
Not tested: A live gateway cron execution with real external search credentials was not run.
Impact Assessment
Closes #97654