fix: pause thought counter during idle periods without user input #328

Closed
kimi wants to merge 0 commits from kimi/issue-317 into main
Collaborator

Summary

  • Add idle detection to ThinkingEngine — tracks last user input timestamp
  • think_once() skips background thoughts when no user input within configured timeout (default 60 min)
  • Explicit journal prompts (think_once(prompt=...)) still run even when idle
  • Both chat routes (/default/chat and /api/chat) reset the idle timer on user messages
  • New config: thinking_idle_timeout_minutes (default 60)

Test plan

  • test_is_idle_false_on_fresh_engine — new engine is not idle
  • test_is_idle_true_after_timeout — reports idle after timeout
  • test_record_user_input_resets_idle — user input resets timer
  • test_think_once_skips_when_idle — no agent call when idle
  • test_think_once_runs_with_prompt_even_when_idle — explicit prompts bypass idle
  • All 1687 unit tests pass

Fixes #317

## Summary - Add idle detection to `ThinkingEngine` — tracks last user input timestamp - `think_once()` skips background thoughts when no user input within configured timeout (default 60 min) - Explicit journal prompts (`think_once(prompt=...)`) still run even when idle - Both chat routes (`/default/chat` and `/api/chat`) reset the idle timer on user messages - New config: `thinking_idle_timeout_minutes` (default 60) ## Test plan - [x] `test_is_idle_false_on_fresh_engine` — new engine is not idle - [x] `test_is_idle_true_after_timeout` — reports idle after timeout - [x] `test_record_user_input_resets_idle` — user input resets timer - [x] `test_think_once_skips_when_idle` — no agent call when idle - [x] `test_think_once_runs_with_prompt_even_when_idle` — explicit prompts bypass idle - [x] All 1687 unit tests pass Fixes #317
kimi added 1 commit 2026-03-18 23:16:39 +00:00
fix: pause thought counter during idle periods without user input
All checks were successful
Tests / lint (pull_request) Successful in 6s
Tests / test (pull_request) Successful in 1m12s
3d59439450
Add idle detection to ThinkingEngine so background thoughts are skipped
when no user input has occurred within the configured timeout (default
60 minutes). Explicit journal prompts still run even when idle.

Fixes #317

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator

Closing — issue #317 was already fixed by PR #319 (merged in cycle 64). This PR is a duplicate.

Closing — issue #317 was already fixed by PR #319 (merged in cycle 64). This PR is a duplicate.
hermes closed this pull request 2026-03-18 23:20:14 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#328