agentscope-ai / agentscope-ai/QwenPaw
[Bug]: Browser SDK spawns a new tab-group for every present()/open() call — pages can't share one group
- Ngôn ngữ chính
- Python
- Star
- 34.9k
- Fork
- 3.1k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 225
Mô tả
## QwenPaw Version
2.2.0b3
## Description
**Bug: Browser SDK spawns a new QwenPaw tab-group for every `present()` / `open()` call. Multiple pages cannot be kept in the same group.**
**What happened:**
When using the Browser SDK, each call to `browser.open(url)` or `browser.present(url)` creates a **brand-new, independent QwenPaw tab-group**, and each group contains exactly **one** tab. Even when all pages are opened within the **same `Browser.connect()` session**, the browser UI still shows a **separate group per URL**. For example:
- `present("https://www.bing.com/")` → group "bing.com" (1 tab)
- `present("https://www.baidu.com/")` → group "baidu.com" (1 tab)
Even though both were opened sequentially inside a single `Browser.connect()` session, the browser UI shows **two separate QwenPaw groups** (plus leftover empty tabs from prior attempts), not one group with two tabs.
**What I expected:**
All pages I open via the Browser SDK should live in **the same QwenPaw tab-group** (e.g. a single group named e.g. "baidu, bing"). This matches normal browser behavior where opening new tabs adds them to the current window, rather than spawning a new window/group each time. The user wants a single group with multiple tabs, but the SDK forces one group per page.
**Impact:**
Repeated operations (e.g. opening a page, checking it, retrying) accumulate a large number of "QwenPaw / single-tab" groups, which is very disruptive to the user (one sign-in retry spawned 20+ groups). There is no SDK method to add a second tab into an existing group, so the only workaround is to manually merge tabs in the browser UI, which is unacceptable for an agent workflow.
**Related PR(s):** #(optional)
**Security considerations:** None. This is a pure UI/session-isolation behavior issue; no auth/env/config exposure.
## Component(s) Affected
- [x] Core / Backend (app, agents, config, providers, utils, local_models) <- Browser SDK session/tab-group handling
- [ ] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy
## Environment
- **QwenPaw version:** 2.2.0b3
- **OS:** Windows 10 (AMD64)
- **Install method:** QwenPaw Desktop (Tauri) — installed at `C:\Users\Qing\AppData\Local\Programs\QwenPaw Desktop`
- **Browser backend:** Chrome variant (`variant=chrome`, `context=profile`, `identity=user`), actual browser = Quark (夸克) via the Chrome Browser SDK
- **Python version (if applicable):** Browser SDK (async Python)
## Steps to Reproduce
1. From a single agent session, connect the browser SDK: `browser = await Browser.connect()`.
2. Open the first URL: `page = await browser.present("https://www.bing.com/")`.
3. Without disconnecting / without a new session, open a second URL: `page2 = await browser.present("https://www.baidu.com/")`.
4. Inspect the real browser window (or `await browser.pages()`).
## Actual vs Expected
- **Actual:** The browser UI shows **two separate QwenPaw tab-groups** ("bing.com" and "baidu.com"), each containing exactly one tab. `pages()` returns 2 page refs, but they belong to different groups. Repeated calls accumulate many groups. There is no way to add a tab to an existing group via the SDK.
- **Expected:** All pages opened within the same `Browser.connect()` session should belong to **one single QwenPaw tab-group** (one group, multiple tabs), so an agent can operate on several pages without creating a new group/window each time. It should behave like `browser.new_tab()` in the same window, not `browser.new_window()`.
## Logs / Screenshots
Observed `session_status` (same session_id = `9e883225`), yet browser UI shows two groups:
```
session: SessionStatus(owner=...session_id='9e883225', variant=, context=, identity='user', connected=True)
pages(): 2
0 | https://www.bing.com/
1 | https://www.baidu.com/
```
User's direct observation in the real browser: "还是两个群组" (still two groups) — two separate QwenPaw groups, one tab each.
## Additional Notes
- This is the root cause of repeated "spawn too many groups" complaints during agent tasks (e.g. a sign-in retry loop creating 20+ empty/one-tab groups).
- Workaround today: none available at SDK level; the only fix is manually dragging tabs into one group in the browser UI, which is not viable for an autonomous agent.
- Suggested fix direction: either (a) make `present()`/`open()` in the same session reuse the existing group by adding a tab, or (b) expose a `new_tab()` / `add_tab_to_group()` method that opens a page inside the current group instead of always creating a new group.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.