Skip to content

fix(context): preserve standalone engine compression arguments - #65915

Closed
newjordan wants to merge 2 commits into
NousResearch:mainfrom
newjordan:agent/context-engine-installation
Closed

fix(context): preserve standalone engine compression arguments#65915
newjordan wants to merge 2 commits into
NousResearch:mainfrom
newjordan:agent/context-engine-installation

Conversation

@newjordan

Copy link
Copy Markdown

Summary

  • forward only the optional compression keywords a context-engine plugin declares
  • preserve /compress <focus> for engines that implement the documented focus_topic argument but not the built-in-only force extension
  • propagate implementation TypeErrors instead of masking them with a second, reduced-argument call
  • document the supported standalone context-engine install, activation, update, restart, and removal flow

Why

Hermes currently calls every engine with focus_topic and force, catches any TypeError, and retries with only current_tokens. That keeps older strict-signature plugins alive, but it also drops manual focus for current third-party engines and can execute a broken compressor twice while hiding its original error.

Signature-aware forwarding preserves backward compatibility without conflating an engine bug with an unsupported keyword. The documentation update makes the standalone route explicit for third-party engines, which aligns with the repository policy that external integrations should not be added under the core plugins/ tree.

This was exercised while building a standalone local embedding context engine that uses the existing ContextEngine and register_context_engine() surfaces; no product-specific code is added to Hermes core.

Validation

  • uv run --python 3.11 --with pytest python -m pytest -q tests/run_agent/test_compress_focus_plugin_fallback.py tests/run_agent/test_plugin_context_engine_init.py tests/agent/test_context_engine.py tests/agent/test_compress_focus.py tests/agent/test_compression_concurrent_fork.py — 64 passed
  • uvx ruff check agent/conversation_compression.py tests/run_agent/test_compress_focus_plugin_fallback.py tests/agent/test_compression_concurrent_fork.py — passed
  • npm run build from website/ — Docusaurus production build passed for English and Simplified Chinese
  • git diff --check — passed

@newjordan
newjordan force-pushed the agent/context-engine-installation branch from 6465fee to 1c45c74 Compare July 16, 2026 20:06
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/plugins Plugin system and bundled plugins sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 16, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: this narrows the same signature-aware context-engine compatibility space as #64342 and #16450. #64342 additionally carries memory-context and broader compression work, so this remains a related subset rather than a duplicate.

@newjordan newjordan closed this Jul 16, 2026
@newjordan newjordan reopened this Jul 16, 2026
@newjordan newjordan closed this Jul 16, 2026
@newjordan
newjordan deleted the agent/context-engine-installation branch July 16, 2026 20:50
@newjordan

Copy link
Copy Markdown
Author

Superseded by #65933. After triage, the runtime portion was removed to avoid duplicating #16450 and #64342; the replacement retains only the standalone context-engine documentation. The original head branch was deleted while closing this PR, and GitHub will not reopen a PR after that branch is recreated, so #65933 carries the recovered docs-only commit.

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 comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants