Skip to content

Fix stale agent attention indicators - #5517

Merged
Jinwoo-H merged 2 commits into
stablyai:mainfrom
OrcaWin:OrcaWin/bug-false-agent-running-notifications-persist-fo
Jun 16, 2026
Merged

Jinwoo-H merged 2 commits into
stablyai:mainfrom
OrcaWin:OrcaWin/bug-false-agent-running-notifications-persist-fo

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Jun 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • suppress stale title-derived parent rows when a completed worker/child row already owns that parent pane
  • carry agent state timing through delayed completion notifications and drop stale completion snapshots after a newer turn starts
  • preserve stable completion notification ids when delayed hook completions dispatch after the live row is gone

Tests

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/useWorktreeAgentRows.test.ts src/renderer/src/components/sidebar/use-worktree-activity-status.test.tsx src/renderer/src/components/sidebar/worktree-agent-activity-summary.test.ts src/renderer/src/lib/worktree-status.test.ts src/renderer/src/lib/worktree-status-terminal-layout-roots.test.ts src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts src/renderer/src/hooks/agent-hook-completion-notifications.test.ts
  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts src/renderer/src/hooks/agent-hook-completion-notifications.test.ts src/renderer/src/components/terminal-pane/agent-completion-coordinator.test.ts src/renderer/src/hooks/useIpcEvents.test.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts -t "notification|agent status|completion|worktree-attributed"
  • pnpm run typecheck:web

Open in Stage

@ghost

ghost commented Jun 16, 2026 •

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7a7862d5-d160-4f54-9b21-ac5cfc94a619

📥 Commits

Reviewing files that changed from the base of the PR and between b47346330458e328afc6507e0c26abb0a35302c6 and b079967.

📒 Files selected for processing (13)
  • src/renderer/src/components/sidebar/useWorktreeAgentRows.test.ts
  • src/renderer/src/components/sidebar/worktree-agent-rows.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator-types.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.ts
  • src/renderer/src/components/terminal-pane/agent-completion-snapshot-staleness.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/terminal-notification-state.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.ts
  • src/renderer/src/hooks/agent-hook-completion-notifications.test.ts
  • src/renderer/src/hooks/agent-hook-completion-notifications.ts
  • src/renderer/src/hooks/useIpcEvents.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/agent-completion-snapshot-staleness.ts
  • src/renderer/src/hooks/agent-hook-completion-notifications.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/renderer/src/components/terminal-pane/agent-completion-coordinator-types.ts
  • src/renderer/src/hooks/agent-hook-completion-notifications.test.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts
  • src/renderer/src/components/sidebar/useWorktreeAgentRows.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.ts

📝 Walkthrough

Walkthrough

This PR introduces AgentCompletionStatusSnapshot, a type extending ParsedAgentStatusPayload with an optional stateStartedAt timestamp field. The type is propagated through the agent completion coordinator, pty-connection, hook notification observer, and IPC event handler, with each layer merging or injecting the stateStartedAt value from stored state. A new isSupersededAgentCompletionSnapshot utility compares stored vs. snapshot timestamps and state to determine staleness; the notification dispatcher uses this as an early-return guard for agent-task-complete events to suppress stale completions. A new terminal-notification-state module introduces utilities for detecting pane liveness, activity state, and PTY suppression status to support notification disambiguation. Separately, buildWorktreeAgentRows gains two internal helpers that mark a completed worker's orchestrated parentPaneKey as seen before the title-derived row path runs, preventing a synthesized "working" parent row from appearing when the child worker is already in the done state.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete. While it provides a clear Summary and comprehensive testing instructions, it is missing required sections: Screenshots, AI Review Report, Security Audit, and Notes. Only 2 of 6 key template sections are adequately filled. Add Screenshots (or 'No visual change'), AI Review Report with cross-platform compatibility verification, Security Audit summary, and Notes section addressing platform-specific behavior and follow-up work.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix stale agent attention indicators' clearly and concisely summarizes the main objective of the changeset—addressing stale attention indicators through three coordinated fixes across agent notification, state timing, and row synthesis logic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@OrcaWin
OrcaWin force-pushed the OrcaWin/bug-false-agent-running-notifications-persist-fo branch from b473463 to b079967 Compare June 16, 2026 19:31
@Jinwoo-H
Jinwoo-H merged commit 16c8988 into stablyai:main Jun 16, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 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.

3 participants