Repository navigation
fix(browser): resolve agent dir for screenshot descriptions - #121941
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 3:39 AM ET / 07:39 UTC. ClawSweeper reviewWhat this changesThis PR passes the invoking agent identity through Browser plugin registration and screenshot description so media understanding can resolve the agent-scoped provider configuration. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessCurrent main still drops Browser’s agent identity before screenshot description; this exact-head PR restores it through the canonical resolver and remains necessary. No correctness finding was found; wait for the two in-progress exact-head checks before merge. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherAn agent calls the Browser plugin, which captures a screenshot and requests a text description. The effective agent identity selects the agent-scoped directory and provider configuration before the description returns to the agent. flowchart LR
A[Agent browser request] --> B[Browser plugin registration]
B --> C[Browser tool]
C --> D[Screenshot description]
D --> E[Session agent resolver]
E --> F[Media understanding]
F --> G[Description returned to agent]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +13, Tests +43. Total +56 across 5 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep Browser responsible for preserving invocation identity and media understanding responsible for resolving directories and credentials, then merge after exact-head checks finish green. Do we have a high-confidence way to reproduce the issue? Yes—current main omits Is this the best way to solve the issue? Yes—the patch preserves the authoritative Browser identity, uses the existing conflict-validating SDK resolver, and leaves directory and provider resolution in the established media-runtime owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ebf07e56e8de. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
Added redacted after-fix runtime evidence to the PR body (agent-driven browser screenshot on a live patched gateway now produces the |
49c2391 to
ce5dd43
Compare
|
@clawsweeper re-review Implemented the P1 exactly as instructed: rebased onto current main, |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Rebased onto current main again (resolved one conflict in |
ce5dd43 to
4a31795
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Fixes openclaw#121919. Preserve screenshot session ownership through the focused agent-scope SDK before media runtime resolves provider credentials. Co-authored-by: Dennis Tschersich <[email protected]>
4a31795 to
27ee67f
Compare
|
@clawsweeper re-review Maintainer repair and independent verification completed on exact head The root cause was the Browser plugin dropping its invoking agent identity before screenshot image understanding. The repaired Browser registration now carries the authoritative agent ID into the screenshot owner; that owner lazily resolves the effective identity through the focused The new owner-boundary regressions failed on unchanged main for all four expected cases: Browser registration discarded the agent ID, a session-owned default agent reached image understanding without an identity, an explicit worker agent also lost its identity, and conflicting agent/session identities were not rejected. The repaired owner and its existing sibling contracts now pass: Production delta: Rank-up move: non-default-agent screenshot with distinct live media credentials — skipped because those additional credentials are unavailable; real default-agent before/after proof plus explicit-worker and conflict-rejection regressions and all 74 tests cover the ownership invariant. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…#121941) Fixes openclaw#121919. Preserve screenshot session ownership through the focused agent-scope SDK before media runtime resolves provider credentials. Co-authored-by: Peter Steinberger <[email protected]>
Fixes #121919.
What Problem This Solves
On a default single-agent config (claude-cli runtime,
agentscontaining onlydefaults), every browser screenshot description fails with:The agent silently receives undescribed screenshots — vision is effectively disabled for the browser tool.
Root cause: the gateway-proxied browser tool path never threads an
agentDirintocreateBrowserTool, sodescribeBrowserScreenshotforwardsundefinedtodescribeImageFile, which throws inrunProviderEntry.Fix
Resolve the agent dir inside
describeBrowserScreenshotwhen the caller does not provide one, using the existing plugin-SDK resolvers (same pattern as the codex extension):ctx.agentDirstill wins (existing test keeps covering this),ctx.mediaScope.sessionKey/ctx.agentIdviaresolveSessionAgentIdsand resolve its dir viaresolveAgentDir.Evidence
Image understanding requires agentDir:falls back to the session agent dir when no agentDir is providedvitest run extensions/browser/src/browser/vision.test.ts→ 7/7 pass (6 existing + 1 new)[analyzed by …]header present instead ofimage: failed).🤖 Generated with Claude Code
After-fix runtime evidence (added 2026-08-13)
Live gateway (2026.7.1-2 dist patched with the equivalent fix), agent-driven browser screenshot during a real task. Redacted transcript excerpt of the browser tool result — the description header now appears where the run previously threw:
Before the fix, the same gateway logged 130/130 failures over two weeks (journal, host redacted):
After the fix: zero
requires agentDirfailures since 2026-08-11, first agent screenshot on 2026-08-13 described successfully as shown above.