Skip to content

fix(pause): auto-finalize skips threads the session never touched (v3.4.13) - #241

Merged
kengio merged 2 commits into
mainfrom
fix-pause-auto-finalize-skip
Aug 28, 2026
Merged

fix(pause): auto-finalize skips threads the session never touched (v3.4.13)#241
kengio merged 2 commits into
mainfrom
fix-pause-auto-finalize-skip

Conversation

@kengio

@kengio kengio commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

Field gap (2026-08-29): at session end, the pause Auto-Finalize step found an active thread pointer (_active.md) naming a thread whose latest snapshot belonged to a different session token, while the ending session had done no work on that thread at all. None of the three literal skip conditions matched:

  1. No-activity — false: the session had checkpoints (it did unrelated work)
  2. Already-captured-this-session — false: the latest pause file's token ≠ current token
  3. No-pause-files-and-untouched — false: pause files exist for the slug

A literal reading would have auto-finalized — appending the ending session's unrelated content as the thread's next snapshot, corrupting /resume. The agent skipped per intent; this PR makes the condition list cover the case explicitly.

Change

  • New skip condition 4 — Thread-untouched (canonical in skills/pause/SKILL.md §Auto-Finalize): skip when the ending session did no work on the thread after the thread's latest pause file was written (or at all, if the slug has no pause files). Interval-scoping also covers the same-session variant (thread paused early, unrelated work after) and the orphan-pointer variant (slug with zero snapshots).
  • Durable evidence anchor: the no-work judgment reads the session's checkpoint files (which survive context compaction), never the visible conversation tail alone — so a long compacted session that resumed the thread early still auto-finalizes correctly.
  • Counter-case protected: a session that resumed or continued the thread and ended without an explicit /pause does NOT match — capturing that continuation is what auto-finalize exists for.
  • "Latest pause file" pinned to the highest-NN sort /resume Step 2 uses (never mtime, which sync tools rewrite) for the whole Auto-Finalize section.
  • Mirrored in skills/wrapup/SKILL.md Step 0b and skills/startup/AUTO-SUMMARY.md (both marked keep-in-sync), and /wrapup's skipped-notice reference now reads "(1, 2, 3, or 4)".
  • Plugin version 3.4.12 → 3.4.13 (both .claude-plugin and .codex-plugin manifests) + CHANGELOG entry.

Review

Two review passes ran pre-PR (risk-scaled): a cold adversarial pass on the skip-condition contract and a repo-consistency/deliverable pass. The adversarial findings (weak conjunction parse, non-durable /resume memory after compaction, same-session variant, undefined "latest" sort, naming collision with condition 1) were all fixed in the second commit. An out-of-scope /resume --task validation-ordering bug surfaced by the review is tracked separately.

🤖 Generated with Claude Code

@kengio
kengio merged commit 9a82754 into main Aug 28, 2026
4 checks passed
@kengio
kengio deleted the fix-pause-auto-finalize-skip branch August 28, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant