fix(analyzer): cap "Claude thinking" gaps so mid-turn suspensions aren't counted as thinking#6
Closed
wan-huiyan wants to merge 1 commit into
Closed
Conversation
…unted as thinking Only the assistant-end→user gap was capped by IDLE_THRESHOLD_MS. The user→assistant and tool_result→assistant gaps (both → claudeThink) were uncapped, so any long pause landing mid-turn (overnight gap after a tool result, credit stall, remote-control handoff) was reported as hours of "Claude thinking." Add THINK_CAP_MS (10 min) and an emitThink() helper that caps the thinking slice and books the remainder as humanAway. On a real 16h session with overnight gaps this moves ~9h out of "thinking" (11h34m → 2h35m) into away time. +3 unit tests; all 90 pass; tsc clean.
Author
|
Consolidated into #10 (time-breakdown accuracy + parallelism insight) to keep review manageable. |
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.
Caps the
user→assistantandtool_result→assistantgaps (bothclaudeThink) atTHINK_CAP_MS(10 min); the remainder is booked ashumanAway. A single uninterrupted response never approaches 10 min, so a longer pre-response gap is a suspension (overnight/credit-stall/handoff), not thinking. On a 16h session this moved ~9h out of "thinking" into away. +3 tests; tsc clean.Supersedes #2 (re-created on a dedicated branch so fork-internal merges/deletes cannot disturb it). 🤖 Generated with Claude Code