Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[IAB] Agent 创建的标签固定 1280×720 视口,非 16:9 窗格被黑边框死,建议默认继承窗格尺寸

Aperta
#110 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
desktop

Direzione di ricerca

Start by reading packages/shared/src/browser-use/command-metadata.ts and the agent tab creation path that applies DEFAULT_AGENT_BROWSER_VIEWPORT; compare it with the free-size path for user-opened tabs. Check docs/viewport.md and control-browser/SKILL.md for the stated viewport behavior. Done when agent-created tabs adapt to the pane as proposed while screenshots retain a deterministic 1280×720 fallback.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

环境
  • ZCode Desktop(macOS arm64,darwin 27.0.0)
  • browser-use 插件 v0.5.1(官方内置)
现象

在 ZCode 内置浏览器(IAB)里:

  • 用户手动打开的标签:free-size,视口跟随窗格尺寸,拖动分隔条实时自适应 ✅
  • agent 通过 browser-use tabs.new() 创建的标签:一律固定 1280×720(16:9),在非 16:9 的窗格(实测 1186×984)中上下出现大片黑边,且不随窗格拖动变化 ❌

同一面板、同一会话内两种来源的标签行为不一致,用户观感是"面板比例被写死了"。

根因(源码已定位)

packages/shared/src/browser-use/command-metadata.ts:

/** Agent 创建或打开的新页面使用的固定逻辑 viewport;不属于人类浏览器显示偏好。 */
export const DEFAULT_AGENT_BROWSER_VIEWPORT = {
  width: 1280,
  height: 720,
} as const;

agent 建标签即套用该常量。注释表明这是刻意设计(给自动化一个确定性逻辑视口),但显示层没有做适配,导致逻辑视口的宽高比直接变成视觉上的黑边框死。

与官方文档矛盾
  1. browser-use 插件自带文档 docs/viewport.md:"Use an explicit viewport only for responsive or device-size testing. Otherwise keep the normal IAB viewport." —— 正常 IAB 视口恰恰不是 1280×720。
  2. browser-use skill 文档(control-browser/SKILL.md):"IAB automatically opens the target tab in free-size mode" —— 实际 agent 建的标签并非 free-size。
影响
  • agent 打开页面给用户看(调研结果、仓库、文档)是该插件的核心日常场景,黑边观感差;
  • 现有 workaround 是 agent 每次 setViewportSize() 对齐窗格实测尺寸,但那是固定值,用户拖动窗格后即失配,需反复手动对齐;
  • tab.close() 后重开仍会回到 1280×720,无法从外部根治。
建议

保留 1280×720 作为截图/自动化的确定性 fallback,但显示层二选一:

  1. agent 标签默认继承窗格逻辑尺寸(与用户手开标签行为一致);或
  2. 保持固定逻辑视口,但渲染时按窗格比例 fit(避免黑边),仅 screenshot 走 1280×720 逻辑坐标。
备注

ZCode 主仓库(zai-org/ZCode)issues 已关闭,故投递至本仓库,烦请维护者转交对应团队。如需更多实测数据(视口读数、页面 innerWidth/innerHeight 对照)可随时补充。


TL;DR: Tabs created by the agent via browser-use get a hardcoded 1280×720 logical viewport (DEFAULT_AGENT_BROWSER_VIEWPORT), which letterboxes the pane at any non-16:9 size, while user-opened tabs are free-size. Suggest inheriting the pane's logical size by default (or fit-rendering) and keeping 1280×720 only as the deterministic screenshot fallback.

Lingua principale
Python
Stelle
103
Fork
78
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di zai-org/zcode-plugins

Tutte le issue di zai-org/zcode-plugins

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.