Skip to content

feat(honcho): optional lightweight cached startup context for recallMode=tools#2164

Open
teyrebaz33 wants to merge 1 commit into
NousResearch:mainfrom
teyrebaz33:honcho-tools-startup-context
Open

feat(honcho): optional lightweight cached startup context for recallMode=tools#2164
teyrebaz33 wants to merge 1 commit into
NousResearch:mainfrom
teyrebaz33:honcho-tools-startup-context

Conversation

@teyrebaz33

Copy link
Copy Markdown
Contributor

Closes #2150

What

Adds an opt-in background prewarm for recallMode=tools that fetches a small user snapshot (representation + peer card) from Honcho on /new or session reset, and injects it into the first real turn's user message.

How

  • HonchoClientConfig: new tools_startup_context: bool = False field (JSON key: toolsStartupContext)
  • HonchoSessionManager.fetch_startup_snapshot(peer_id): fetches user representation + peer card without requiring an active session in local cache
  • run_agent.py: _schedule_honcho_startup_prewarm() fires a daemon thread on session init; _pop_startup_snapshot() consumes it once on first turn
  • cli.py: prewarm triggered in new_session()
  • gateway/run.py: prewarm triggered after reset, _honcho_startup_cache keyed by peer_name

Design decisions

  • Injected via _honcho_turn_context (user message append), not _honcho_context (system prompt) — prompt cache prefix stays stable
  • pop() semantics — consumed exactly once, subsequent turns unaffected
  • not conversation_history guard — first turn only
  • Keyed by peer_name (stable Honcho identity), not ephemeral session ID
  • V1 scope: representation + peer card only. No dialectic, no AI peer context, no continuity recall

Not included (by design)

Continuity-style recall is intentionally excluded per issue spec — /new semantically means a fresh session.

@gaelcado

Copy link
Copy Markdown

Whoops didn't catch that ! I implemented my version, have you had any success testing yours ?

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent loop, run_agent.py, prompt builder comp/gateway Gateway runner, session dispatch, delivery labels May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional lightweight cached startup context for Honcho recallMode=tools

3 participants