Skip to content

fix(honcho): buffer turns during async session initialization - #66259

Closed
c0d1ngHUB wants to merge 1 commit into
NousResearch:mainfrom
c0d1ngHUB:fix/honcho-async-session-turn-buffer
Closed

fix(honcho): buffer turns during async session initialization#66259
c0d1ngHUB wants to merge 1 commit into
NousResearch:mainfrom
c0d1ngHUB:fix/honcho-async-session-turn-buffer

Conversation

@c0d1ngHUB

Copy link
Copy Markdown

Summary

  • buffer completed turns while an asynchronous Honcho session is still initializing
  • drain queued turns in FIFO order through one async writer once initialization succeeds
  • fail open on permanent initialization failure or shutdown, with bounded, content-free queue handling
  • add regression coverage for startup, buffering, and fail-open behavior

Local tests

  • 130 relevant Honcho, memory, and gateway tests passed
  • Focused regression test: 16 passed

@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 sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 17, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #19650, #51492, and #28845: this adds bounded FIFO buffering specifically for turns completed before asynchronous Honcho session initialization finishes. The linked work covers write-frequency routing, startup latency, and end-of-session flushing respectively.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved (LGTM)

Overview

Buffers turns during async session initialization in honcho. +221/0.

Security

  • No hardcoded secrets or credentials

Code Quality

  • Clean async initialization handling
  • Proper turn buffering logic

Looks Good

  • Well-scoped async fix

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused fix. The premise is confirmed on current main: context/hybrid startup is asynchronous at plugins/memory/honcho/__init__.py:399, while sync_turn() starts/reuses initialization and returns at plugins/memory/honcho/__init__.py:1338-1340, before its persistence path at :1342-1362. The FIFO buffering and single drain worker in 53ddaff951c5 directly cover that window.

The existing MemoryManager already serializes provider turn writes to preserve order (agent/memory_manager.py:649-684), and this change preserves that ordering while initialization is incomplete. No blocking correctness or design-fit problem was identified from the current-main source and PR diff.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/sessions Session lifecycle, resume, persistence, history area/memory Memory subsystem: store, providers, sync, background reviews labels Jul 18, 2026
@c0d1ngHUB c0d1ngHUB closed this by deleting the head repository Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews area/sessions Session lifecycle, resume, persistence, history comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state 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.

4 participants