diff --git a/CHANGELOG.md b/CHANGELOG.md index bfb3dd5f3..ab9ab6566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -487,6 +487,16 @@ Each change merged to `main` after v4.12.30 is listed here; it moves under its r and the one after it 8. **Upgrade note:** none - documentation. A file that uses a YAML 1.1 form reads as before in a Java application; rewrite it by the table when the Rust engine or a language pack must read it too. +10. **The agent tools page says what bounds a tool and how a URL and a setting are read (the twin of mercury-python + #92 and mercury-nodejs #153).** The packs' loose-ends round changes three things a reader of the page meets. A + `file.search` by regular expression runs outside the pack's own loop and is ended at the new + `tools.file.search.timeout.ms` (10 s) with a 408, and a list or a search looks at 20,000 entries of the workspace + at most. A URL is read by the tools' own rules, the same in both packs, written back in one form and refused by + name otherwise, with `robots.txt` read by the tools' own RFC 9309 reader. And a `tools.*` setting that is no whole + number or no switch stops the pack's start by the key's name. The configuration table gains the key. **Upgrade + note:** none here - the packs' CHANGELOG entries carry it. The page describes the packs once those two pull + requests are merged. + --- ## Version 4.12.30, 11/5/2026 diff --git a/docs/guides/agent-tools.md b/docs/guides/agent-tools.md index 598ddbf90..5a87caa6f 100644 --- a/docs/guides/agent-tools.md +++ b/docs/guides/agent-tools.md @@ -75,6 +75,11 @@ followed, and refused when the result is outside the root (`..`, an absolute pat entries (a name starting with `.`) are invisible to every file tool unless `tools.file.hidden=true`. The pack's process should run as a user with no rights beyond the tree. +A model's text never decides how long the pack is busy. `file.search` with `regex: true` runs the expression +outside the pack's own loop - a child interpreter in the Python pack, a worker thread in the Node.js pack - and +ends it at `tools.file.search.timeout.ms` with a 408; a literal is a substring test. A list or a search looks at +20,000 entries of the workspace at most and says `truncated` when it stopped there. + | Route | Row | Arguments | Result and limits | | --- | --- | --- | --- | | `file.read` | `file_read` | `path`; `max_bytes` (default and cap `tools.file.max.bytes`, 256 KiB) | `{path, bytes, text, truncated}`; UTF-8 text only, a binary file is an error naming the detected type | @@ -94,6 +99,14 @@ route to a cloud metadata service or an internal admin port is closed by default `tools.web.max.bytes` (1 MiB), the request at `tools.web.timeout.ms` (10 s), and the tool identifies itself with a Mercury user agent. +A URL - the `url` argument, the `Location` of a redirect, a link of a page - is read by the tools' own rules, the +same in both packs, and written back in one form: `http` or `https`, no credentials, a host that is a name in +letters, digits, hyphens, dots and underscores (an internationalized name in its `xn--` form), an IPv4 address in +dotted decimal or an IPv6 address in brackets, a port in the digits 0 to 9, a path without `.` and `..` segments, +and at most 8192 characters. Anything else is a 400 that names the rule - `http://0177.0.0.1/` is refused, never +read as 127.0.0.1 - and a site is asked for exactly what was checked. `robots.txt` is read by the tools' own +RFC 9309 reader, the same in both packs, in a time bounded by the file's length and the path's. + | Route | Row | Arguments | Result and limits | | --- | --- | --- | --- | | `web.fetch` | `web_fetch` | `url`; `as` = `text` (default), `markdown`, `raw` | `{url, status, content_type, title, text, bytes, truncated}`; HTML reduced to readable text (scripts, styles and navigation dropped; headings, lists, code and links kept as text or Markdown); a text resource as is; `raw` the body as received; the page's own status is a result | @@ -225,6 +238,7 @@ use constrains them by grammar. | `tools.file.hidden` | `false` | expose hidden entries to the file tools | | `tools.file.write.extensions` | any | the suffixes `file.write` accepts (`.md, .txt`) | | `tools.file.line.max.chars` | `500` | the longest line `file.search` returns | +| `tools.file.search.timeout.ms` | `10000` | how long a `file.search` by regular expression may take, 100 ms at least; it is ended there with a 408 | | `tools.web.allow` | empty | the host patterns the web tools may reach; empty, they do not register | | `tools.web.allow.private` | `false` | allow loopback, private, link-local and multicast addresses | | `tools.web.max.bytes` | `1048576` | the most bytes read from one response | @@ -242,6 +256,11 @@ use constrains them by grammar. | `tools.graph.ingest.max.nodes` | `500` | the most nodes one `graph.ingest` call may carry | | `tools.time` | `true` | register `time.now` | +A setting is read by one rule in both packs. A number is a whole number, or the digits 0 to 9 as text; a time in +milliseconds is at most 2147483647; a switch is `true` or `false`, the boolean or the text in any letter case. A +value that is none of these - `yes`, `1_000`, `5.0` as text - stops the pack's start by the key's name; it is never +read as a default or as off. + ## The two packs The Python pack (`extensions/agent-tools/agent_tools.py`) and the Node.js pack (`extensions/agent-tools/agent-tools.mjs`)