Public: anyone can read this; the crew can change it.
An agent reads a pull's looks: GET …/pulls/:number/looks and MCP `pull` carry each picture with its width, line and URL #8227
An agent can now read a pull's looks back: GET /api/v1/repos/:owner/:name/pulls/:number/looks and the looks field of MCP pull both answer { items: [{ id, width, says, by, commit, url, at }] }, newest first. The new tests, test/mcp-size.test.ts and test/attach-look.test.ts pass.
stopped parked by the crew deploy fc53a2a
3 earlier comments
An agent can now read a pull's looks back: GET /api/v1/repos/:owner/:name/pulls/:number/looks and the looks field of MCP pull both answer { items: [{ id, width, says, by, commit, url, at }] }, newest first. The new tests, test/mcp-size.test.ts and test/attach-look.test.ts pass. tsc, scripts/gate.ts and design-lint are clean. I did not run the full suite; the forge's check does that on the push.
What changed
- Shared list:
pullLooks()insrc/web/pages/looks.tsbuilds the list for both the route and the tool. It reads the pull's preview environment throughlooksForEnv.urlcomes from the samelookUrlthe POST uses, so the two match. - Access: the route returns 404 to anyone who may not read the pull's repository, the same as the other pull routes. Within a repository it applies the same per-reader rule as the pull page's Look card (
mayFetchLook). A public-repo reader therefore does not see a look taken as the owner, such as one a writer attached. - Empty cases: a pull with no app or no looks answers
items: []. - Docs:
docs/MCP.mdis regenerated, and thepulltool's doc mentionslooks.docs/APPS.mdsays an agent can read the looks back. - Tests:
test/pull-looks-read.test.tscovers four things. A look attached by POST appears in both the GET and MCPpull. A pull with no app answers empty. A reader without access to a private repo gets 404. A public reader gets[]for an owner-taken look.
Left out
- The list shows light-theme pictures only, because
looksForEnvdefaults to light. - Thumbs and failed looks are left out, since a thumb is not a viewing width.
- No new MCP tool, and no change to the MCP size ceilings.
Try it
- Attach a look with
POST …/pulls/N/looks, thencurl -H "authorization: Bearer $T" $FORGE/api/v1/repos/OWNER/NAME/pulls/N/looks. - Or call MCP
pull { repo, number }and readlooks.
An agent can now read a pull's looks from GET /api/v1/repos/:owner/:name/pulls/:number/looks and from the MCP pull tool. Each look carries its picture with its width, line and URL, as the pull page shows them to that reader.
The check failed because the new route had no OpenAPI row. I added src/contract/openapi/routes/getApiV1ReposOwnerNamePullsNumberLooks.ts and regenerated the route index with bun scripts/openapi-routes.ts. test/openapi-coverage.test.ts and test/openapi-routes.test.ts pass, as does bun x tsc --noEmit.
Four other tests failed in the shard run: the canonical-address test, the walked repository pages, the MCP map/wait_for test and the subscriptions-screen cursor test. I ran those test files again on their own, with test/pull-looks-read.test.ts, and all passed. I treated them as noise from running in shards and changed nothing for them. If they fail again after this push, they need a separate look.
To try it, call the endpoint on a pull that has looks, or ask the MCP pull tool for one.
I did not run scripts/gate.ts or scripts/design-lint.ts here.
An agent can now read a pull's looks from GET /api/v1/repos/:owner/:name/pulls/:number/looks and from the MCP pull tool. Each look carries its picture with its width, line and URL, as the pull page shows them to that reader.
The last check failed on test/openapi-oa-pull-review.test.ts. It asserted that GET …/looks was not described, which was true before this pull and is wrong now. I changed that one line to expect the route to be described, and the OpenAPI tests pass (385 of 385).
The other two failures, the MCP map/wait_for test and the subscriptions-screen cursor test, passed when I ran their files on their own earlier. I did not re-run them this time and changed nothing for them. If they fail again, they need a separate look.
To try it, call the endpoint on a pull that has looks, or ask the MCP pull tool for one. I did not run scripts/gate.ts or scripts/design-lint.ts here.
Parked by the crew: the check stayed red through 2 automatic tries
An agent can now read a pull's looks back:
GET /api/v1/repos/:owner/:name/pulls/:number/looksand thelooksfield of MCPpullboth answer{ items: [{ id, width, says, by, commit, url, at }] }, newest first. The new tests,test/mcp-size.test.tsandtest/attach-look.test.tspass.tsc,scripts/gate.tsanddesign-lintare clean. I did not run the full suite; the forge's check does that on the push.What changed
pullLooks()insrc/web/pages/looks.tsbuilds the list for both the route and the tool. It reads the pull's preview environment throughlooksForEnv.urlcomes from the samelookUrlthe POST uses, so the two match.mayFetchLook). A public-repo reader therefore does not see a look taken as the owner, such as one a writer attached.items: [].docs/MCP.mdis regenerated, and thepulltool's doc mentionslooks.docs/APPS.mdsays an agent can read the looks back.test/pull-looks-read.test.tscovers four things. A look attached by POST appears in both the GET and MCPpull. A pull with no app answers empty. A reader without access to a private repo gets 404. A public reader gets[]for an owner-taken look.Left out
looksForEnvdefaults to light.Try it
POST …/pulls/N/looks, thencurl -H "authorization: Bearer $T" $FORGE/api/v1/repos/OWNER/NAME/pulls/N/looks.pull { repo, number }and readlooks.Closes #7915