fix: preserve full peer inbox messages and report overflow - #893
Merged
Conversation
Clipped previews and silent eviction made inbox reads appear complete when they were not. Own full message strings, persist loss accounting across resume, and clear unread state only after the complete read result is allocated. Keep the bounded pull mailbox and advisory wakes. Cover content ownership, overflow, allocation-failure retries through inbox dispatch, legacy resume, and live delivery. Fixes #865.
Exercise parking allocation failures with leak-tracked storage, mixed mailbox transitions against an independent FIFO, malformed and escaped snapshots, and live overflow across multiple drains. A test-only allocator override makes storage ownership failures observable without changing the production allocator.
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.
What changed
Retain complete peer message bodies and sender names, report dropped-message counts, and preserve loss accounting across resume. Failed inbox reads return an error without consuming unread state.
Why
Clipped previews, silent eviction, and clearing after formatting failures made incomplete reads appear successful. Keep the bounded eight-message pull inbox rather than introducing an unbounded queue; full messages use more memory, while wakes remain short.
Verification
scripts/eval-tier1.sh— full pre-push gate passed: 2,244 unit tests, 589 TUI tests, all 19 PTY probes, formatting, source-size, reachability, invariants, and SDK drift checks.python3 scripts/eval-tier2.py --only peer-inbox-preserves-live-body-865— passed full-body delivery and empty second read.python3 scripts/eval-tier2.py --only peer-inbox-live-multidrain-overflow-unicode-clear-865— passed cumulative overflow, exact retained order and Unicode bodies, clearing, and fresh delivery without stale loss.Fixes #865.