Skip to content

fix(honcho): honor focused memory tool budgets#29403

Open
dso2ng wants to merge 1 commit into
NousResearch:mainfrom
dso2ng:fix/honcho-focused-memory-tools
Open

fix(honcho): honor focused memory tool budgets#29403
dso2ng wants to merge 1 commit into
NousResearch:mainfrom
dso2ng:fix/honcho-focused-memory-tools

Conversation

@dso2ng

@dso2ng dso2ng commented May 20, 2026

Copy link
Copy Markdown

Summary

  • pass honcho_context(query=...) through to focused Honcho peer context retrieval
  • bound honcho_search(max_tokens=...) output with deterministic token-budget trimming
  • add regression coverage for the focused-query and budget controls

Fixes #29402.

Rationale

The Honcho tool schema already advertises a focused query parameter for honcho_context and a max_tokens budget for honcho_search. Before this change, the context tool ignored query, and search_context() assembled representation/card output without applying the requested budget. That made the memory tools noisier than callers expect from focused retrieval.

This PR keeps the behavior intentionally narrow and backward-compatible: the tools still return the existing { "result": ... } shape, and it does not change peer routing semantics or introduce a new ranking API.

Test plan

  • RED verified before implementation:
    • scripts/run_tests.sh tests/honcho_plugin/test_session.py::TestPeerLookupHelpers::test_search_context_applies_max_tokens_budget tests/honcho_plugin/test_session.py::TestConcludeToolDispatch::test_honcho_context_passes_query_to_manager tests/honcho_plugin/test_session.py::TestGetSessionContextFallback::test_query_uses_focused_peer_context_even_when_session_context_is_cached -q -> 3 failing tests
  • GREEN / targeted verification:
    • scripts/run_tests.sh tests/honcho_plugin/test_session.py::TestPeerLookupHelpers::test_search_context_applies_max_tokens_budget tests/honcho_plugin/test_session.py::TestConcludeToolDispatch::test_honcho_context_passes_query_to_manager tests/honcho_plugin/test_session.py::TestGetSessionContextFallback::test_query_uses_focused_peer_context_even_when_session_context_is_cached -q -> 3 passed
    • scripts/run_tests.sh tests/honcho_plugin/test_session.py -q -> 118 passed
    • scripts/run_tests.sh tests/honcho_plugin -q -> 270 passed
    • git diff --check
    • non-ASCII added-line guard -> non_ascii_added_lines=0

Follow-ups intentionally left out

  • adding structured results arrays / top_k / score metadata
  • switching to a conclusions/query search endpoint
  • MMR/dedupe or retrieval-quality benchmarks

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers P3 Low — cosmetic, nice to have labels May 20, 2026
@dso2ng dso2ng force-pushed the fix/honcho-focused-memory-tools branch from 0410456 to 3b3ab8d Compare May 22, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Honcho memory tools ignore focused query and token budget controls

2 participants