You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: restore browser metadata after guest recovery - #42494
A recovered browser page can display its redirected document while the address bar still shows the URL entered before the redirect. Keep the page’s metadata subscription alive through registration repair and replay the final URL once recovery succeeds.
What Changed
Keep mounted metadata subscribers until their disposer runs; retirement notifications respect synchronous disposal and exclude new subscribers from the retiring batch. After validated recovery clears its error, refresh authoritative guest metadata through the existing snapshot and URL-persistence path. Existing request-identity and live-guest guards remain in place.
Remove the paired-preview E2E test’s native window-activation setup. Its real mouse input, containment, cancellation and link-confirmation assertions now run with hidden windows. Production authorization and background-launch guards remain unchanged. Scope the preview test’s positive-control tab creation and close to its captured source group/worktree, and fail explicitly if no matching control tab exists.
Why
The pinned-main control reproduces both the stale redirect URL and the preview test’s forbidden native-focus request. This prerequisite fix is separate from the folder-layout refactor in #42478.
Linked Issue
N/A — maintainer-requested cleanup uncovered these existing failures; no new tracking issue needed.
Visual Proof
Before: pinned-main Linux CI shows /redirect in the address bar while the guest displays painted-redirected-guest. After: the final rebased fix on macOS shows /redirected in both the address bar and tab title. These are hidden-renderer CDP captures; window sizes and platforms differ.
Testing
Manually exercised UI (automated hidden Electron validation used).
Added one owning-layer regression, which fails on the original cache and passes with this fix.
Added test uses public subscriptions and hardcoded URL outcomes; no private-work or mock-call counts.
Local macOS validation with ORCA_BACKGROUND_LAUNCH=1:
All 3 cache tests pass after the retirement-review correction.
Both complete browser E2E specs pass: 8 cases, rebuilt in E2E mode, one worker.
Renderer typecheck and scoped lint/format pass.
Final rebased redirect case passes again during screenshot capture (11.3 seconds).
Independent reviews cover disposal, retirement reentrancy, stale reads and recovery ownership.
Rebased cleanly onto 042c4516; all four authored outputs are byte-identical after rebase.
Latest required pnpm check:changed: all 31 checks passed in 241.2 seconds immediately before the normal push of 8f61d791. Hosted checks remain required before merge.
Initial hosted validation passed typechecks, all 12 unit shards and Linux/Windows packaging, but the preview case failed later while waiting for its positive-control URL tab to close. Its trace does not record whether the old scope-dependent close loop dispatched a command; no confirmed selection-drift claim.
The amended full paired-preview spec passes locally: 3 cases in 40.1 seconds. Independent review confirms all host-removal, containment and consent assertions remain intact. Fresh hosted validation remains required.
Risk
Level: Medium. Recovery requests one authoritative snapshot after successfully clearing its error. Incorrect subscriber cleanup could leave a pane stale or retain callbacks; disposer and stale-request ownership are reviewed. Existing registration, navigation, replacement and authorization checks remain in place. A plain revert rolls back both the cache fix and harness change. Local runtime evidence is macOS; hosted Linux/Windows checks are inspected before merge.
Review
Native Codex independent reviews found and verified the retirement callback-membership correction. Plans and detailed evidence remain local.
Agent skill upstream boundary
Not applicable: no upstream skill-installer material copied or translated.
Notes
No new platform, SSH, remote-host, mobile, filesystem, workspace-kind or persisted-format assumptions. No timer, polling loop or compatibility module added.
Checklist
Focused prerequisite browser fix.
Explained behavior, cause and mechanism.
Stated risk and plain-revert rollback.
Before/after screenshots attached.
Self-reviewed correctness, security and performance.
Considered cross-platform and remote impact.
Local focused validation passed; final gate runs before push and CI supplies broader platform coverage.
No actionable comments were generated in the recent review.
Walkthrough
The guest metadata cache retains listener subscriptions while notifying listeners during guest retirement. It adds an exported refresh function, which the guest session calls after clearing a recovery error. A cache test checks updates after retirement and disposal. The paired remote HTML preview test now opens its positive-control tab in the captured source group, targets cleanup to a specified worktree, and removes a paired-client focus and visibility assertion.
Merge Risk: Minimal · up to 8f61d
This change keeps browser page metadata updating after guest recovery and simplifies a paired-preview end-to-end test. No concrete merge-blocking risk was found; the remaining step is the cross-platform CI checks the author already listed.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Description check
The description is detailed and follows most of the template. It has ELI5, What Changed, Why, Visual Proof, Testing, Risk (Level: Medium), Review, Agent skill upstream boundary, Notes, and Checklist s…
1. Link a real issue in the Linked Issue section, or confirm that the author is a StablyAI maintainer and that no new issue is needed. Replace the N/A line with the issue reference, or state the maintainer status clearly. 2. Add the AI Disc…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title "fix: restore browser metadata after guest recovery" matches the main change. The PR keeps browser metadata subscribers alive through registration repair and refreshes guest metadata after v…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix: restore browser metadata after guest recovery" matches the main change. The PR keeps browser metadata subscribers alive through registration repair and refreshes guest metadata after validated recovery clears its error. The title is concise, uses a conventional prefix, and names the primary fix. The E2E test harness change is secondary and is not named, which is acceptable.
Full details: Description check
Explanation
The description is detailed and follows most of the template. It has ELI5, What Changed, Why, Visual Proof, Testing, Risk (Level: Medium), Review, Agent skill upstream boundary, Notes, and Checklist sections. Two gaps keep the check from passing. First, the Linked Issue section says N/A and gives a maintainer-cleanup reason. The template says an issue should always exist for outside contributors, and the author does not state whether they are a maintainer. Second, the AI Disclosure section is missing. The template says to fill it in unless the author is a StablyAI team member, and the description does not address it. The Testing checkboxes are also mixed. The manual-testing box is unchecked, and the author notes that manual UI testing was not done, only automated hidden Electron validation. The Fixes # line from the template is also absent.
Resolution
Link a real issue in the Linked Issue section, or confirm that the author is a StablyAI maintainer and that no new issue is needed. Replace the N/A line with the issue reference, or state the maintainer status clearly. 2. Add the AI Disclosure section. Either state which AI model, if any, was used, or state that the author is a StablyAI team member and the section does not apply. 3. Clarify the Testing section. State whether manual testing was done, or explain that only automated hidden-renderer validation was run and which platforms were covered. 4. Restore the Fixes # line, or explain why it does not apply.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
A recovered browser page can display its redirected document while the address bar still shows the URL entered before the redirect. Keep the page’s metadata subscription alive through registration repair and replay the final URL once recovery succeeds.
What Changed
Keep mounted metadata subscribers until their disposer runs; retirement notifications respect synchronous disposal and exclude new subscribers from the retiring batch. After validated recovery clears its error, refresh authoritative guest metadata through the existing snapshot and URL-persistence path. Existing request-identity and live-guest guards remain in place.
Remove the paired-preview E2E test’s native window-activation setup. Its real mouse input, containment, cancellation and link-confirmation assertions now run with hidden windows. Production authorization and background-launch guards remain unchanged. Scope the preview test’s positive-control tab creation and close to its captured source group/worktree, and fail explicitly if no matching control tab exists.
Why
The pinned-main control reproduces both the stale redirect URL and the preview test’s forbidden native-focus request. This prerequisite fix is separate from the folder-layout refactor in #42478.
Linked Issue
N/A — maintainer-requested cleanup uncovered these existing failures; no new tracking issue needed.
Visual Proof
Before: pinned-main Linux CI shows
/redirectin the address bar while the guest displayspainted-redirected-guest. After: the final rebased fix on macOS shows/redirectedin both the address bar and tab title. These are hidden-renderer CDP captures; window sizes and platforms differ.Testing
Local macOS validation with
ORCA_BACKGROUND_LAUNCH=1:042c4516; all four authored outputs are byte-identical after rebase.pnpm check:changed: all 31 checks passed in 241.2 seconds immediately before the normal push of8f61d791. Hosted checks remain required before merge.Risk
Level: Medium. Recovery requests one authoritative snapshot after successfully clearing its error. Incorrect subscriber cleanup could leave a pane stale or retain callbacks; disposer and stale-request ownership are reviewed. Existing registration, navigation, replacement and authorization checks remain in place. A plain revert rolls back both the cache fix and harness change. Local runtime evidence is macOS; hosted Linux/Windows checks are inspected before merge.
Review
Native Codex independent reviews found and verified the retirement callback-membership correction. Plans and detailed evidence remain local.
Agent skill upstream boundary
Notes
No new platform, SSH, remote-host, mobile, filesystem, workspace-kind or persisted-format assumptions. No timer, polling loop or compatibility module added.
Checklist