docs: trim AGENTS auto-loaded context - #53996
futuhkdata-source wants to merge 1 commit into
Conversation
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 |
tonydwb
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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_COMMANDSandapp/session/hooks/use-prompt-actions.ts, but current main usesDESKTOP_COMMAND_SPECS(apps/desktop/src/lib/desktop-slash-commands.ts:100) andapp/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 serveDesktop 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. |
There was a problem hiding this comment.
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.) |
There was a problem hiding this comment.
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.
Summary
Verification