Repository navigation
Add web_fetch for every provider, and AI_AGENT for every command - #306
Conversation
A bot whose context left turns out could only read them by number, so it had to guess where something was said. `history` now takes `query` (and `before` to continue): it walks the lineage newest first, leaves out the turn the search runs in, and lists up to 20 matches with their turn, item type and the text around each, ignoring ASCII case. It stops at a turn boundary after 20 matches or 64 MiB of items and names that turn as `next_before`. The context note now mentions the search. Borrowed from fx, whose compacted turns are searchable by text. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
A multiline item reads with its whitespace compacted, so a query copied from a history page may not occur in the item as stored. The raw-item prefilter now passes multiline items through to the view check. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
Search is what a bot's provider offers, so Claude on Bedrock and other gateways had no way to read a web page. `web_fetch` reads one http or https URL from the daemon: up to ten redirects within 30 seconds, at most 4 MiB of body, text only. HTML comes back as Markdown with its title and links made absolute; past 64 KiB the result shows the start and end and keeps the whole as the call's `text` artifact for `read`. A status outside 2xx marks the result failed. Clients give it to every new bot unless `web_search = "disabled"`. It is gated like any other tool, and `auto` judges it, since its URL leaves the machine. Commands now also get AI_AGENT=agent, the variable fx sets so tools can tell an agent runs them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13cf4f70f4
ℹ️ 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".
Codex's review of #306: skipping hidden elements copied the rest of the page each time, so many of them made conversion quadratic, and it ran on the daemon's one runtime thread; deep lists indented without bound; code blocks lost blank lines; a literal < swallowed text up to the next >; and Latin-1 pages were misread as UTF-8. Conversion now runs on a blocking thread, finds a hidden element's close tag without copying, indents at most 8 levels and cuts Markdown at 8 MiB. Code blocks keep their lines as they are, a < that opens no tag is text, and Latin-1 reads as windows-1252, as browsers read it; other charsets are refused with web_fetch_charset. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7dd4b0fe11
ℹ️ 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".
Codex's second review of #306: charset= anywhere in a page's first KiB picked its decoder, so text that named one could; a base element was ignored, sending relative links to the wrong place; and unclosed links kept piling up resolved targets. Now only a meta tag declares a charset, base moves where relative links lead, and an opening link ends the one still open, as HTML has it, so at most one is pending. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbfd5cf7ba
ℹ️ 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".
…and read attributes whole Codex's third review of #306: decoding a large body still ran on the runtime thread; a page past 1 MiB was kept as its head and tail with nothing marking the gap, as a shell stream marks it; and an attribute name inside another attribute's quoted value was taken for the real one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEJ3nWi13hKbRCL7Hh
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47945cbad0
ℹ️ 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 second set of items borrowed from fx (vercel-labs/fx at
30b6bac), after #299.web_fetch
web_searchonly exists where a bot's provider offers it. That left Claude on Bedrock with no way to read a web page, and ChatGPT-login bots and other gateways with only what their search returns.web_fetchis a daemon tool, so it works on every provider. fx and Claude Code both have one.{"url"}, http or https only. Redirects are followed up to ten times, the request times out after 30 s, and at most 4 MiB of body is read. A type that isn't text is refused withweb_fetch_not_text.src/tools/fetch.rsis a small converter with no new dependency, using thereqwestthe daemon already has.textartifact, whichreadpages, the same way shell streams work. A status outside 2xx marks the result failed.web_search = "disabled", the setting that already turns web access off.UNGATEDorAUTO_UNGATED: it is gated like any other tool, andautojudges it, because the URL it is given leaves the machine.docs/RUST_PROTOTYPE.md(tools and web),docs/CLI.md,README.md.AI_AGENT
Shell commands now get
AI_AGENT=agentbesideTERM=dumband the pagers. fx sets the same variable so that tools can tell an agent is running them. As with the other variables, a value the caller or bot sets still wins.Daemon cost
Nothing changes on a turn's path. The fetch runs only when a bot calls it, uses one lazily built HTTP client shared by all bots, holds no process slot, and adds no store job. Its result is stored like any other tool result.
Tests
fetch.rs: HTML to Markdown (headings, links, lists, code, tables, entities, hidden elements, comments, broken markup) and URL checks.tool_contract: a local HTTP server serves an HTML page, a long page (artifact kept, start and end shown), a 404 (failed result) and a PNG (web_fetch_not_text). It also checks theAI_AGENTvalue in the shell environment.agent-client: default tools now includeweb_fetch, and leave it out when web search is disabled.cargo test, clippy and fmt pass locally. The full runtime suite passes locally excepttest_served's two task tests, which need bubblewrap and this container doesn't have it.