Skip to content

fix(sidebar): prevent closed-tab agent rows from returning - #10334

Merged
nwparker merged 1 commit into
mainfrom
nwparker/fix-closed-agent-retention-race-9008
Jul 24, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/fix-closed-agent-retention-race-9008

Conversation

@nwparker

@nwparker nwparker commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Reopens and lands the fix from #9008 (self-closed by @craftowen; branch deleted) — the underlying bug (issue #8970) was never actually fixed on main (the issue was marked complete with no linking commit).

What: a cleanly-done agent row could re-appear in the sidebar after its tab closed, via a race in useRetainedAgents. The fix skips rows whose tab id is in the existing recentlyClosedAgentStatusTabIds marker.

Evidence: rebased on current main; useRetainedAgents.test.ts 7/7 pass on branch, and reverting only useRetainedAgents.ts to main fails 2 tests (fail-on-main/pass-on-branch). Zero regression.

Credit to @craftowen for the original fix. 🙏

Made with Orca 🐋

@nwparker
nwparker merged commit eea1577 into main Jul 24, 2026
1 check failed
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f96d098c-6379-44a0-b751-9ab2ae4828ac

📥 Commits

Reviewing files that changed from the base of the PR and between ec04827 and 931a4e2.

📒 Files selected for processing (2)
  • src/renderer/src/components/dashboard/useRetainedAgents.test.ts
  • src/renderer/src/components/dashboard/useRetainedAgents.ts

📝 Walkthrough

Walkthrough

useRetainedAgentsSync now passes recently closed agent status tab ids into retention collection. collectRetainedAgentsOnDisappear skips snapshots whose prior tab ids were recently closed. Tests update collection inputs and add coverage for different-tab closure, suppression consumption, and synchronization ordering during teardown and tab-closure commits.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

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.

1 participant