Skip to content

fix(sessions): ignore headless queued prompts and prefer the live resume binding - #48

Merged
elitecoder merged 2 commits into
mainfrom
fix/session-tracking
Oct 19, 2026
Merged

elitecoder merged 2 commits into
mainfrom
fix/session-tracking

Conversation

@elitecoder

Copy link
Copy Markdown
Owner

Two session-tracking fixes.

Headless queued prompts no longer count as Slack submissions

After each warm turn, the proofgate Stop hook runs a headless claude -p in the same folder. That run records the warm session's prompts in queue-operation records, which have no entrypoint, so the sdk-cli filter in transcript_has_submission missed them. When the bound transcript lacked a message marker, comms-listen.py:365 searched the folder, and could bind to that headless transcript and watch it for the reply.

  • 8 of 159 headless transcripts on this machine hold a Slack marker in a queued prompt.
  • 26 headless transcripts write the queued prompt before their first sdk-cli record. A check for "any sdk-cli record" could therefore race, so a queued prompt now counts only when the transcript's first entrypoint is interactive.
  • Submitted user prompts are unchanged.

Checked on every real transcript in ~/.claude/projects/-Users-mukuls-dev-assistant, old code against new:

  • Headless: 4 marker matches go from true to false.
  • Interactive: all 41 marker matches stay true.

The live resume binding wins over the restore record

cmux surface resume show lists a restore_record (source session-snapshot) before the resume_binding (source agent-hook, with updated_at). world-scanner.py and build-ws-context.py took the first record with a checkpoint id, which is the snapshot. They now try resume_binding first and fall back to the old search. Today both records agree on every live terminal, so this guards against the snapshot going stale.

Validation

  • The full suite passes on Python 3.13: 3019 passed, 1 skipped.
  • The two new lookup tests fail when the old lookup order is restored.
  • Both lookups return the right session and folder for the live cmux terminals on this machine.

🤖 Generated with Claude Code

elitecoder and others added 2 commits October 18, 2026 23:16
…ume binding

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… entrypoint skip

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elitecoder
elitecoder merged commit d8e144d into main Oct 19, 2026
1 check passed
@elitecoder
elitecoder deleted the fix/session-tracking branch October 19, 2026 15:22
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