Repository navigation
mini: auto-handoff: fix mtime prefilter hiding idle threads - #54
Merged
Merged
Conversation
Claude Code appends untimestamped last-prompt/cost-state records ~30 min after a session goes quiet, bumping the transcript's mtime. The two-sided prefilter then hid sessions that were inside the idle window (the first live test thread was never considered). Keep only the upper bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude review: skipped (PR is already merged/closed) Checked only the PR state; no code review was run. Not approved: the PR is already merged, so there is nothing to approve. |
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.
The first live test thread (idle since 17:49, 122k context) was never handed off.
Cause: the watcher skipped any transcript whose mtime wasn't within the idle window ±5 minutes. But Claude Code appends
last-promptandcost-staterecords, which have no timestamp, about 30 minutes after a session goes quiet. That bumped the file's mtime to 18:19. During the 18:29–18:39 window the file looked only 10–20 minutes old, so it was never parsed. By the time its mtime was in range, the real idle time was past 50 minutes.Fix: mtime is always at or after the last activity, so it only rules out sessions that are idle longer than the window. Keep only the upper bound.
Checked: on the same session with
--idle-min 60 --idle-max 90, the old script doesn't consider it and the new one reportswould send. A full run with the defaults takes 0.3 s.🤖 Generated with Claude Code