bug: agent CI-failure prompt impoverished — per-workflow/per-step diagnostics missing, exit codes unannotated, flakes mixed with real failures #1050
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#1050
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When CI fails on an agent-authored PR, the agent's self-correction loop receives an impoverished view of the failure and cannot diagnose problems across multiple independent workflows. Agents burn their 3-attempt fix budget retrying the wrong fix or "fixing" problems they didn't cause.
Observed on PR #1046 (issue #1025): three workflows failed for three entirely different reasons (
duplicate-detectionexit 1,caddy-validateexit 127 "curl: not found",smoke-initexit 126 with pre-existing branch-index flakiness). Agent consumed all 3 inner attempts without fixing any of them, because the prompt it received could not surface per-workflow context.Root cause
lib/pr-lifecycle.sh:431-457builds the CI-fix prompt from two sources:_PR_CI_ERROR_LOG— a single "error log snippet" set bypr_poll_cici_get_logs "$_PR_CI_PIPELINE" | tail -50— the last 50 lines of one combined log stream per pipelineWith 3 concurrent workflows each producing their own step logs,
tail -50of a combined stream shows whatever finished last — not the actual failure points. Even when per-workflow logs are queryable (the Woodpecker API supports/api/repos/{id}/logs/{pipeline}/{step_id}per step), the helper collapses them into one tail.The agent also does not receive:
smoke-initmock-Forgejo branch-index latency) get mixed in with real failuresDesired behavior
The CI-fix prompt given to Claude on attempt N/3 should contain, for each failed workflow:
Exit codes 126/127/128 should be annotated with their standard meanings. Flaky-workflow list (if maintained) should be excluded from the "required fix" set.
Fix sketch
In
lib/pr-lifecycle.shCI-failure block (line ~431-459):workflow.state == "failure"in the pipeline:/api/repos/{id}/logs/{pipeline_num}/{step_id}for the specific failed step (not the whole workflow).disinto/ci-flakes.ymlallowlist listingworkflow:steppairs that should be treated as informational (agent warned, but not asked to fix).Acceptance criteria
ci_get_logshelper inlib/ci-helpers.shgrows a--step-idvariant that fetches per-step logsRelated
blockedlabel not cleared on re-claim; independent, but compounds this issue by hiding the diagnostic pass from dev-poll until after wasted attempts.Blocks
disinto-admin referenced this issue2026-04-19 17:38:26 +00:00