fix(honcho): lazy session init in tools mode#1957
Closed
erosika wants to merge 3 commits into
Closed
Conversation
fcf7523 to
2bc0594
Compare
e7f40ff to
f3cf933
Compare
8ab8d08 to
b640e7a
Compare
recallMode=tools still eagerly called get_or_create() -> session.context(summary=True) on startup, adding a blocking HTTP round-trip even when no Honcho tool was invoked. Defer session creation until the first tool call via ensure_session(). - Extract _ensure_honcho_session_initialized helper on AIAgent - Add ensure_session() to HonchoSessionManager for lazy init - Tool handlers lazily init via _resolve_session_context() - Add integration test verifying deferred init flow - Update test assertions for per-directory default
When recall_mode=tools, _activate_honcho skips eager session init, so the lazy path through _resolve_session_context -> ensure_session never ran migrate_memory_files. Add migration logic to ensure_session with a _migrated set to guarantee it runs exactly once per session key.
b640e7a to
22e6b83
Compare
erosika
added a commit
to erosika/hermes-agent
that referenced
this pull request
Apr 2, 2026
Implements all features from the post-merge Honcho plugin spec: B1: recall_mode support (context/tools/hybrid) B2: peer_memory_mode gating (stub for ABC suppression mechanism) B3: resolve_session_name() session key resolution B4: first-turn context baking in system_prompt_block() B5: cost-awareness (cadence, injection frequency, reasoning cap) B6: memory file migration in initialize() B7: pre-warming context at init Ports from open PRs: - NousResearch#3265: token budget enforcement in prefetch() - NousResearch#4053: cron guard (skip activation for cron/flush sessions) - NousResearch#2645: baseUrl-only flow verified in is_available() - NousResearch#1969: aiPeer sync from SOUL.md - NousResearch#1957: lazy session init in tools mode Single file change: plugins/memory/honcho/__init__.py No modifications to client.py, session.py, or any files outside the plugin.
teknium1
pushed a commit
that referenced
this pull request
Apr 3, 2026
Implements all features from the post-merge Honcho plugin spec: B1: recall_mode support (context/tools/hybrid) B2: peer_memory_mode gating (stub for ABC suppression mechanism) B3: resolve_session_name() session key resolution B4: first-turn context baking in system_prompt_block() B5: cost-awareness (cadence, injection frequency, reasoning cap) B6: memory file migration in initialize() B7: pre-warming context at init Ports from open PRs: - #3265: token budget enforcement in prefetch() - #4053: cron guard (skip activation for cron/flush sessions) - #2645: baseUrl-only flow verified in is_available() - #1969: aiPeer sync from SOUL.md - #1957: lazy session init in tools mode Single file change: plugins/memory/honcho/__init__.py No modifications to client.py, session.py, or any files outside the plugin.
Contributor
Author
|
Superseded by #9884 — lazy session init / initOnSessionStart is implemented in the new plugin architecture. |
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
Implements all features from the post-merge Honcho plugin spec: B1: recall_mode support (context/tools/hybrid) B2: peer_memory_mode gating (stub for ABC suppression mechanism) B3: resolve_session_name() session key resolution B4: first-turn context baking in system_prompt_block() B5: cost-awareness (cadence, injection frequency, reasoning cap) B6: memory file migration in initialize() B7: pre-warming context at init Ports from open PRs: - NousResearch#3265: token budget enforcement in prefetch() - NousResearch#4053: cron guard (skip activation for cron/flush sessions) - NousResearch#2645: baseUrl-only flow verified in is_available() - NousResearch#1969: aiPeer sync from SOUL.md - NousResearch#1957: lazy session init in tools mode Single file change: plugins/memory/honcho/__init__.py No modifications to client.py, session.py, or any files outside the plugin.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
Implements all features from the post-merge Honcho plugin spec: B1: recall_mode support (context/tools/hybrid) B2: peer_memory_mode gating (stub for ABC suppression mechanism) B3: resolve_session_name() session key resolution B4: first-turn context baking in system_prompt_block() B5: cost-awareness (cadence, injection frequency, reasoning cap) B6: memory file migration in initialize() B7: pre-warming context at init Ports from open PRs: - NousResearch#3265: token budget enforcement in prefetch() - NousResearch#4053: cron guard (skip activation for cron/flush sessions) - NousResearch#2645: baseUrl-only flow verified in is_available() - NousResearch#1969: aiPeer sync from SOUL.md - NousResearch#1957: lazy session init in tools mode Single file change: plugins/memory/honcho/__init__.py No modifications to client.py, session.py, or any files outside the plugin.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
Implements all features from the post-merge Honcho plugin spec: B1: recall_mode support (context/tools/hybrid) B2: peer_memory_mode gating (stub for ABC suppression mechanism) B3: resolve_session_name() session key resolution B4: first-turn context baking in system_prompt_block() B5: cost-awareness (cadence, injection frequency, reasoning cap) B6: memory file migration in initialize() B7: pre-warming context at init Ports from open PRs: - NousResearch#3265: token budget enforcement in prefetch() - NousResearch#4053: cron guard (skip activation for cron/flush sessions) - NousResearch#2645: baseUrl-only flow verified in is_available() - NousResearch#1969: aiPeer sync from SOUL.md - NousResearch#1957: lazy session init in tools mode Single file change: plugins/memory/honcho/__init__.py No modifications to client.py, session.py, or any files outside the plugin.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
Implements all features from the post-merge Honcho plugin spec: B1: recall_mode support (context/tools/hybrid) B2: peer_memory_mode gating (stub for ABC suppression mechanism) B3: resolve_session_name() session key resolution B4: first-turn context baking in system_prompt_block() B5: cost-awareness (cadence, injection frequency, reasoning cap) B6: memory file migration in initialize() B7: pre-warming context at init Ports from open PRs: - NousResearch#3265: token budget enforcement in prefetch() - NousResearch#4053: cron guard (skip activation for cron/flush sessions) - NousResearch#2645: baseUrl-only flow verified in is_available() - NousResearch#1969: aiPeer sync from SOUL.md - NousResearch#1957: lazy session init in tools mode Single file change: plugins/memory/honcho/__init__.py No modifications to client.py, session.py, or any files outside the plugin.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
Implements all features from the post-merge Honcho plugin spec: B1: recall_mode support (context/tools/hybrid) B2: peer_memory_mode gating (stub for ABC suppression mechanism) B3: resolve_session_name() session key resolution B4: first-turn context baking in system_prompt_block() B5: cost-awareness (cadence, injection frequency, reasoning cap) B6: memory file migration in initialize() B7: pre-warming context at init Ports from open PRs: - NousResearch#3265: token budget enforcement in prefetch() - NousResearch#4053: cron guard (skip activation for cron/flush sessions) - NousResearch#2645: baseUrl-only flow verified in is_available() - NousResearch#1969: aiPeer sync from SOUL.md - NousResearch#1957: lazy session init in tools mode Single file change: plugins/memory/honcho/__init__.py No modifications to client.py, session.py, or any files outside the plugin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
recallMode: "tools"no longer eagerly callsget_or_create()->session.context(summary=True)on startup. Session creation is deferred until the first Honcho tool is actually invoked, eliminating a blocking HTTP round-trip after/new.per-sessiontoper-directoryso cross-session context (peer card, conclusions, dialectic) persists across runs in the same working directory.Test plan
/new+recallMode: "tools"+writeFrequency: async+ later honcho tool invocationget_or_createcalls at init,ensure_sessionfires lazily on first tool callRelated meta issue: #2210