fix(ce-web-researcher): use any web tool, not just Claude built-ins#836
Conversation
The agent's Step 1 precondition checked for `WebSearch` and `WebFetch` by exact name and stopped if either was missing. That blocked Codex, Gemini, Droid, and MCP web tools (Firecrawl, Brave, Tavily, Exa) even when the platform had equivalent capability under a different name. Tool mappings in user `AGENTS.md` files did not help because the agent bailed before consulting them. Step 1 now accepts any web-search/web-fetch capability (platform-native or MCP-provided) and only stops when no web tooling exists at all. The `tools:` frontmatter restriction is removed so MCP web tools become reachable on Claude Code too. Steps 2 and 4 and the Tool Guidance section refer to "web searches" and "web fetches" generally; the shell-fallback prohibition is preserved. Fixes #833
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b8a73075b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The previous Step 1 phrasing only said to stop "if no web-search or web-fetch capability is available at all," which read as stopping only when both were absent. Tighten the wording so the guard stops when either capability is missing — restoring the original behavior where the agent refused to enter a workflow it cannot complete.
The bulleted categories (platform-native, MCP, "other") implied those were the universe and missed dedicated CLI tools like ctx7 or any other shape the caller may have wired up. Reframe Step 1 and Tool Guidance around the real distinction — purpose-built web tool (any shape) vs generic network command (curl, wget) — and drop the category list in favor of a one-sentence prose statement with a few examples.
Address review feedback by removing prescription the agent does not need: - Step 1 no longer dictates an exact error string; the agent reports the unavailability in its own words. - The curl/wget prohibition is dropped from Step 1 and Tool Guidance. An agent picked for web research is not about to reach for raw network commands; the warning was spending tokens to defend against a non-issue. - Step 2 drops the prescribed "2-4 broad queries" count from both the heading and the prose. Step 6's overall stop heuristic still bounds total volume.
Per-phase query and fetch counts (3-6 narrowing, 3-5 fetches, 1-3 follow-ups) artificially capped good research. A topic might warrant one broad search and five fetches, or three searches and one fetch, or two passes of search-then-fetch-then-search; the right shape emerges from what each step uncovers. Dictating phase budgets prevented that adaptive pattern. Now: phases describe activities (scope, narrow + extract, fill gaps) not budgets. Steps 3 and 4 are merged because search and fetch interleave in real research — a fetched source often suggests the next query. The only quantitative constraint is a single hard cap on total tool calls in the Stop Heuristic, framed as a safety valve against runaway research rather than a target.
Tool calls are not comparable units — one MCP call can be worth five WebSearches, and a paginated CLI fetch is different again. A flat numeric cap created false precision while penalizing topics that legitimately needed more work. The Stop Heuristic is now grounded entirely in progress signals: sources repeating, synthesis not changing, external signal thin. The agent decides when enough is enough based on whether it is still learning, with an explicit "bias toward stopping early" framing so the absence of a numeric backstop does not become an excuse to keep going.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9a9f7464d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| name: ce-web-researcher | ||
| description: "Performs iterative web research and returns structured external grounding. Use when ideating outside the codebase, validating prior art, scanning competitor patterns, finding cross-domain analogies, or fetching market signals. Prefer over manual web searches for structured external context." | ||
| model: sonnet | ||
| tools: WebSearch, WebFetch | ||
| --- |
There was a problem hiding this comment.
Reinstate web-only tool restrictions for this agent
Removing the tools: WebSearch, WebFetch frontmatter turns this into an all-tools subagent in environments where omitted tool lists inherit the parent toolset. Because this agent explicitly consumes untrusted web content, prompt-injection failures now have access to non-web tools (e.g., shell or file mutation) instead of being sandboxed to search/fetch only, which is a material security regression from the previous configuration.
Useful? React with 👍 / 👎.
The agent's Step 1 precondition required
WebSearchandWebFetchby exact name and stopped if either was missing, blocking Codex, Gemini, Droid, and MCP web tools (Firecrawl, Brave, Tavily, Exa, Perplexity) even when the platform had equivalent capability under a different name. Tool mappings in userAGENTS.mdfiles did not help because the agent bailed before consulting them.Step 1 now accepts any web-search and web-fetch capability (platform-native or MCP-provided) and only stops when no web tooling exists at all. The
tools:frontmatter restriction is removed so MCP web tools (Firecrawl, Brave, Tavily, etc.) become reachable on Claude Code too. Steps 2 and 4 and the Tool Guidance section refer to "web searches" and "web fetches" generally; the shell-fallback prohibition (nocurl/wget) is preserved.Fixes #833