Skip to content

docs: trim AGENTS auto-loaded context - #53996

Open
futuhkdata-source wants to merge 1 commit into
NousResearch:mainfrom
futuhkdata-source:chore/trim-agents-context
Open

futuhkdata-source wants to merge 1 commit into
NousResearch:mainfrom
futuhkdata-source:chore/trim-agents-context

Conversation

@futuhkdata-source

Copy link
Copy Markdown

Summary

  • keep AGENTS.md under the Hermes context-file auto-load limit
  • move long-form TUI, skin, plugin, skill, and testing reference details into docs/development/AGENTS-extended-reference.md
  • keep concise summaries and links in AGENTS.md for always-loaded guidance

Verification

  • wc -c AGENTS.md docs/development/AGENTS-extended-reference.md
  • git diff --check

@alt-glitch alt-glitch added type/docs Documentation improvements comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have labels Jun 28, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Related: competing with OPEN #7678 (docs: shrink AGENTS.md below prompt cap). Both keep AGENTS.md under the context-file auto-load limit, but this PR splits long-form reference detail into a new docs/development/AGENTS-extended-reference.md while #7678 trims in place. Flagging the cluster so a maintainer can pick one approach.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: Approved

Trims AGENTS.md to reduce auto-loaded context size by moving extended examples and reference material to a separate file. This is a reasonable documentation reorganization for a file that is auto-loaded into every session.

  • 2 files, 633 additions, 469 deletions
  • Adds upfront note explaining the file should be concise since it is auto-loaded
  • Moves long-form TUI architecture docs, Electron desktop chat app docs, and other reference material out of the always-loaded context
  • Referenced content moved to docs/development/AGENTS-extended-reference.md (or equivalent)
  • Net reduction in context size improves prompt caching efficiency
  • No security or code quality concerns; pure documentation reorganization
  • First-time contributor credit in release.py

Reviewed by Hermes Agent

@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; current main still has a real fallback-cap exposure (agent/prompt_builder.py:1171-1219, while AGENTS.md is 71,583 bytes).

Problems

  • The added extended reference is based on a stale Desktop snapshot: it names DESKTOP_COMMANDS and app/session/hooks/use-prompt-actions.ts, but current main uses DESKTOP_COMMAND_SPECS (apps/desktop/src/lib/desktop-slash-commands.ts:100) and app/session/hooks/use-prompt-actions/slash.ts (AGENTS.md:499-503).
  • The PR is currently conflicting, and current main added material after the PR that the extraction must retain, including the hermes serve Desktop backend design (AGENTS.md:494) and corrected test-isolation guidance (AGENTS.md:1294-1297).

Suggested changes

  • Rebuild the split from current main and update the moved Desktop references before salvage.

Automated hermes-sweeper review.


**Slash commands in the desktop app are curated client-side, then dispatched to the backend.** The pipeline:

- **Backend already provides everything.** `tui_gateway/server.py` `commands.catalog` (empty-query list) and `complete.slash` (typed-query completions) both include built-in commands, user `quick_commands`, AND skill-derived commands (`scan_skill_commands()` / `get_skill_commands()`). The desktop app does not need a new RPC to see skills.

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 snapshot is stale on current main: the source-of-truth table is now DESKTOP_COMMAND_SPECS at apps/desktop/src/lib/desktop-slash-commands.ts:100, with NO_DESKTOP_SURFACE at line 186. Please update this moved reference while rebuilding the extraction from HEAD.

- **The renderer curates via `apps/desktop/src/lib/desktop-slash-commands.ts`.** This is the load-bearing file. It holds `DESKTOP_COMMANDS` (the ~19 built-ins shown in the palette) plus block-lists for terminal-only / messaging-only / picker-owned / settings-owned / advanced commands that should NOT clutter the desktop popover.
- `isDesktopSlashCommand(name)` — gates **execution**. Returns true for built-ins AND for any non-built-in (skill / quick command), so typed extension commands run.
- `isDesktopSlashSuggestion(name)` — gates **discovery/completion**. Used by BOTH completion paths in `app/chat/composer/hooks/use-slash-completions.ts` (empty-query catalog filter + typed-query `complete.slash` filter) and by `filterDesktopCommandsCatalog`.
- `isDesktopSlashExtensionCommand(name)` — true when the command is NOT a known Hermes built-in (i.e. a skill or user quick command). Both suggestion and catalog-filter paths allow extensions through so skill commands surface in the palette. (Added when fixing "skill commands missing from the desktop slash palette" — the curated allow-list was silently dropping every skill/quick command from completions even though they executed fine when typed.)

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.

Current main moved this dispatcher to apps/desktop/src/app/session/hooks/use-prompt-actions/slash.ts (runSlash at line 568); the referenced .ts path no longer exists. Please update the extended reference.

@teknium1 teknium1 added the sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users label Jul 15, 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-contained Sweeper blast radius: contained — one narrow path / opt-in / few users type/docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants