ci-gate exits 1 for a used-up --timeout budget, the same code as red CI #719
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#719
Loading…
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?
Observed behaviour
iw ci-gateexits with code 1 both when CI is red and when the wait used up its--timeoutbudget (CiVerdict.TimedOut). A caller that acts on the exit code alone cannot tell "a job failed" from "CI did not finish in time". The batch loop in the kanon plugin (iw-plugin/lib/batch/CiGate.scala) reads exit 1 as red and starts fix sessions on CI that never failed (linked issue below).Code (iw-cli v0.19.0,
0e446674)core/commands/CiGateCommand.scala:70-76— the declared exit code 1 covers "CI went red, the wait used up its whole --timeout budget, no pull request could be found, or an argument was wrong". The help text tells the caller to raise--timeoutfor a used-up budget and not retry, but the code alone does not show which case occurred.core/commands/CiGateCommand.scala:251-254— every decided non-red verdict,TimedOutincluded, goes tostop(...).core/commands/CiGateCommand.scala:279-294—stopwritesci_failed, clears the wait (clearCiWait = true), and returnsCommandResult.error(1). The only difference from red is the card's headline ("CI timed out" against "CI failed").phase-mergedoes the same forTimedOut(core/commands/PhaseMerge.scala:278-286,markFailed(..., "CI timed out"),CommandResult.error).Because the wait start is cleared, the next
ci-gatecall starts a new full budget. A caller that retries after exit 1 waits again, and does not learn that it already waited the full budget.Evidence (MEDECA, GitLab gitlab.e-bs.cz CMI/mdr/medeca-modul-poptavky, 2026-10-05, UTC)
b85b27901:03:2295d48e508:57:50ci_failed"CI timed out"pending(starts)successThe head pipelines waited about 1 h 45 min in the runner queue. The gate read
pendingas running, which is correct, and gaveTimedOutafter the default 30m budget. Each time it exited 1.The previous commits' pipelines (6085, 6120) were
canceledby GitLab's redundant-pipeline auto-cancel. They are for a different sha than the MR head, and the gate's sha filter (core/model/CiGate.scala:319) drops them, so they did not affect the verdict.Version
MEDECA runs iw-cli 0.18.0 (
./iw --version,version = latest). I read v0.19.0. Between v0.18.0 and v0.19.0 the only gate file that changed isCiGateCommand.scala, and the change (removal ofciGatedShaand the commit policy) does not touch the timeout path or the exit codes.Suggested fix direction
ci-gateandphase-merge(for example 4 or 5; 3 is already "unfinished, call again"), and declare it in the command'sExitCodelist with the caller instruction "raise --timeout; do not try to fix code".Related: kanon plugin issue for the batch loop (linked in a comment).
🤖 Generated with Claude Code
Related kanon plugin issue (the batch loop that reads this exit code as red): iterative-works/dev-docs#458
🤖 Generated with Claude Code
Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed
Analysis: project-management/issues/IW-719/analysis.md on branch IW-719
Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin command did not compile against the iw-cli core of the current main, so no phase ran. The installed plugin (
lib/batch/ForgeCatchUp.scala) expectsEither[String, …]fromfetchPullRequestForBranch; main now returnsEither[TrackerError, …](8e902777, "TrackerError on the forge clients and the port's PR/CI/merge calls"). Nobatch-implement.logwas written; these are the last lines of the command output:The cause is not in this issue: the kanon plugin must be updated for the TrackerError change. After that, release the issue to
agent-readyagain through human-review.md.Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.