You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An orphaned position sidecar is trusted, because the hot path bounds it against the transcript rather than against last-save.json #403
Found by the round-two release audit of v0.22.0..HEAD before tagging 0.23.0. Carry-forward under the two-round cap: non-blocking, ranked misreports.
Symptom
A sidecar whose session has been evicted from last-save.json, and whose unlink failed, is still trusted. The hook resumes from a position the authoritative store no longer recognises, and the span is summarized a second time.
Location
pipeline/shell.py:330-336 -- the evicted-sidecar cleanup:
scripts/post-tool-hook.sh:539 -- the trust check, which bounds a sidecar only against CURRENT_LINES, this run's own transcript line count.
Mechanism
The two log lines at scripts/post-tool-hook.sh:533 and :540 both say the sidecar "disagrees with last-save.json", but the comparison never consults last-save.json at all. So the eviction cleanup is the only thing keeping an orphaned sidecar out of the trusted path, and it is best-effort by construction -- the code's own comment at pipeline/shell.py:320-329 says so, and that direction was chosen deliberately.
What is not stated is the platform asymmetry. On Windows, os.remove against a file another process holds open raises PermissionError, an OSError subclass caught here -- so the swallowed branch is the ordinary case there rather than the exotic one. Reasoned, not observed: no Windows machine was available, and tests/test_hot_path_cost_pin_330.py and tests/test_position_sidecar_353.py both skip on win32, so no CI leg exercises it.
Nothing is lost -- a span is summarized twice -- which is why this is misreports rather than fails-to-preserve, and why the fix a reviewer is sent to make is at the one rendering seam.
What would settle it
Whether the sidecar trust check should also require the session id to be present in last-save.json. That would make an orphaned sidecar detectable rather than merely improbable, and would make the two log lines true.
Worth deciding at the same time whether the log wording should change if the check does not: a message naming a comparison the code does not perform is its own small defect.
Activity
fix: sidecar hot-path trust check now actually consults last-save.json (
Clear a leaked REMEMBER_TRANSCRIPT_PATH in post-tool/user-prompt hook…