Skip to content

CPLAT-9497: replace has-X session badges with lifecycle states#39

Merged
gavin-jeong merged 1 commit into
masterfrom
CPLAT-9497-session-state-badges
May 12, 2026
Merged

CPLAT-9497: replace has-X session badges with lifecycle states#39
gavin-jeong merged 1 commit into
masterfrom
CPLAT-9497-session-state-badges

Conversation

@gavin-jeong
Copy link
Copy Markdown
Collaborator

JIRA: https://sendbird.atlassian.net/browse/CPLAT-9497

Summary

  • Collapse 12 "has X" badges ([M][T][K][P][A][C][S][X][B][F][W] and cron) into 4 lifecycle states: [BG], [WAIT], [DONE], [STUCK]. [HERE]/[LIVE]/[BUSY] keep existing meaning.
  • Add Session.Lifecycle() returning a single mutually-exclusive state computed from IsResponding, HasShellJobs, active crons, todo/task statuses, and JSONL mtime staleness.
  • Add matching search filters is:bg, is:wait, is:done, is:stuck. All existing has:* and is:* filters preserved.

State priority

  1. IsResponding[BUSY]
  2. HasShellJobs && IsLive or any active cron → [BG]
  3. IsLive + mtime ≥30min + unfinished work → [STUCK]
  4. IsLive + unfinished todo/task → [WAIT]
  5. Had todo/task, all completed[DONE]
  6. Otherwise no state badge

Test plan

  • go build ./...
  • go test ./... — 430 pass (incl. 12 new lifecycle tests + 4 new filter tests)
  • Visually verify badge column in ccx TUI shows new state badges and that legend in ? help reflects them
  • Try search queries: is:bg, is:wait, is:done, is:stuck filter correctly
  • Confirm has:mem/has:todo/has:plan/etc still work even though their badges are gone

Collapse the 12 "has memory / todo / plan / subagent / compaction /
skill / MCP / shell / fork / worktree / cron / task" badges into four
lifecycle states that describe what the session is actually doing:

  [BG]    background shell, Monitor, or active cron in flight
  [WAIT]  live and idle with unfinished todos/tasks
  [DONE]  had todos/tasks and they are all completed
  [STUCK] live but JSONL stale >30min with unfinished work

[HERE] / [LIVE] / [BUSY] keep their existing meanings. The
corresponding has:* search filters stay; new is:bg / is:wait /
is:done / is:stuck filters mirror the new badges so users can search
by state directly.
Copy link
Copy Markdown

@jinsekim jinsekim left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown

@jinsekim jinsekim left a comment

Choose a reason for hiding this comment

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

LGTM!

@gavin-jeong gavin-jeong merged commit bf54aa0 into master May 12, 2026
3 checks passed
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.

2 participants