[Bug]: In-app Browser opens a new tab for every navigation and never reuses or closes one — the tab strip fills with identical duplicate tabs
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- electron, typescript
Hướng nghiên cứu
Start by reading embedded-browser-manager.js, especially runAgentBrowserAction() and openAgentTab(), then inspect builtin-browser-defs.js, control.js, and persistent-browser-registry.js. Trace how agent actions create, reuse, close, and persist tabs; choose a reuse or close behavior and verify it through the browser action flow. Done means repeated visits no longer cause uncontrolled duplicate tabs, with behavior covered for the chosen path.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Using the in-app Browser (right-side FilePanel) in a Desktop session, every page visit appends a new tab. Nothing reuses or closes a tab, so after a few iterations the tab strip is full of identical entries with the same title and the same URL.
On my machine (3.1.10.145, Windows) the persisted tab registry currently holds:
session A: 9 tabs
[0] 合板预检 · Conform Pre-flight http://127.0.0.1:<port>/index.html#/report
[1] 合板预检 · Conform Pre-flight http://127.0.0.1:<port>/index.html#/report
[2] 合板预检 · Conform Pre-flight http://127.0.0.1:<port>/index.html#/report
[3] 合板预检 · Conform Pre-flight http://127.0.0.1:<port>/index.html#/report <-- same URL x4
[4] 合板预检 · Conform Pre-flight http://127.0.0.1:<port2>/index.html#/report
[5] 合板预检 · Conform Pre-flight http://127.0.0.1:<port2>/index.html#/exec
[6] 合板预检 · Conform Pre-flight http://127.0.0.1:<port3>/index.html#/project
[7] 合板预检 · Conform Pre-flight http://127.0.0.1:<port3>/index.html#/scan
[8] 合板预检 · Conform Pre-flight http://127.0.0.1:<port3>/index.html#/colour
session B: 7 tabs, all http://localhost:<port>/home/analysis
The tab strip shows 7 tabs all titled "合板预检 · Conform Pre-flight" — visually indistinguishable from each other.
Steps to reproduce
- Desktop app → open a session → use the in-app Browser on a page you iterate on (a local dev server is easiest:
http://127.0.0.1:<port>/index.html#/report). - In the same session, have the agent look at that page several times (re-check after a change, re-read the report, ...), or open the same link again.
- Look at the Browser tab strip: one new tab per visit, all with the same title and URL.
Expected and actual behavior
Expected: revisiting a URL the Browser already has open focuses/reuses that tab — or at minimum the agent can close the tabs it opened.
Actual: unbounded tab growth, all duplicates. No agent-side way to clean up, and the duplicates are persisted across restarts.
Root cause (from the shipped 3.1.10 main-process bundle)
-
navigaterefuses to reuse a loaded tab.embedded-browser-manager.js→runAgentBrowserAction():if (tool === 'navigate' && hasLoadedBrowserPage(tab.url) && rawArgs.replaceCurrentTab !== true) { throw new Error('CURRENT_TAB_OCCUPIED: Current Browser tab already has a loaded page; retry with open_tab'); }The tool schema (
builtin-browser-defs.js) tells the model: "Set true only when the user explicitly asked to replace or reuse the currently loaded Browser tab. Omit it for blank tabs and use open_tab to preserve a loaded page." The provider guidance repeats it: "Use navigate only when the current FilePanel tab is absent or blank… use open_tab by default to preserve it." So for any already-loaded tab the model is steered toopen_tab. -
open_tabalways creates a new tab.openAgentTab()callsthis.openTab({ active: false, bounds: OFFSCREEN_BOUNDS, sessionId }), which allocates a freshtabId+WebContentsView, then navigates it and returnsopenedInNewTab: true. There is no lookup for an existing tab with the same URL. -
The agent cannot close tabs.
BROWSER_BROKER_ACTIONS(dist/main/modules/local-runtime/utility/control.js) exposesopen_tabbut noclose_tab. Nothing in the agent tool surface can destroy a tab. -
The "new tab" IPC path only dedupes in-flight calls.
createNewEmbeddedBrowserTab()keeps a pending map keyed bysessionId + initialUrland returns the in-flight promise; sequential opens of the same URL are never deduped against existing tabs. -
Persistence keeps the duplicates.
persistent-browser-registry.js:MAX_PERSISTED_BROWSER_TABS_PER_SESSION = 10,.slice(-10), no URL dedup — up to 10 identical entries are persisted and restored, and older ones are silently dropped.
Net effect: N navigations = N tabs, with no reuse path and no close path.
Suggested fixes (any one helps a lot)
open_tab: if a tab in the session already has the same normalized URL, focus + navigate it in place instead of creating a new one (or add an explicitreusemode).- Add a
close_tabaction, and/or auto-close agent-opened tabs when the turn that opened them ends. - Let
navigatereplace the current tab by default when that tab was opened by the agent rather than by the user. - Dedupe by URL in
PersistentBrowserRegistry, and cap live tabs per session with LRU eviction.
Environment
- Desktop app 3.1.10.145, Windows 11 x64 (10.0.26200)
- In-app Browser provider:
electron-file-panel - Registry file:
%APPDATA%/MiniMax/embedded-browser-tabs.json(electron-store, nameembedded-browser-tabs)
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 315
- Merge trung bình
- 3 giờ 54 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MiniMax-AI/minimax-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MiniMax-AI/minimax-code#639 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
MiniMax-AI/minimax-code#636 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MiniMax-AI/minimax-code#615 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
MiniMax-AI/minimax-code#556 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MiniMax-AI/minimax-code#507 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MiniMax-AI/minimax-code
Issue tương tự
-
area:api bug good first issue priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Doezer/Questarr#1486 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:import difficulty:good-first good first issue help wanted priority:P1 roadmap size:S type:test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Sergey-Bar/Penny#245 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mihazs/lazysh#3377 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Approve the Cloudflare agent plugin for harness sessionsCó thể đã có người làm @joshtsch đã nhận hôm nay. Đang mởenhancement ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày