feat(forgejo): the issue's screenshots land in the worktree and the brief names them (#405) #406

Merged
cmoriarty merged 1 commit from issue-405-brief-assets into main 2026-11-06 22:11:59 -05:00
Owner

What

An issue's image attachments reached the agent only as markdown links, so a run from a screenshot-only issue worked blind on exactly what the operator showed it (braid#405).

  • Issue.assets parses the forge's assets array; download_issue_assets fetches each image with the token, verifies the bytes (magic bytes, 25 MB cap), and saves it under a deterministic name in .osf/brief-assets/ — under .osf/, so it stays out of the PR diff (braid#224).
  • brief_from_issue points an embedded screenshot at its saved file ("read it before you plan or write code — the read tool shows you the image") and lists attachments the text never references, so a screenshot-only issue is still a request. The old "cannot view it" wording stays only where the attachments are not wired in.
  • script.brief runs the new best-effort osf.forgejo brief-assets step, which says in the brief itself when a named screenshot does not land — the step never fails the run.
  • The wizard and webhook entry points both build the brief with the assets directory, so the pointers are there from the second the run exists.

Verification

  • Full suite green: ./tools/test.sh in 22s (485 backend, UI types + vitest, build, 39 browser journeys). 16 new tests, all tagged # issue: braid#405.
  • Against the real forge: all 3 screenshots of cmoriarty/scratch-vllm-fp8#6 downloaded through the real code path (exact sizes, PNG magic), the brief points each at its file, and one downloaded image rendered in the model context via the read tool — the acceptance criterion.
  • Sim unaffected: the sim forge's issue JSON has no assets, so the step is a no-op.

Also

Fixes the rotten app-chrome tag in ui/src/components/chrome.test.ts that had the suite red on main since the requirement was renamed in #391 — the one-line repair is what turns CI green here.

Part of #405

## What An issue's image attachments reached the agent only as markdown links, so a run from a screenshot-only issue worked blind on exactly what the operator showed it (braid#405). - `Issue.assets` parses the forge's `assets` array; `download_issue_assets` fetches each image with the token, verifies the bytes (magic bytes, 25 MB cap), and saves it under a deterministic name in `.osf/brief-assets/` — under `.osf/`, so it stays out of the PR diff (braid#224). - `brief_from_issue` points an embedded screenshot at its saved file ("read it before you plan or write code — the read tool shows you the image") and lists attachments the text never references, so a screenshot-only issue is still a request. The old "cannot view it" wording stays only where the attachments are not wired in. - `script.brief` runs the new best-effort `osf.forgejo brief-assets` step, which says in the brief itself when a named screenshot does not land — the step never fails the run. - The wizard and webhook entry points both build the brief with the assets directory, so the pointers are there from the second the run exists. ## Verification - Full suite green: `./tools/test.sh` in 22s (485 backend, UI types + vitest, build, 39 browser journeys). 16 new tests, all tagged `# issue: braid#405`. - Against the real forge: all 3 screenshots of `cmoriarty/scratch-vllm-fp8#6` downloaded through the real code path (exact sizes, PNG magic), the brief points each at its file, and one downloaded image rendered in the model context via the read tool — the acceptance criterion. - Sim unaffected: the sim forge's issue JSON has no `assets`, so the step is a no-op. ## Also Fixes the rotten `app-chrome` tag in `ui/src/components/chrome.test.ts` that had the suite red on main since the requirement was renamed in #391 — the one-line repair is what turns CI green here. Part of #405
feat(forgejo): the issue's screenshots land in the worktree and the brief names them (#405)
All checks were successful
test / suite (pull_request) Successful in 1m18s
1db26b85f2
An issue's image attachments reached the agent only as markdown links, so a
run from a screenshot-only issue worked blind on exactly what the operator
showed it.

- Issue.assets parses the forge's assets array; download_issue_assets fetches
  each image with the token, verifies the bytes, and saves it under a
  deterministic name (.osf/brief-assets/, out of the PR diff via braid#224).
- brief_from_issue points an embedded screenshot at its saved file and lists
  attachments the text never references; the old 'cannot view it' wording
  stays only where the attachments are not wired in.
- script.brief runs the new best-effort 'osf.forgejo brief-assets' step, which
  says in the brief itself when a named screenshot does not land.
- The wizard and webhook entry points both build the brief with the assets
  directory, so the pointers are there from the second the run exists.

Also fixes the rotten app-chrome tag in chrome.test.ts that had the suite
red on main since the requirement was renamed in #391.
cmoriarty deleted branch issue-405-brief-assets 2026-11-06 22:11:59 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid!406
No description provided.