Repository navigation
fix(media-proof): fetch GitHub attachment URLs for review evidence - #1484
Conversation
Extension-only discovery missed github.com/user-attachments assets, so reviewers received no screenshots and the media budget stayed at zero. Use a shared recognizer for both github.com attachment URL shapes and classify downloaded media from the GET response content type. Apply the same bounded media budget rule to those attachments. Existing input, host, and processing boundaries remain unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 9:02 PM ET / September 8, 2026, 01:02 UTC. ClawSweeper reviewWhat this changesRecognize GitHub attachment links, classify downloaded images and videos by response content type, and reserve bounded preparation time for them. Merge readiness✅ Ready for maintainer review This remains a useful fix: pinned main skips extensionless GitHub attachments. The implementation preserves existing preparation boundaries, and the supplied real-transport proof demonstrates the central repair. No actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper prepares media linked in review context before starting the reviewer. It downloads images and converts videos into contact sheets, then supplies local paths and preparation results to the review prompt. flowchart TD
A[Review bodies and comments] --> B[Discover media links]
B --> C[Bounded download]
C --> D{Response media type}
D --> E[Local image]
D --> F[Video contact sheet]
D --> G[Failure record]
E --> H[Reviewer evidence manifest]
F --> H
G --> H
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Use the existing bounded media preparation pipeline for GitHub attachments, with shared discovery rules and explicit unsupported-content results. Do we have a high-confidence way to reproduce the issue? Yes: an extensionless GitHub attachment in the review body fails main's filename-extension filter. Source inspection establishes the path, and the contributor records matching before/after output; this review did not execute it. Is this the best way to solve the issue? Yes: extending discovery and reusing the existing downloader and media handlers is a focused repair, with one shared recognizer keeping preparation and budgeting aligned. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b6297c4b6272. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes an issue where ClawSweeper reviews of pull requests with embedded screenshots reported "attachment retrieval failed" or "screenshots were inaccessible in this review environment", and scored visual verification as incomplete, whenever the images were uploaded through GitHub (drag-drop or the user-attachments API). This hit three openclaw/openclaw PRs on 2026-09-07 (openclaw/openclaw#141428, openclaw/openclaw#141429, openclaw/openclaw#141431) whose bodies carried before/after captures.
Why This Change Was Made
Media proof preparation discovered download candidates only by filename extension. GitHub attachment URLs (
https://github.com/user-attachments/assets/<uuid>and the legacyhttps://github.com/<owner>/<repo>/assets/<id>/<uuid>) have no extension, so nothing was downloaded for the network-isolated reviewer and the adaptive media time budget stayed at zero. A single shared recognizer now accepts exactly those twogithub.compath shapes, both for discovery and for the review budget. Attachments are fetched with the existing curl GET flags plus the response content type and effective URL, classified as image or video from the content type (anything else is recorded as a failed artifact), renamed with a matching extension, and then follow the unchanged image and video proof paths. Discovery still scans only the same context fields: PR patches and supplemental body excerpts never supply download URLs, and no other extension-less host is fetched.User Impact
Reviewers see the PR's actual screenshots and video contact sheets again, so visual verification and proof scoring reflect the evidence authors attached. Nothing changes for media linked with explicit file extensions.
OpenClaw Bay Impact
Unaffected. This changes reviewer-local media preparation and its existing time allowance, not publication payloads, queue semantics, status or telemetry fields, or any dashboard data contract.
Documentation Impact
README.md(active) gains a paragraph describing media proof discovery, including GitHub attachment URLs and content-type classification, next to the existing input-boundary statement.CHANGELOG.mdgets an Unreleased/Fixed entry. No runbook or volatile reference changes.Evidence
node --test test/review-prompt-policy.test.ts test/repair/adaptive-review-budget.test.ts: 78/78 passed. New coverage: both attachment URL shapes are discovered and non-github.comor malformed paths are not;image/png→ prepared image saved as.png;video/mp4→ ffprobe and contact sheet;text/html→ failed withunsupported content type; filename fallback from the effective URL; the existing "never causes host fetches" boundaries hold with attachment URLs placed in patch text and supplemental excerpts; the review budget adds 120 s per attachment, deduplicates, ignores known image extensions, and caps at 480 s.corepack pnpm run build,build:repair,format,git diff --check: pass.corepack pnpm run check: every static check, build, lint target, and the focused coverage gate passed; the full unit suite finished with 21 failures, in live-proof terminal/tmux environment tests and workflow subprocess tests on a host at load average ~97, none touching the changed modules. Several stalled task-owned subprocesses required termination; these failures have not been proven against a clean baseline, and aggregate coverage thresholds remain unverified. CI on this PR is the authoritative run for those suites.Real Behavior Proof
prepareMediaProofArtifactswith the real command runner (curl GET following the GitHub → S3 redirect), local file and manifest generation.https://github.com/user-attachments/assets/0ba4960d-7c53-4ce4-b737-f6e0b4c8f776, in a minimal PR-body context.corepack pnpm run build, then a Node harness invoking the builtprepareMediaProofArtifactswith the real command runner on macOS arm64, Node v24.20.0, local process, no container lease.detected=["…/0ba4960d-…"], one artifactkind: image,status: prepared,proof-image-1.pngof 10,960 bytes,filereportsPNG image data, 760 x 440, 8-bit/color RGB; the manifest and summary files are written.origin/mainmodule yieldsdetected=[]and an empty manifest, which reproduces the reported failure.