Skip to content

peer mail: reading the inbox no longer rewrites sent history - #1799

Merged
justrach merged 1 commit into
mainfrom
fix/peer-wake-no-restart
Nov 2, 2026
Merged

justrach merged 1 commit into
mainfrom
fix/peer-wake-no-restart

Conversation

@justrach

@justrach justrach commented Nov 2, 2026

Copy link
Copy Markdown
Owner

At each step boundary with an empty peer inbox, placeWaitingBeforeHuman removed every peer wake line from the whole history (dropAllInjects), including the one the current turn started from, which the model had already been sent. That rewrote history the provider had cached:

  • On Claude Agent, every woken turn started a fresh claude process ("restart: earlier history changed") and replayed the conversation as a text checkpoint.
  • On other providers it changed the cached prefix after every inbox read.

It now removes only wake lines after the last non-user message, the ones the model was never sent (dropUnsentInjects). A leftover wake placed before a human prompt is still dropped once the inbox is clear; restore still drops all of them.

Test: a wake the model already answered stays in history after the inbox is read; the existing #1137 tests pass. In a scripted peer-mail run on Claude Agent (three addressed follow-ups), restarts went from 3 per run to 0, with every follow-up still done.

At each step boundary with an empty inbox, placeWaitingBeforeHuman removed
every peer wake line from the whole history, including the one the
current turn started from, which the model had already been sent. That
rewrote history the provider had cached: on Claude Agent it started a
fresh claude process ("restart: earlier history changed") on every
woken turn, and on other providers it broke the cached prefix.

It now removes only wakes after the last non-user message, the ones the
model was never sent. A leftover wake placed before a human prompt is
still dropped once the inbox is clear.
@justrach justrach mentioned this pull request Nov 2, 2026
@justrach
justrach merged commit 5ade538 into main Nov 2, 2026
6 checks passed
@justrach
justrach deleted the fix/peer-wake-no-restart branch November 2, 2026 03:32
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.

1 participant