hermes-agent/website/docs/guides
Teknium eab208db70
feat(hooks): spill oversized hook-injected context to disk (#20468)
Port from openai/codex#21069 ("Spill large hook outputs from context").

Both shell hooks and Python plugins can return {"context": "..."} from
pre_llm_call, which gets appended to the current turn's user message on
every subsequent API call. A plugin that emits a large blob inflates
every turn and blows out the prompt cache prefix.

- tools/hook_output_spill.py: shared helper that writes oversized
  context to $HERMES_HOME/hook_outputs/<session_id>/<uuid>.txt and
  returns a head/tail preview plus the saved path. Never raises.
- agent/turn_context.py: apply the cap at the pre_llm_call aggregation
  site (moved here from run_agent.py since the original PR), covering
  both Python plugins and shell hooks.
- agent/shell_hooks.py: reserve output_spill as a sub-key under hooks:
  so the config block doesn't emit unknown-hook-event warnings.
- Docs: document the cap + config in build-a-hermes-plugin.md.

Config (behaviour-preserving when absent):
  hooks.output_spill: enabled/max_chars/preview_head/preview_tail/directory

Tests: 14 unit tests; shell_hooks (56) and plugins (100) suites green.
E2E validated with isolated HERMES_HOME (spill, passthrough, traversal
sanitisation, reserved-key skip).
2026-07-05 13:51:26 -07:00
..
_category_.json
automate-with-cron.md
automation-blueprints.md
aws-bedrock.md
azure-foundry.md
build-a-hermes-plugin.md feat(hooks): spill oversized hook-injected context to disk (#20468) 2026-07-05 13:51:26 -07:00
cron-script-only.md
cron-troubleshooting.md
daily-briefing-bot.md
delegation-patterns.md
github-pr-review-agent.md
google-gemini.md
google-vertex.md
local-llm-on-mac.md
local-ollama-setup.md
microsoft-graph-app-registration.md
migrate-from-openclaw.md
minimax-oauth.md
oauth-over-ssh.md feat(auth): make xAI Grok OAuth device-code-only, drop loopback login 2026-07-02 13:17:41 -07:00
operate-teams-meeting-pipeline.md
pipe-script-output.md
python-library.md
run-hermes-with-nous-portal.md feat(auth): make xAI Grok OAuth device-code-only, drop loopback login 2026-07-02 13:17:41 -07:00
run-nemotron-3-ultra-free.md feat(auth): make xAI Grok OAuth device-code-only, drop loopback login 2026-07-02 13:17:41 -07:00
team-telegram-assistant.md
tips.md docs: warn that mid-session model switches break prompt caching (#58747) 2026-07-05 04:34:05 -07:00
use-mcp-with-hermes.md
use-soul-with-hermes.md
use-voice-mode-with-hermes.md
webhook-github-pr-review.md
work-with-skills.md
xai-grok-oauth.md feat(auth): make xAI Grok OAuth device-code-only, drop loopback login 2026-07-02 13:17:41 -07:00