Skip to content

docs: shrink AGENTS.md below prompt cap - #7678

Open
fortunexbt wants to merge 2 commits into
NousResearch:mainfrom
fortunexbt:docs/shrink-agents-context
Open

fortunexbt wants to merge 2 commits into
NousResearch:mainfrom
fortunexbt:docs/shrink-agents-context

Conversation

@fortunexbt

Copy link
Copy Markdown

Summary

  • trim AGENTS.md so it stays under Hermes context-file truncation limit
  • keep the core repo guidance, paths, commands, and gotchas
  • reduce injected repo-context size for local agent/dev runs

Validation

  • loaded AGENTS.md through agent.prompt_builder._load_agents_md
  • confirmed loaded content stays under CONTEXT_FILE_MAX_CHARS (14146 < 20000)
  • ran git diff --check

Trim repo guidance so AGENTS.md stays under Hermes context-file truncation
limit while keeping the critical developer instructions intact.
@alt-glitch alt-glitch added type/docs Documentation improvements P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Apr 29, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the context-file size problem. The premise remains current: AGENTS.md is 71,537 bytes while agent/prompt_builder.py:1171-1219 retains a 20,000-character default cap and truncates oversized files at agent/prompt_builder.py:1779-1816.

Problems

  • AGENTS.md:185 in this PR restores a manual model_tools.py import step, but current tool discovery imports top-level registrations automatically (tools/registry.py:58-75; current guidance at AGENTS.md:522-547).
  • AGENTS.md:225 says every config addition requires a version bump; current guidance limits bumps to active migrations (AGENTS.md:584-590).
  • AGENTS.md:338 restores MESSAGING_CWD as canonical, while current guidance uses terminal.cwd and deprecates that environment variable (AGENTS.md:636-642).

Suggested changes

  • Rebuild the concise version from current main, preserving current facts while reducing duplication.
  • Consider the linked open alternative, #53996, before selecting an in-place trim versus an extended-reference split.

This is an automated hermes-sweeper review.

Comment thread AGENTS.md
New tools require changes in 3 places:

1. Create `tools/your_tool.py`
2. Import it in `model_tools.py` inside `_discover_tools()`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This manual model_tools.py import step is obsolete. Current tools/registry.py:58-75 auto-imports top-level registry.register() modules; current guidance correctly requires only creating the tool file and adding it to a toolset (AGENTS.md:522-547).

Comment thread AGENTS.md
2. Bump `_config_version` (currently 5) to trigger migration for existing users

1. Add the key to `DEFAULT_CONFIG` in `hermes_cli/config.py`
2. Bump `_config_version` (currently 5) so existing installs migrate

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please not restore the unconditional version-bump rule. Current guidance says _config_version changes are only for active migrations; normal deep-merged config additions do not need one (AGENTS.md:584-590).

Comment thread AGENTS.md

### Background Process Notifications (Gateway)
- CLI: current directory (`os.getcwd()`)
- Messaging: `MESSAGING_CWD` env var, defaulting to the user's home directory

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MESSAGING_CWD is no longer the documented configuration mechanism. Current main uses terminal.cwd in config.yaml and treats both MESSAGING_CWD and .env-set TERMINAL_CWD as deprecated (AGENTS.md:636-642).

@teknium1 teknium1 added the sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit type/docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants