You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
auto-collect: a builder request whose only fetch failed is recorded, committed and pushed as "collected" with pages: 1 - the result counts failures as pages and never reads the run's "collected 0" line #321
A builder request whose every fetch failed is recorded, committed and pushed as "status": "collected" with "pages": 1, and the builder is told to "pull and read the captures". Measured on main at 9a47439: a repository with a bare remote, a request research/requests/nores.json naming http://nonexistent-host.invalid/page, one forced cycle through the panel (POST /api/requests/check):
Why: in lib/auto-collect.mjs, research.mjs exiting 0 is the whole test for "collected" (line 503 handles a non-zero exit; line 509 writes status: 'collected' otherwise), and pages is spentPages(output) (line 120), which reads the run's spent N (budget consumed: collected + failed) line, so a failed fetch is a page. The run's own summary says what happened (collected 0, failed 1) two lines above the one that is parsed, and the result keeps neither.
What it costs: the request protocol (ADR-0148, ADR-0150) has the builder read the result and act on it: "a collected result delivers captures, not completed review. The builder reads and judges them" (AGENTS.md). Here there is nothing to read, the result does not say so, and the commit the builder pulls is titled as a collection. The request is also marked delivered (delivered.add), so a later cycle does not look at it again; the builder's one remedy is to write a second request for the same fact. The daily budget (dailyPages, 20 by default) is charged a page for it, which is right on a metered route and wrong on the keyless one, where nothing was spent.
The fix
Parse collected N and failed N from the run summary beside spent N (one regex each, the shape spentPages already uses). A result with collected 0 is "status": "failed" with the run's failure lines as detail (the ledger's error text for each page, e.g. fetch failed (getaddrinfo ENOTFOUND ...)), the commit titled research: request <id> failed, and next saying the page could not be fetched and what to change (another URL, or a query). A result with some pages collected and some failed stays collected, with pages = collected and a failed count beside it.
pages in the result and in the daily accounting is the collected count; failures are listed, not counted, unless the transport charged for them (the Firecrawl route does; the keyless does not, and the run already knows which transport ran).
No new flag or format: two fields the result already has, filled from lines the run already prints.
Test
In the auto-collect tests (the ones that drive createAutoCollect with a stand-in exec): a stand-in research.mjs whose output ends collected 0 / failed 1 / spent 1 yields a failed result naming the fetch error, no delivered mark, and a commit subject that does not say "collect"; collected 2 / failed 1 / spent 3 yields collected with pages: 2 and failed: 1.
Activity