Skip to content

fix(honcho): pass user_message as search_query for topic-relevant context (salvage #17021) - #20178

Merged
teknium1 merged 2 commits into
mainfrom
salvage/pr-17021
May 5, 2026
Merged

fix(honcho): pass user_message as search_query for topic-relevant context (salvage #17021)#20178
teknium1 merged 2 commits into
mainfrom
salvage/pr-17021

Conversation

@teknium1

@teknium1 teknium1 commented May 5, 2026

Copy link
Copy Markdown
Contributor

Salvages @qxxaa's PR #17021 onto current main.

What it does

get_prefetch_context() accepted user_message but intentionally discarded it to avoid exposing content in access logs. The reasoning was inconsistent (Honcho persists every message via saveMessages anyway) and meant Honcho returned full peer representations in insertion order — so when contextTokens was set, raw observations filled the budget first and the most useful parts (peer card, dialectic conclusions) got truncated.

Changes

  • plugins/memory/honcho/session.py — pass user_message as search_query to _fetch_peer_context so Honcho's semantic retrieval returns topic-relevant conclusions on cold start.
  • scripts/release.py — AUTHOR_MAP entry for qxxaa.

_fetch_peer_context already accepts search_query and passes it through to the Honcho API — this PR just connects the two.

Validation

tests/ -k honcho — 290 passed locally.

Closes #17021 via salvage.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers labels May 5, 2026
@teknium1
teknium1 force-pushed the salvage/pr-17021 branch from ed967bf to 67e27ea Compare May 5, 2026 11:45
qxxaa and others added 2 commits May 5, 2026 05:00
The user_message parameter was accepted by get_prefetch_context but intentionally discarded, with the rationale that passing it would
expose conversation content in server access logs.

This rationale is inconsistent: Honcho already persists every message in full via saveMessages. The content is already in the database. A search query in an access log adds negligible additional exposure, and is moot for self-hosted Honcho deployments where the operator owns the logs.

Without search_query, Honcho returns the full peer representation -
all observations, deductive/inductive layers, and peer card - in
insertion order. When contextTokens is set, the most useful parts
(peer card, dialectic conclusions) are truncated because raw
observations fill the budget first.

Passing user_message as search_query enables Honcho's semantic
retrieval to return only conclusions relevant to the current session
topic, reducing injection noise and improving context quality on cold starts.

The _fetch_peer_context method already accepts and passes search_query to the Honcho API. This change simply connects the two.
@teknium1
teknium1 force-pushed the salvage/pr-17021 branch from 67e27ea to c85cd29 Compare May 5, 2026 12:01
@teknium1
teknium1 merged commit 4f76166 into main May 5, 2026
9 of 10 checks passed
@teknium1
teknium1 deleted the salvage/pr-17021 branch May 5, 2026 12:01
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.

3 participants