Skip to content

fix: sync topbar activity pill#2541

Merged
whoisasx merged 4 commits into
mainfrom
fix/session-topbar-agent-activity
Jul 9, 2026
Merged

fix: sync topbar activity pill#2541
whoisasx merged 4 commits into
mainfrom
fix/session-topbar-agent-activity

Conversation

@whoisasx

@whoisasx whoisasx commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • switch the session detail topbar pill to read raw session.activity.state
  • keep SCM/coarse status badges out of the topbar while leaving Summary > Activity unchanged
  • add ShellTopbar coverage for activity labels and SCM-derived status regression cases

Fixes #2540

Verification

  • npm run test -- src/renderer/components/ShellTopbar.test.tsx src/renderer/components/SessionInspector.test.tsx src/renderer/types/workspace.test.ts
  • npm run typecheck

@whoisasx

whoisasx commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@Pulkit7070 could you please test this locally and attach screenshots covering the agent activity states the topbar can show: Working, Idle, Input Needed, and Exited? If you can trigger the compact unknown/unavailable state, please include that too.

Please also confirm Summary > Activity still shows the combined activity plus SCM/context badges while the topbar stays limited to the raw agent activity state.

Pulkit7070 and others added 2 commits July 9, 2026 16:30
A stop/interrupt ends the turn (Stop hook -> idle), but the follow-up
Notification(idle_prompt) previously latched the session to the sticky
waiting_input state. The topbar pill (and inspector) therefore read
"Input Needed" for a session that is simply idle at the prompt awaiting
the next instruction.

Map idle_prompt -> idle; only permission_prompt (a real tool-approval
block) stays waiting_input. So stopping/finishing a turn now reads Idle,
while genuine permission requests still surface as Input Needed.

Refs #2540, #2541.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Overview of the pill across all agent activity states (+ SCM-ignored
cases) and two live-app confirmations, as evidence for #2541.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Pulkit7070

Copy link
Copy Markdown
Collaborator

Tested locally on fix/session-topbar-agent-activity. ✅

Checks

  • vitest (ShellTopbar + SessionInspector + workspace): 100 passed
  • tsc --noEmit: clean
  • CI on this branch: native (windows-latest) and native (ubuntu-latest) pass, plus test / lint / format.

Topbar pill across agent activity states

Rendered the real SessionStatusPill with the PR's mapping + live theme tokens — all states, and confirmation that SCM/coarse status is ignored (activity wins):

topbar activity states

Live app, Working and Idle:

live working
live idle

Follow-up fix included on this branch

While testing I hit a related quirk: after stopping/interrupting the agent, the pill showed Input Needed instead of Idle. Root cause was the backend classifier, not the pill — a Stop sets idle, but the follow-up Notification(idle_prompt) latched the session to the sticky waiting_input state.

Pushed a fix (0cb09476): in claudecode notificationState, idle_prompt → idle; only permission_prompt (a real tool-approval block) stays waiting_input. So a stop/finished turn now reads Idle, while genuine permission requests still surface as Input Needed. Added TestHooks_IdlePromptReportsIdle + updated the adapter/CLI tests (green on Windows + Linux in CI).

Note: this adds a small backend change to the branch — happy to split it into its own PR if you'd prefer to keep this one frontend-only.

Summary > Activity unchanged

The pill change only touches ShellTopbar.tsx, so the inspector's Activity row still combines both — agent activity (SessionInspector.tsx:281, InspectorActivityPill) and SCM/context states (:288, scmTimelineStates). Topbar shows only the raw activity state. Inspector keeps the fuller "Activity Unavailable" label for unknown; topbar uses the compact "Unknown" — consistent with the issue.

LGTM. ✅

@Pulkit7070 Pulkit7070 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving ✅

Tested locally on this branch: the topbar pill now reflects the raw agent activity state across all cases (Working / Idle / Input Needed / Exited / compact Unknown) and no longer shows SCM/coarse status. Summary > Activity still shows the combined activity + SCM/context badges. vitest + tsc --noEmit pass locally, and CI is green on windows-latest and ubuntu-latest. Screenshots + full breakdown in my comment above.

Also folded in a small backend fix (idle_prompt → idle) so a stop/interrupt reads Idle instead of a sticky Input Needed — see the comment for the rationale and the added tests.

@whoisasx

whoisasx commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this PR to avoid carrying duplicate backend activity changes alongside #2528.

Pulkit’s follow-up here and #2528 both address the same Claude Code behavior: idle_prompt should map to idle, while permission_prompt remains waiting_input. To keep the queue cleaner, we should let #2528 carry that backend fix. If the topbar-only UI behavior from this PR is still needed after that lands, it can be reopened as a smaller frontend-only change.

@whoisasx whoisasx closed this Jul 9, 2026
@whoisasx

whoisasx commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Reopening this PR — it was closed by mistake while intending to close #2528. This PR should remain open as the broader #2540 fix.

@whoisasx whoisasx reopened this Jul 9, 2026
@whoisasx whoisasx merged commit 39dbca0 into main Jul 9, 2026
20 checks passed
Annieeeee11 added a commit that referenced this pull request Jul 9, 2026
Restore activity-based topbar pill semantics from #2541 with tokenized
colors, add emitted ring-focus and rounded-xs tokens, and fix docs scan
leak plus trailing whitespace.
f1uke pushed a commit to f1uke/agent-orchestrator that referenced this pull request Jul 10, 2026
Cherry-picked from upstream 39dbca0, scoped to the frontend for main-fluke.

Frontend (taken): the topbar pill now shows the raw agent activity state
(active/idle/waiting_input/exited/unknown → Working/Idle/Input Needed/Exited/
Unknown) instead of the SCM-derived worker status; SCM/context stays in the
inspector's Activity row. This is AgentWrapper#2541's actual fix and applied cleanly.

Backend (rejected as redundant): AgentWrapper#2541 also mapped Claude Code idle_prompt → Idle
in activity.go. main-fluke already does exactly that — and more (it additionally
treats pre/post-tool-use as active and documents the recap/open-PR interaction),
so its DeriveActivityState/notificationState is a strict superset. Keeping
main-fluke's version; the activity.go/activity_test.go/hooks_test.go conflicts
were resolved to ours. Upstream's PR-evidence screenshots were dropped.

Behavior change (intended, per AgentWrapper#2541 + user confirmation): the topbar pill
tracks live agent activity rather than the SCM pipeline status.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Sync session topbar status to agent activity

2 participants