Repository navigation
Stop Command details from re-parsing every historical Session trace - #1377
Merged
Merged
Conversation
…apacity. Please try a different model.) 2026-10-26T09:00:54Z, host thirdshift. Uncommitted work at the time of failure is included in this commit.
…apacity. Please try a different model.) 2026-10-26T13:14:37Z, host thirdshift. Uncommitted work at the time of failure is included in this commit.
Command details still read only that Command and its nested work. The record cache no longer takes a byte-size closure, and the site names Session traces.
…ed or not reproduced completion line) 2026-10-26T14:40:09Z, host thirdshift. Uncommitted work at the time of failure is included in this commit.
JacobStephens2
marked this pull request as draft
October 26, 2026 14:40
This was referenced Oct 26, 2026
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.
Summary
Command details stop reparsing unrelated historical Session traces. Historical signals are reused across Console requests and separate CLI processes while the source is unchanged.
A bounded memory cache and disposable
*.signals-cache.jsonfiles retain derived signals by the resolved Session trace's identity. Per-trace locks coordinate readers; atomic replacement publishes complete cache files. Unchanged malformed traces retain the same Missing result until repaired. Stored completion signals take precedence, and historical Command records are never rewritten. The branch also reconciles currentmainwhile preserving its mailbox and folded details.Evidence
metrics --jsonprocesses took 36.181s and 31.913s, each opening the same 562 Session traces / 4.31 GB. The cache survived only within one process.After: the first load populated the cache (45.065s with
strace); the next process opened zero Session traces (1.119s withstrace). Without tracing overhead, cached metrics took 0.241s. Measured withstrace -f -e trace=openat -o <capture> target/release/thirdshift metrics --json, capturing JSON privately and counting trace opens.cargo test --test metrics unchanged_session_signals_survive_between_cli_processes -- --exact --nocapturefailed because a second CLI process reopened an unchanged trace (left: 1,right: 0).After: it passes, including JSON equality, append invalidation, same-length/same-mtime replacement invalidation, reuse by
show, and unchanged historical Command records.second load reparsed unchanged malformed historical trace.After: that command passes, and
cargo test --test metrics unchanged_malformed_session_signals_are_not_reparsed_and_repair_refreshes_them -- --exactpasses while also checking repair invalidation.show --jsontook 0.095–0.104s for all four reported Commands; their Console/peekrequests took 0.072–0.121s, all HTTP 200.node --test console/tests/inbox.test.cjs: 46 passed, including the held-request timeout and reopening the pane.cargo clippy --all-targets -- -D warningsandcargo fmt --checkpassed./usr/bin/time -p scripts/affected-tests mainat88b61cd0: 3,113 Rust tests passed, 69 helper tests ignored; 50 site tests passed, exit 0, 1510.20s including compilation. The subsequent CI-only fixture change passed all 16 skill tests (1 helper ignored); production code is identical.88b61cd0: a fake harness exited without consuming stdin, so prompt writing sometimes returnedBroken pipebefore the incomplete-turn assertion. The fixture now drains its prompt before emitting its partial event. Assertions and production behavior are unchanged. The prior full run and 20 isolated repeats passed locally; the CI failure is recorded here.Seams
stop::inspect/Snapshot::load_detailsandshow: selected Command signals, nested work, and all-Command health/Usual ranges.Snapshot::load_metricsand separatemetrics --jsonCLI processes: signal reuse, source invalidation, Missing results and saved completion metrics.loadPeek: bounded waiting and recovery after a held request.Unaddressed findings
Standards: None.
Spec: None.
Security: None.
Both review findings were addressed: exact selection uses
CommandIdentity, and unchanged malformed traces retain Missing. The final Standards and Spec reviews each read all 16 changed files, including the CI fixture correction. No changed file was left unread; there were no generated-output exclusions.Security review outcome
No unaddressed introduced findings.
Merge Danger
Door: two-way
Historical records and Session traces remain unchanged. Derived cache files are disposable; cache-write failures fall back to parsing. The first metrics load after a binary change still parses historical traces to populate its cache.
Blast Radius: narrow
Command details,
thirdshift show, andthirdshift metrics; ordinary status reads do not load historical Session signals.Closes #1363
Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh