Skip to content

Commit 7739746

Browse files
committed
Fix stale line number reference in SPECIFICATION.md
ENABLE_CONTENT_REPLACEMENT is defined at src/config.ts:14, not :10. Line 10 is BEAR_DATABASE_PATH — a misleading pointer for anyone navigating to find where the gate env var is read. https://claude.ai/code/session_01CYLBNqSPLjL19SDB4kr4CY
1 parent 891ddcf commit 7739746

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/dev/SPECIFICATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The OR-rank fallthrough is deliberate. FTS5's bareword default is implicit-AND,
109109

110110
Every tool registers directly via `server.registerTool(...)` — the call shape is identical for reads and writes. Write tools additionally pass the returned `RegisteredTool` through `applyWriteGate(...)` from `src/tools/registration.ts`, which calls `RegisteredTool.disable()` when `ENABLE_CONTENT_REPLACEMENT` is `false`. The MCP SDK auto-filters disabled tools out of `tools/list` (see `dist/esm/server/mcp.js` in `@modelcontextprotocol/sdk`) and refuses any `tools/call` against them with `McpError(InvalidParams, "Tool ... disabled")` — so write tools exist in the SDK's registry but are invisible on the wire when the gate is closed.
111111

112-
The gate is the env var `UI_ENABLE_CONTENT_REPLACEMENT` (strict equality `=== 'true'`). It maps to the Claude Desktop user-config field labeled **"Edit Mode"** (the manifest's `enable_content_replacement` key with `title: "Edit Mode"`). The env var is read once at server construction in `src/config.ts:10` and never re-checked at call time.
112+
The gate is the env var `UI_ENABLE_CONTENT_REPLACEMENT` (strict equality `=== 'true'`). It maps to the Claude Desktop user-config field labeled **"Edit Mode"** (the manifest's `enable_content_replacement` key with `title: "Edit Mode"`). The env var is read once at server construction in `src/config.ts:14` and never re-checked at call time.
113113

114114
When the gate is closed (default), the server's `tools/list` returns the 4 Bear-domain read-only tools plus `bear-capabilities`, a discovery tool registered conditionally (only when the gate is closed). The `initialize` response's `instructions` field carries the unlock guidance, but it's unreliable across MCP clients (Claude Desktop and OpenCode drop it; Codex CLI reroutes it), so `bear-capabilities` surfaces the same guidance through `tools/list` — the only channel guaranteed to reach the model in every client. When the gate is open, the 12 Bear-domain tools are advertised in `tools/list` and `instructions` carries the edit-mode guidance; `bear-capabilities` is not registered because there's nothing left to unlock.
115115

0 commit comments

Comments
 (0)