Skip to content

feat(tools): hermes-borrowed quality wins — error/summary caps + sharper tool descriptions - #2142

Merged
hongmingwang-moleculeai merged 1 commit into
stagingfrom
feat/hermes-borrowed-quality-wins
Apr 27, 2026
Merged

feat(tools): hermes-borrowed quality wins — error/summary caps + sharper tool descriptions#2142
hongmingwang-moleculeai merged 1 commit into
stagingfrom
feat/hermes-borrowed-quality-wins

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

Three small wins from the hermes-agent design survey, bundled because each is too small for its own PR but they all improve the priority adapters (claude-code + hermes) immediately.

1. Cap telemetry fields inside the helper, not at call sites

Hermes' `error_detail` cap (4096 chars) lives once, inside the helper. We had it at the call site of `tool_delegate_task` only — a future caller adding error_detail elsewhere could paste a giant stack trace and DoS `activity_logs`. Move the cap into `report_activity` so every caller benefits.

  • `error_detail`: 4096 chars (hermes' value — multi-frame stack trace fits, 100 errors/5min still <500KB)
  • `summary`: 256 chars (one-liner ceiling for canvas card)
  • `response_text`: NOT capped — that's the agent's user-visible reply; truncating would silently drop content. Pinned by a negative-pin test.

2. Sharper MCP tool descriptions

Hermes' `delegate_task` says "WAIT for the response"; `delegate_task_async` says "Returns immediately." LLMs pick the right variant from the description — ambiguity costs accuracy.

  • `commit_memory` now states it APPENDS (each call creates a row), and that GLOBAL requires tier-0
  • `recall_memory` now states it's case-insensitive substring search with no pagination, returns ALL matches, and that empty query is cheap

3. Bigger wins filed as tasks

Tests (4 new)

  • `error_detail_capped_at_max` — 50K input → 4096 stored (load-bearing assertion)
  • `error_detail_under_cap_passes_through` — short value not padded/truncated
  • `summary_capped_at_max` — 1000 chars → 256 stored
  • `response_text_NOT_capped` — negative pin: 20K reply stays 20K so capping discipline doesn't accidentally extend to user-visible content

Verification

  • 1312/1312 workspace pytest pass (was 1308, +4 new — exact match)
  • No code path changed for response_text or any payload field other than error_detail/summary

🤖 Generated with Claude Code

…arper MCP descriptions

Three small wins from the hermes-agent design survey, bundled because
each is too small for its own PR but they all improve the priority
adapters (claude-code + hermes) immediately.

1. Hermes-style cap on telemetry fields, applied INSIDE report_activity
   so every caller benefits without remembering. error_detail capped at
   4096 (hermes' value); summary capped at 256 (one-liner ceiling). The
   existing call site in tool_delegate_task already truncated error_detail
   at 4096, but moving the cap into the helper closes the door on a
   future caller pasting a giant traceback. response_text is NOT capped
   (it's the agent's user-visible reply; truncating would silently drop
   content). Pinned by 4 new tests including a negative-pin that
   response_text MUST stay untruncated.

2. Sharper MCP tool descriptions for commit_memory + recall_memory —
   hermes' delegate_task description literally says "WAIT for the response"
   and delegate_task_async says "Returns immediately." LLMs pick the
   right tool variant from descriptions; ambiguity costs accuracy.
   - commit_memory now states it APPENDS (each call creates a row, no
     overwrite) and that GLOBAL requires tier 0.
   - recall_memory now states it's case-insensitive substring search
     with no pagination, returns all matches, and that empty-query is
     cheap and safer than a narrow keyword.

3. (no code change) Filed task #120 for the bigger user-flow win — a
   per-workspace tool enable/disable menu in Canvas Config — and task
   #121 for model-string passthrough (depends on #87 universal-runtime
   refactor).

Verification:
  - 1312/1312 Python pytest pass (was 1308, +4 new)

See task #119 for the architectural follow-ups (event-log layer,
declarative skill compat, observability config block) and project
memory `project_runtime_native_pluggable.md`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merged via the queue into staging with commit efc2c9d Apr 27, 2026
14 checks passed
@molecule-ai
molecule-ai Bot deleted the feat/hermes-borrowed-quality-wins branch May 20, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant