Skip to content

Fix conversation timer and queue lifecycle handling - #820

Closed
xdCloudy wants to merge 1 commit into
mindcraft-bots:developfrom
xdCloudy:fix/conversation-lifecycle
Closed

Fix conversation timer and queue lifecycle handling#820
xdCloudy wants to merge 1 commit into
mindcraft-bots:developfrom
xdCloudy:fix/conversation-lifecycle

Conversation

@xdCloudy

Copy link
Copy Markdown

Summary

Harden conversation lifecycle management around timers, queued messages, and conversation teardown.

Problem

The conversation manager has several edge cases that can leave stale timers or inconsistent state behind:

  • timer references can be discarded without clearing the underlying timeout
  • conversation teardown can run when there is no active conversation
  • queued messages can be concatenated without a clear separator
  • asynchronous conversation transitions can overlap in ways that make state harder to reason about

These issues are most visible during rapid bot-to-bot conversation changes, interruptions, or shutdown/restart paths.

Changes

  • Explicitly clear active conversation timers before replacing or discarding them
  • Guard conversation teardown when no active conversation exists
  • Preserve readable separation between queued messages
  • Make lifecycle transitions more defensive and predictable
  • Keep the existing conversation API and routing behavior intact

Why

Conversation state is shared by multiple async message paths. Small lifecycle mistakes can become intermittent runtime bugs that are difficult to reproduce.

Compatibility

No protocol, profile, or command changes are introduced.

Validation

Validated on the fork CI matrix with Node 20 and Node 22.

@Sweaterdog

Copy link
Copy Markdown
Contributor

quit spamming our repo with slop

@Sweaterdog Sweaterdog closed this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants