Skip to content

The sidecar's last-save.json membership check reports "disagrees with last-save.json" when nothing was read #426

Closed

Description

@fdaviddpt

Found by the round-one release audit of v0.23.0..9f3269e. Ranked misreports, non-blocking, carry-forward eligible.

Symptom

Three different states produce one log line. A last-save.json that is absent, one that is present but unreadable, and one where the session is genuinely evicted all yield an empty sessions scope and the same message:

sidecar $SIDECAR's session $SESSION_ID is absent from last-save.json -- disagrees with last-save.json, falling back to read-position

"Disagrees with last-save.json" is a comparison claim, and in two of the three cases no comparison happened.

Location

scripts/post-tool-hook.sh, the a402ac1 block: _LAST_SAVE_CONTENT=$(< "$LAST_SAVE_FILE") guarded by [ -f "$LAST_SAVE_FILE" ].

Mechanism

[ -f ] passes on a present-but-unreadable file, and $(< file) on one yields empty -- indistinguishable from a file whose sessions map genuinely lacks this id. The behaviour is correct and conservative in all three cases (fall back to read-position), so this is a receipt defect rather than a control-flow one. The cost is a diagnostic that sends a reader looking for an eviction that may never have happened -- this repository's own defect class, landing on a message the fix for #403 introduced.

What would settle it

Separating "could not read" from "not a member" needs a status check the current expression does not make -- $(< file) cannot distinguish them. Either add one and give the could-not-read case its own line, or narrow the existing message so it stops claiming a comparison it did not make.

Activity

  1. added
    priority:low
    on Aug 29, 2026
  2. self-assigned this
    on Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority:low

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions