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
Session does not auto-disconnect and cannot reuse an already-open tab/window | session 不会自动断开,且不能复用已打开页签 #279
There are two related usability problems in the current session model:
1. An existing tab/window cannot be reused in place
bsk session start always creates a new browser window with its own about:blank tab. It cannot attach to the user’s current window or directly reuse an already-open tab.
The current tab list and tab borrow flow does not solve this: borrowing physically moves the user tab into the newly created Agent Window. It is not an in-place shared session, and the user still gets an extra browser window. This makes normal agent work feel like every request opens another window/tab.
2. Sessions are not automatically disconnected or cleaned up
bsk session stop is mandatory for cleanup. If the agent turn is interrupted, the CLI/client exits unexpectedly, the connection is lost, or the agent forgets the stop call, the session and Agent Window remain open. The current idle timeout is only a delayed safety net, not lifecycle-bound cleanup.
Interrupted session start can also leave an orphan Agent Window that is not registered to the caller and cannot be cleaned up through the normal plugin/session path.
From the user’s perspective, multiple old sessions and windows accumulate and must be found and closed manually.
Request
Support reusing the current browser window and/or an already-open tab without creating a new Agent Window. This could be an owner-scoped session or a tab-group-based session instead of a window-bound session.
Automatically stop the session when the owning agent/client disconnects, the task turn ends, or the start/operation is cancelled. Cleanup should return borrowed tabs, close agent-created tabs, close the Agent Window when appropriate, and remove the session record.
Consider an explicit --ephemeral/--auto-stop-on-disconnect mode if automatic cleanup cannot be the default, and recover orphan sessions on the next startup or first CLI call.
Make session list expose enough ownership/lifecycle information for stale-session diagnosis.
This behavior would remove the need for local session-mapping/reuse workarounds in agent harnesses such as Codex and make multi-session use predictable.
Activity
feat(session): reuse existing tabs and automate cleanup
feat(session): reuse existing tabs and automate cleanup
feat(session): reuse existing tabs and automate cleanup