Tencent / Tencent/BrowserSkill

Session does not auto-disconnect and cannot reuse an already-open tab/window | session 不会自动断开,且不能复用已打开页签

Open
#279 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.7k
Forks
399
Avg merge
2d 9h
Merged PRs (30d)
74

Description

Problem

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.

Related

  • #243: run session tabs inside the current user window/tab group.
  • #216: sessions/browser windows left open without doing work.
  • #245: interrupted start can orphan an Agent Window.

中文摘要: 当前 bsk session start 总会新建一个 Agent Window,不能直接复用用户当前窗口或已经打开的页签;tab borrow 只是把页签移动进新窗口,仍然会产生额外窗口。另一个问题是 session 依赖显式 session stop,任务中断、连接断开或调用方退出时不会自动清理,容易残留 session 和窗口。希望支持复用现有窗口/页签,并在调用方断开、任务结束或启动取消时自动完成 session 清理和孤儿回收。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the bsk session start, session stop, session list, tab list, and tab borrow entry points and compare their current ownership and cleanup behavior. Review related issues #243, #216, and #245 for existing constraints. Done means the requested reuse and lifecycle behavior is defined, including cancellation, disconnect cleanup, orphan recovery, and session ownership visibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.