Repository navigation
Conversation
IRONICBo
left a comment
There was a problem hiding this comment.
One shared-window teardown edge case remains.
| // Moving a shared session page out is a user reclaim, including | ||
| // when onAttached has not yet reached the service worker. | ||
| if (tab.windowId === ctx.container.hostWindowId) | ||
| await this.sharedWindow.remove(tabId); |
There was a problem hiding this comment.
--in-window can still close the host window here. If the user has closed or moved every ordinary tab, the last live tab may be in agentCreatedTabs; Chrome closes a normal window when its final tab is removed (the window handler already notes this case). Shared teardown is not wrapped in withExpectedWindowClose, so it may also emit session.window_closed while normal stop completes. Please preserve an unowned survivor before deleting the final owned tab and mark the browser event as expected. A regression with only this session tab left should assert that the host survives and no close event is sent. I maintain socai, where persistent Chrome teardown keeps container lifetime separate from tab ownership.
There was a problem hiding this comment.
Thanks for catching this. Fixed in 7c5a124.
Shared-session teardown now creates an unowned about:blank tab before removing or moving out the host’s last tab. This covers both session stop and borrowed-tab return. Shared teardown uses ctx.stopping to suppress unexpected session.window_closed notifications.
If the operation is cancelled or fails, the unused placeholder is removed, unless it is the window’s last remaining tab or the user has already started navigating it elsewhere.
Regression tests assert that the host survives when only session tabs remain and that no window-closed notification is sent. I also verified the stop and return paths against an isolated headless Chrome on Windows.
Fixes #243.
Problem
bsk session startalways opens a dedicated Agent Window. In single-window and Arc workflows, this creates an extra window when the user wants the session's tabs in their current window. As reported in #243, Arc displays the extra window as an orphan belonging to no Space.Changes
bsk session start --in-window: the session tab is created in the last-focused normal, non-incognito user window instead of a new window.--no-focuscreates it as an inactive tab.about:blankpage when the operation would empty the host. Returning a tab to the same host does not create a placeholder. If the operation is cancelled or fails, remove the unused placeholder unless it is the host's last remaining tab or the user has navigated it elsewhere (including a pending navigation). Rollback failures are reported.session.tabs_closedand the daemon drops the session record. Normal teardown does not emit an unexpectedsession.window_closedevent.--in-windowagainst an older daemon, the daemon refuses it against an older extension, andsession listreports the container mode.Scope and safety
record startkeep their dedicated-window behavior.--in-windowconflicts with--width/--height, is rejected for remote connections, andwindow_resizeis refused for shared sessions.about:blanktab to keep the window open.Validation
tab_close, and tabs moved during CDP setup.Arc and macOS live-browser testing was not performed.