Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(goldens): tools-json and the tool reference carry the one-selector rule

garrytanbecf6042f23c
diff --git a/docs/mcp/TOOL_REFERENCE.md b/docs/mcp/TOOL_REFERENCE.md
index 6e68e2c5cf..5795d4e53f 100644
--- a/docs/mcp/TOOL_REFERENCE.md
+++ b/docs/mcp/TOOL_REFERENCE.md
@@ -184,7 +184,9 @@ Read a page by slug (supports optional fuzzy matching). Slug aliases left by ren
| `include_quarantined` | boolean | Admin scope only: return a quarantined page's body to a remote caller (default: false). Ignored without the admin scope; trusted local reads always include it. |
| `section` | string | Only the section under this heading (case-insensitive, first match), with `heading_path`, `line_start` and `line_end`. Accepted on the starter surface; advertised on full. |
| `grep` | string | Only the paragraphs containing this text (case-insensitive substring, not a regex), with line numbers and `total_matches`. Accepted on the starter surface; advertised on full. |
-| `context` | number | With grep: paragraphs of context either side (default 1, max 5). |
+| `context` | number | Applies only with grep (ignored without it): paragraphs of context either side (default 1, max 5). |
+
+The window parameters (`lines`, `bytes`, `around_chunk_id`, `cursor`) are advertised on the full surface. Pass at most one of them; a call with two refuses, and its fix is the same call with the first selector alone and `body: "window"`.
## `get_recent_salience`
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index 89ce85210a..a6bd83ffc0 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 268402,
- "stdoutSha256": "164933868b081b3f0b4669d0e2f1da3d355a5b548ba877870e63299786db1e98",
+ "stdoutBytes": 268798,
+ "stdoutSha256": "7e8ad692baa54268f6f79bf3109bfb03bf6c29119f65624e8847aff30963f591",
"toolNames": [
"remember",
"entity",
@@ -422,7 +422,7 @@
"scope": "write"
},
{
- "description": "Read a page; `section` or `grep` reads one part. Edit: include_content:true, `content` to put_page, or edit_page. >256 KB: outline+window, then `next`.",
+ "description": "Read a page; `section`/`grep` reads one part. Pass at most one window selector: lines, bytes, around_chunk_id or cursor (context only with grep). Edit: include_content:true, `content` to put_page, or edit_page. >256 KB: outline+window, then `next`.",
"idempotent": true,
"local_only": false,
"mutating": false,
@@ -456,7 +456,7 @@
"schema": {
"properties": {
"around_chunk_id": {
- "description": "Window around a search hit chunk_id.",
+ "description": "Window around a search hit chunk_id. One window selector only: not with lines, bytes or cursor.",
"type": "number"
},
"body": {
@@ -472,7 +472,7 @@
},
"bytes": {
"additionalProperties": false,
- "description": "Window: UTF-8 bytes of size.total_bytes, not body_bytes (snapped to a line start).",
+ "description": "Window: UTF-8 bytes of size.total_bytes, not body_bytes (snapped to a line start). One window selector only: not with lines, around_chunk_id or cursor.",
"properties": {
"length": {
"type": "number"
@@ -492,7 +492,7 @@
"type": "boolean"
},
"context": {
- "description": "With grep: paragraphs of context either side (default 1, max 5).",
+ "description": "Applies only with grep (ignored without it): paragraphs of context either side (default 1, max 5).",
"type": "number"
},
"context_lines": {
@@ -500,7 +500,7 @@
"type": "number"
},
"cursor": {
- "description": "next_cursor: read on.",
+ "description": "next_cursor: read on. One window selector only: not with lines, bytes or around_chunk_id.",
"type": "string"
},
"fuzzy": {
@@ -537,7 +537,7 @@
},
"lines": {
"additionalProperties": false,
- "description": "Window: 1-based lines.",
+ "description": "Window: 1-based lines. One window selector only: not with bytes, around_chunk_id or cursor.",
"properties": {
"count": {
"type": "number"