Make command rows compaction-aware - #9
Conversation
# Conflicts: # CHANGELOG.md # README.md # test/queue-state.test.ts
Normal-Pi adversarial evidenceMedia note: the first capture requested an unavailable JetBrains Mono font, which made VHS use mismatched fallback glyph metrics. These assets were recaptured with the installed Menlo font and explicit zero letter spacing. The assertions were rerun against the replacement sessions. Tested commit Historical sessions were copied and deterministically content-redacted before use. Structure and usage accounting were preserved, and SHA-256 verification confirms the source session remained byte-identical. A private tmux server used Automatic 200k compaction, queued reload, trailing follow-upThe copied session started at 220,714 tokens. The live request reached 273k, the installed 200k policy injected the overflow after a real tool turn, Pi recorded a compaction at 273,196 tokens and retried, auto-200k-reload.mp4Queued command and follow-up: Successful compaction, reload, and trailing response: Manual compaction with native post-compaction inputOrdinary Enter and Option+Enter submissions made while manual compaction was active stayed in Pi's native post-compaction queues. The visible manual-compact-native-reload.mp4During compaction: After compaction and both native messages, with reload starting: Abort, pause, two reloads, recoveryA real bash tool was aborted while four follow-up rows were visible: abort-repeated-reload.mp4Paused queue: First and second runtime swaps, extracted at 24s and 32s: Final response: Reproducible evidence bundleThe bundle contains the VHS tapes, three MP4s, screenshots, redacted transcript captures, sanitized session snapshots, deterministic harness captures, provenance, machine-checked assertions, and Download Archive SHA-256: Final validation:
This is strong, independently checkable evidence for the tested paths, not a claim about every possible terminal, provider, timing, or third-party extension combination. This comment is AI-generated. |








Summary
This completes compaction-aware command rows as an extension-only implementation using public Pi APIs.
/compact [instructions]and/reloadrows at their FIFO position/compactrow when compaction cannot startQueue state remains session-local. It is not written to the transcript, session data, or validation artifacts.
Ordering and recovery behavior
one-at-a-timeandalldelivery settings still apply per lane./reloadsnapshots the queue duringsession_shutdown, so rows added after reload scheduling are included. Repeated queued reloads retain row identity and do not duplicate rows.Dependency policy
Pi package ranges are intentionally unpinned (
*) in bothpeerDependenciesand development dependencies. The lockfile records Pi 0.84.1 for a reproducible checkout, but the package manifest does not declare an artificial compatibility target.Refresh compatibility validation to the current Pi packages with:
Automated validation
Result with the current resolved Pi 0.84.1 packages: 81 tests passed, 0 failed. This includes real
AgentSessionpaths for manual compaction success/failure, retry-before-release ordering, and public-prompt overflow compaction.Real TUI evidence
Final clean-tree run:
The harness uses Pi's real 0.84.1 TUI under tmux with a deterministic faux provider. It mechanically verifies:
/reloadSee
docs/validation.mdfor artifact names and interpretation.Public API limits
ExtensionAPI.sendUserMessageand the TUI editor submit callback returnvoid. The extension restores synchronous dispatch and preflight failures, but cannot observe a later asynchronous rejection without risking duplicate delivery. Queued/reloadlikewise has no acknowledgement channel. These limits are documented rather than hidden behind timing heuristics.