Replies: 1 comment 1 reply
|
Thanks for tracing this and for separating the immediate ordering bug from the larger design question. I agree that the checkpoint should be verified and applied against the original covered RuntimeEvents before pruning the uncovered tail. For the larger design, though, I do not think the RuntimeEvent log should replace the Tool Result archive read path. The two stores have different responsibilities:
Reading Tool Results directly from the ledger would make the model resource protocol depend on RuntimeEvent identity and layout, historical event schemas, session/run lookup, copied-session ID rewriting, remote Host placement, authorization, retention, and future ledger storage changes. It would also move paging, size limits, structured query, and selective disclosure into the canonical ledger boundary. Keeping archives separate allows us to evolve chunking, indexing, compression, encryption/redaction, deduplication, retention, and specialized query behavior without coupling those concerns to RuntimeEvent persistence. I also do not see the second copy as requiring ongoing synchronization. RuntimeEvents are immutable. The important contract is a one-time write-before-placeholder invariant:
After that, there is no mutable source to keep synchronized. The archive is a derived, purpose-built materialization, not a second execution-history authority. So my preference is to fix the |
Uh oh!
There was an error while loading. Please reload this page.
I ran into a context-compaction bug while testing #3545. Provider-native compaction succeeds and writes a checkpoint, but a later turn can fail to replay it with
source_hash_mismatch.The immediate bug is an ordering problem. A Tool Result inside the checkpoint's covered history can become stale on a later turn. Pruning replaces it with an archive placeholder before the checkpoint verifies the original RuntimeEvents, so the verification sees different content.
I plan to fix that separately by verifying and applying the checkpoint first, then pruning only the remaining history. I don't think the bug fix needs to wait for a larger design change.
While tracing this, I noticed that the full Tool Result already exists in the RuntimeEvent log, but pruning also copies it into a separate archive artifact so that
ArchiveReadcan retrieve it. That gives us two stored copies, a custom reference format, a dedicated tool, and compatibility code to keep the placeholder and artifact in sync.I looked at pi for comparison. Large Bash output is written locally, the model sees a shortened result with a path, and normal
readorgrepcan retrieve the rest. Maka has a different lifecycle problem because a temporary file can outlive or disappear before its session, but the RuntimeEvent log already gives us session-owned storage.I wonder if we can keep Tool Result pruning but simplify retrieval:
eventId.Readpath read a Tool Result from the RuntimeEvent log.ArchiveReadprotocol.This would keep pruning while making the RuntimeEvent log the only stored authority. Session deletion would handle the data lifecycle, and we would not leave temporary files behind.
There are still questions around remote Hosts, permissions, copied sessions, old placeholders, and whether extending
Readto RuntimeEvent resources is actually simpler than keepingArchiveRead.@likun666661, you worked on this area. What requirement led us to the separate Tool Result archive instead of reading the original RuntimeEvent? Do you think the event-log approach can cover it, or is there an important constraint I am missing?
Disclosure: I used Maka to inspect the local Runtime diagnostics, trace the relevant source paths, and compare the implementation with pi. I reviewed and approved this discussion text.
All reactions