Skip to content

fix: prevent unnecessary read_file("BOOT.md") in boot hook - #8696

Closed
malaiwah wants to merge 1 commit into
NousResearch:mainfrom
malaiwah:upstream/fix/boot-md-no-read-file
Closed

fix: prevent unnecessary read_file("BOOT.md") in boot hook#8696
malaiwah wants to merge 1 commit into
NousResearch:mainfrom
malaiwah:upstream/fix/boot-md-no-read-file

Conversation

@malaiwah

Copy link
Copy Markdown
Contributor

The boot prompt says "Follow the BOOT.md instructions below" which leads models to interpret "BOOT.md" as a file reference and call read_file("BOOT.md") — wasting a tool call that either reads content already injected inline, or fails with "File not found" in sandboxed deployments where the gateway's BOOT.md isn't accessible.

Fix: explicitly tell the model the file has already been read:

The contents of ~/.hermes/BOOT.md have already been read for you
and are provided below — do NOT attempt to read the file yourself.

Observed via MITM proxy: the boot agent makes read_file("BOOT.md") → "File not found" → search_files("BOOT.md") → "ripgrep not found" before finally processing the inline content. Two wasted tool calls per gateway restart.

The boot prompt said "Follow the BOOT.md instructions below" which
led models to interpret "BOOT.md" as a file reference and call
read_file("BOOT.md") — wasting a tool call that either reads a
file already injected inline, or fails with "File not found" in
sandboxed deployments where the file doesn't exist.

Fix: explicitly tell the model the file has already been read and
its contents are provided below. Saves one tool call per boot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@malaiwah
malaiwah force-pushed the upstream/fix/boot-md-no-read-file branch from cf92dbc to 94513f4 Compare April 13, 2026 00:37
@alt-glitch alt-glitch added type/perf Performance improvement or optimization P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery labels Apr 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Thanks for this fix! The BOOT.md built-in hook was removed entirely from main — commit b53a091 "remove: BOOT.md built-in hook (#17093)" deleted gateway/builtin_hooks/boot_md.py, so the unnecessary read this PR guarded against can no longer occur. Closing as obsolete (verified @ f64e4f4).

@alt-glitch alt-glitch closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants