fix(cron): warn when web_search allowlist has no provider#97673
fix(cron): warn when web_search allowlist has no provider#97673ly-wang19 wants to merge 2 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the linked bug is real, but #97677 is the stronger canonical fix path with sufficient proof, cleaner provider-selection wording, catalog-backed native-search handling, and policy-matcher coverage. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this branch and let maintainers review or land #97677 as the canonical fix for #97654. So I’m closing this here and keeping the remaining discussion on #97677 and #97654. Review detailsBest possible solution: Close this branch and let maintainers review or land #97677 as the canonical fix for #97654. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection plus the linked issue show current main has no cron preflight diagnostic before execution, and runWebSearch only errors when the tool actually executes. Is this the best way to solve the issue? No. A cron preflight warning is the right boundary, but this branch is no longer the best landing path because #97677 covers the same issue more completely with sufficient proof. Security review: Security review cleared: The diff only changes cron diagnostic TypeScript and tests; it does not touch secrets, dependencies, workflows, package metadata, permissions, or downloaded code execution paths. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against ff1e7e1305cc. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Closing in favor of #97677 by @LiLan0125, which covers the same cron Per ClawSweeper re-review: this PR is superseded by #97677, which:
Rather than expand scope here to chase glob semantics and catalog-backed native detection, the cleaner landing path is to consolidate review on #97677. Thanks to @LiLan0125 for the more complete fix. |
Closes #97654
AI-assisted change authored in Codex.
What Problem This Solves
Cron
agentTurnjobs can explicitly settoolsAllow: ["web_search"]while no usable web search provider is selected or available. Before this change, the run could still finish asokwith a model apology and no persisted cron diagnostic, leaving operators without an actionable signal.Why This Change Was Made
This adds a narrow, non-fatal cron preflight diagnostic for the explicit
web_searchallowlist case. The diagnostic uses the same provider-selection path as the web_search runtime (listWebSearchProvidersplusresolveWebSearchProviderId) and passes the cron agent directory so auth-profile-backed provider auto-detection matches the actual tool runtime.The warning is merged into normal cron run diagnostics, delivery diagnostics, and error results. If the diagnostic availability check itself fails, the cron run remains non-fatal and records that failure as a warning instead of bypassing cron cleanup.
Refinement (re-review): the predicate also checks
resolveCodexNativeSearchActivationagainst the resolved live model. When native OpenAI/Codex hostedweb_searchwould handle the request (state === "native_active"), the warning is suppressed so operators on direct OpenAI Responses/Codex traffic do not see a misleading diagnostic. This covers the CS finding that the original predicate could warn even when native hosted search was active.User Impact
Operators get a persisted warning such as:
web_search is in toolsAllow but no web search provider is selected or available. Enable or configure one with: openclaw plugins enable duckduckgoHealthy runs with a selected provider are unchanged. Operators using native OpenAI/Codex hosted
web_searchno longer see a false positive. Wildcard/default tool access is not newly warned.Evidence
node scripts/run-vitest.mjs run src/cron/isolated-agent/run.tools-allow.test.ts src/cron/run-diagnostics.test.ts --maxWorkers=1-> 18/18 pass (8 tools-allow incl. new native_active no-warning case + 10 run-diagnostics).node scripts/run-vitest.mjs run src/agents/tools/web-tools.enabled-defaults.test.ts src/agents/tool-allowlist-guard.test.ts --maxWorkers=1-> 12/12 pass (7 web-tools enabled-defaults + 5 tool-allowlist-guard).node scripts/run-oxlint.mjs --tsconfig tsconfig.json src/cron/isolated-agent/run.ts-> clean.git diff --check origin/main...HEAD.New regression test
does not warn when native OpenAI/Codex hosted web_search is active for the resolved modelmocksresolveCodexNativeSearchActivationto returnnative_activeand asserts no diagnostic fires. The existingadds a warning diagnostic when web_search is allowed but no provider is enabledtest continues to verify the warning path when native search ismanaged_only.Autoreview history:
resolveWebSearchProviderIdto select a provider.agentDirfor agent-scoped auth-profile detection.toolsAllowcheck toSetto satisfyunicorn(prefer-set-has).