Skip to content

Feat/stale session indicator in entire status#853

Merged
gtrrz-victor merged 6 commits intomainfrom
feat/stale-session-indicator
Apr 6, 2026
Merged

Feat/stale session indicator in entire status#853
gtrrz-victor merged 6 commits intomainfrom
feat/stale-session-indicator

Conversation

@peyton-alt
Copy link
Copy Markdown
Contributor

@peyton-alt peyton-alt commented Apr 3, 2026

  • Add "stale (run 'entire doctor')" indicator to entire status for sessions stuck in ACTIVE
    phase with no interaction for >1 hour
  • Matches the same staleness criteria used by entire doctor to flag stuck sessions
  • Falls back to StartedAt when LastInteractionTime is nil to avoid false positives on
    brand-new sessions

Note

Low Risk
Low risk: changes are limited to CLI display logic for entire status plus new unit tests, with no data mutations or security-sensitive behavior.

Overview
entire status now flags ACTIVE sessions that appear stuck by appending a yellow stale (run 'entire doctor') indicator when there has been no interaction for longer than stalenessThreshold (1 hour).

This adds isStuckActiveSession (using LastInteractionTime and falling back to StartedAt when nil to avoid false positives) and extends status styling with a new yellow style. Tests were expanded to cover stale detection and the new output in several interaction/start-time scenarios.

Reviewed by Cursor Bugbot for commit 54390f3. Configure here.

Copilot AI review requested due to automatic review settings April 3, 2026 22:34
@peyton-alt
Copy link
Copy Markdown
Contributor Author

peyton-alt commented Apr 3, 2026

Example in entire status and then running entire doctor displays this same session.

Current behavior: shows session as active in entire status and stuck in entire doctor, unclear without stale warning
stale_session warn entire_status

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “stale (run …)” indicator to entire status so users can spot sessions that appear stuck in ACTIVE due to no interaction for longer than the doctor staleness threshold.

Changes:

  • Update writeActiveSessions to append a “stale (run …)” hint when a session is considered stuck.
  • Introduce isStuckActiveSession helper using stalenessThreshold to detect stuck ACTIVE sessions (with StartedAt fallback when LastInteractionTime is nil).
  • Add unit tests covering stale vs non-stale scenarios and add a yellow style for the warning label.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
cmd/entire/cli/status.go Adds stale indicator in active sessions output and introduces stuck-session detection helper.
cmd/entire/cli/status_test.go Adds coverage for stale indicator rendering and stuck-session detection logic.
cmd/entire/cli/status_style.go Adds yellow style used by the stale warning label.

Comment thread cmd/entire/cli/status.go Outdated
Comment thread cmd/entire/cli/status.go Outdated
Comment thread cmd/entire/cli/status.go
Comment thread cmd/entire/cli/status_test.go
Comment thread cmd/entire/cli/status_test.go
Comment thread cmd/entire/cli/status.go Outdated
peyton-alt and others added 5 commits April 3, 2026 15:47
Sessions that are Phase=active with no interaction for >1 hour now show
"stale (run 'entire doctor')" in the stats line, matching doctor's
staleness criteria. Falls back to StartedAt when LastInteractionTime is
nil to avoid false positives on brand-new sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 5d2a49b32bc3
Covers: stale with interaction, stale with nil interaction (old start),
not stale when recent, not stale when brand-new, and table-driven unit
tests for isStuckActiveSession across all phase/time combinations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: cfc2ad475e21
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 8ac73ce5e1d3
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 0d5b5f15eac2
The comment incorrectly claimed matching doctor's criteria. Updated to
note the intentional fallback to StartedAt for nil LastInteractionTime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: e449dc12bc71
@peyton-alt peyton-alt force-pushed the feat/stale-session-indicator branch from 9f92745 to 54390f3 Compare April 3, 2026 22:47
@peyton-alt
Copy link
Copy Markdown
Contributor Author

@BugBot review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 54390f3. Configure here.

@peyton-alt peyton-alt marked this pull request as ready for review April 3, 2026 22:55
@peyton-alt peyton-alt requested a review from a team as a code owner April 3, 2026 22:55
@peyton-alt peyton-alt changed the title Feat/stale session indicator Feat/stale session indicator in entire status Apr 3, 2026
…ve()

Both doctor and status had duplicate logic for detecting stuck active
sessions, with doctor incorrectly flagging brand-new sessions (nil
LastInteractionTime) as stuck. Extract shared logic into a method on
session.State that falls back to StartedAt, fixing the false positive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 86a7d2cce301
@gtrrz-victor
Copy link
Copy Markdown
Contributor

Refactor: unified stuck-active detection

  • Extracted isStuckActiveSession (status) and inline staleness check (doctor) into session.State.IsStuckActive() method
  • Added session.StuckActiveThreshold constant (replaces stalenessThreshold in doctor.go)
  • Fixed doctor bug: brand-new sessions with nil LastInteractionTime were falsely flagged as stuck — now falls back to StartedAt like status did
  • Net reduction: -31 lines, +26 lines across 5 files

@gtrrz-victor gtrrz-victor merged commit 66d5f3c into main Apr 6, 2026
3 checks passed
@gtrrz-victor gtrrz-victor deleted the feat/stale-session-indicator branch April 6, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants