Skip to content

fix(browser): rerun guest retention after veto release - #12430

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/review-audit-12232
Aug 4, 2026
Merged

fix(browser): rerun guest retention after veto release#12430
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/review-audit-12232

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #12232. The merged interrupted-download fix updated only module-local veto state, so the Terminal guest-budget effect did not rerun when a download, automation lease, or mobile driver released its veto. An over-budget live guest could therefore remain retained until an unrelated worktree, surface, or setting change.

This change:

  • invalidates the guest-retention pass when download activity crosses active/inactive
  • subscribes the same pass to automation visibility and mobile-driver changes
  • deduplicates duplicate progressing/null/unknown download events, avoiding work per progress tick
  • removes download, automation, and mobile subscriptions with the Terminal host

The sanctioned eviction path is unchanged: selected worktrees still fully destroy their guests through destroyWorktreeBrowserGuests; no live guest is unmount-detached.

Testing

  • 48 focused Vitest cases across download activity, automation visibility, mobile driver state, guest retention selection, webview cleanup, and registry lifecycle
  • pnpm run typecheck:web
  • oxlint and type-aware lint on the changed renderer paths
  • oxfmt check, max-lines ratchet, and git diff --check
  • two same-model/xhigh audit passes; final pass returned CLEAN with no further edits

Electron validation

Attached via CDP to the intended review-audit-12232 dev instance, selected the real workspace through the sidebar, opened a Browser tab through the New tab menu, and navigated to Example Domain. The rendered browser surface loaded successfully; backing store state showed the page URL as https://example.com/ with loading=false. The interrupted/resumed download transition is state/lifecycle behavior without a dedicated visible indicator, so that exact transition is covered by the deterministic activity tests rather than claimed from the screenshot.

browser-retention-follow-up.png

Scope

Desktop renderer only; no mobile code changed. This PR is intentionally not merged.

@coderabbitai

coderabbitai Bot commented Aug 4, 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 Plus

Run ID: 9a4eeae1-f587-45ba-89d3-b3962fc0bf90

📥 Commits

Reviewing files that changed from the base of the PR and between 5bd2f59 and 5335cb2.

📒 Files selected for processing (5)
  • src/renderer/src/components/Terminal.tsx
  • src/renderer/src/components/browser-pane/browser-automation-visibility.test.ts
  • src/renderer/src/components/browser-pane/browser-automation-visibility.ts
  • src/renderer/src/components/browser-pane/browser-page-download-activity.test.ts
  • src/renderer/src/components/browser-pane/browser-page-download-activity.ts

📝 Walkthrough

Walkthrough

Browser download activity now reports active-state transitions through an optional callback. Browser automation visibility now supports listener subscriptions. Terminal subscribes to download, automation visibility, and mobile-driver changes. Each notification increments a retention revision and triggers browser guest eviction evaluation. Cleanup removes all subscriptions. Tests cover visibility listener cleanup and download transition notification behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and testing, but it omits the required AI Review Report, Security Audit, Notes, and template-based Screenshots section. Add the missing required sections and document the requested review, security, platform-compatibility, and testing details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: rerunning browser guest retention after veto release.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Pre-merge gate Electron evidence (fresh run on PR head 5335cb25): attached via CDP to the intended gate-12430 dev instance, selected the real worktree through the sidebar, opened a Browser tab through the New tab menu, and navigated to Example Domain. The full rendered surface was visible; backing store state reported https://example.com/, title Example Domain, and loading=false. The veto-release transition itself has no dedicated UI indicator, so that lifecycle behavior is verified by the focused deterministic tests rather than claimed from this screenshot.

pr-12430-electron-browser.png

@brennanb2025
brennanb2025 merged commit 086a5d6 into main Aug 4, 2026
43 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.

1 participant