Conversation
The runner records total_cost_usd and model into metrics.json, but that file only ever reaches whoever downloads the workflow artifact, so the per-review cost is invisible in practice. metrics.json sits in the post-script's working directory, so the footer is assembled here alongside the other body mutations rather than in the runner. duration_seconds and over_budget are read optionally and are not yet emitted by any released runner — they arrive with the max_cost_usd work in fullsend. Until then the footer renders cost and model alone; every field is independently omittable, so no separator dangles and no field prints as null. The footer is never appended to a result with no body: a failure result carries reason and no body, and jq's null + string would have made the footer the entire comment, replacing the 'This PR was NOT reviewed' notice with a price tag. Unreadable metrics skip the footer entirely — cost reporting must never be the reason a review fails to post. Signed-off-by: guy oron <goron@redhat.com>
Functional tests did not runFunctional tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the |
|
Closing in favor of surfacing cost runner-side: the runner already builds a run-info footer (runtime/model/effort/cost) that renders on completion comments where status notifications are enabled — see the live example on fullsend-ai/pi-xai-vertex#4. Per maintainer feedback the right shape is an opt-in cost summary in status_notifications for all agents, not a review-only footer in the post-script. The remaining delta is a small toggle in the runner, which supersedes this. |
|
🤖 Finished Retro · ✅ Success · Started 4:16 AM UTC · Completed 4:23 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.89 |
Retro: PR #1005 — feat(review): show what each review cost on the review commentThis PR was opened by external contributor Agent involvement: noneNo fullsend agents (triage, review, code, fix) were dispatched on this PR. The fullsend dispatch routing correctly produced an empty matrix because the contributor has Improvement opportunity (already tracked)This retro run is additional evidence for #349 — Generalize pre-retro early exit to skip retro on any PR with zero fullsend agent involvement. The current No new proposals filedAll identified improvement opportunities are already covered by existing open issues. The workflow behaved as designed — routing, functional tests gating, and dispatch all operated correctly for an external contributor PR. |
The runner records
total_cost_usdandmodelintometrics.json, but that file only ever reaches whoever downloads the workflow artifact — so in practice nobody sees what a review costs.metrics.jsonsits in the post-script's working directory (run.gosetspostCmd.Dir = runDir, and the post-script runs from a defer that fires after the metrics are written), so the footer is assembled here alongside the other body mutations — severity filtering, protected-path downgrade, action hints — rather than in the runner.Degradation is the design
duration_secondsandover_budgetare read optionally and are not yet emitted by any released runner — they arrive with themax_cost_usdwork infullsend-ai/fullsend. Until then the footer renders cost and model alone. Every field is independently omittable, so no separator dangles and nothing prints asnull:This means the PR can merge against the currently deployed CLI and simply gets richer later, rather than needing a coordinated release.
The failure case
The footer is never appended to a result with no body. A failure result carries
reasonand nobody(schemas/review-result.schema.json), and jq'snull + stringwould have made the footer the entire comment — replacing "This PR was NOT reviewed. Do not count this as an approval" with a price tag. Unreadable metrics skip the footer entirely: cost reporting must never be the reason a review fails to post.Testing
scripts/post-review-cost-footer-test.shextracts the jq program from the shipped script — so the test cannot drift from what runs — and covers 12 cases: full metrics, an older runner missing fields, budget-capped, sub-minute and exactly-one-minute durations, zero cost, empty model, non-booleanover_budget, and degenerate metrics. Wired intomake script-test, and bash-3.2 safe.Negative-checked both ways: breaking the jq fails the tests, and breaking the extraction anchor fails loudly rather than silently testing an empty program.
Note for review
scripts/post-review.shis a generated bundle. The change is inpost-review.src.shand the generated file, byte-identical in the region the bundler passes through unchanged (the bundler only inlinessource scripts/lib/*.lib.shlines).make check-bundleenforces this.