Skip to content

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
dioptx:mainfrom
wan-huiyan:upstream/cap-claudethink
Closed

fix(analyzer): cap "Claude thinking" gaps so mid-turn suspensions aren't counted as thinking#6
wan-huiyan wants to merge 1 commit into
dioptx:mainfrom
wan-huiyan:upstream/cap-claudethink

Conversation

@wan-huiyan
Copy link
Copy Markdown

Caps the user→assistant and tool_result→assistant gaps (both claudeThink) at THINK_CAP_MS (10 min); the remainder is booked as humanAway. 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

…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.
@wan-huiyan
Copy link
Copy Markdown
Author

Consolidated into #10 (time-breakdown accuracy + parallelism insight) to keep review manageable.

@wan-huiyan wan-huiyan closed this May 29, 2026
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