Skip to content

ci(port): keep partial work on timeout/abort, label it port-incomplete - #30

Draft
LukasParke wants to merge 1 commit into
mainfrom
ci/port-bot-robustness
Draft

LukasParke wants to merge 1 commit into
mainfrom
ci/port-bot-robustness

Conversation

@LukasParke

Copy link
Copy Markdown
Contributor

Why

Every weekly port run since 10/12 has been killed by the 2h converter alarm (perl alarm, exit 142 "Alarm clock") partway through the doom-loop (78c562e/75271c3) or async-tools (e8d7d6d) delta. Because the port step failed, the commit/PR steps were skipped and all work was lost. On 10/05 the opposite happened: opencode ended on Error: Tool execution aborted but exited 0, so a half-finished tree was opened as eval-failed, as if the eval had judged it.

What

scripts/upstream (same change in python-agent and go-agent):

  • Captures opencode's exit status instead of letting set -e exit on it.
  • 142 = timeout; any other non-zero status is passed through; 4 = opencode exited 0 but its last output line is Error: ... (abort / terminal tool error). Mid-run tool errors the agent recovers from, like a failed edit it retries, are still treated as normal.

.github/workflows/upstreamer-port.yaml:

  • The port step records rc and doesn't fail, so the partial tree is still committed and pushed to upstreamer/sync, and the PR is opened or updated.
  • The outcome now has three values, each with its own title and label:
    • passed
    • eval-failed: the converter finished but state.yaml didn't advance
    • port-incomplete: the converter was cut off, so the eval result means nothing
  • An incomplete run reverts state.yaml so it can never advance the pointer.
  • create-pull-request only adds labels, so a new step removes stale eval-failed / port-incomplete labels from a reused PR.
  • A final step fails the job when the converter didn't finish, so the run still shows red.
  • New timeout_minutes dispatch input (default 120, max 300). The job timeout-minutes goes from 150 to 330 so the converter's alarm always fires before the job is killed. If the job limit hit first, nothing would be saved.
  • PR body now links the run and states the outcome and exit code.
  • PORTING.md documents port-incomplete.

Testing

  • Ran the new script tail with a fake opencode through four cases: clean exit (with a recovered mid-run Error:) gives 0, Tool execution aborted as the last line gives 4, exit 7 gives 7, and a hang under UPSTREAMER_TIMEOUT_SECONDS=2 gives 142.
  • actionlint (with shellcheck) is clean. The script's shellcheck shows only one warning, at line 140, which this PR doesn't touch.
  • The repo's CI checks pass locally.

Not in scope / follow-ups

  • A later run still starts from main and re-ports the whole range. Partial work is now preserved for a human to look at, but it isn't resumed from. The stepwise ref dispatches are the way through large ranges.
  • ${{ inputs.ref }} is still interpolated straight into a shell script (pre-existing). The new inputs go through env:.

🤖 Generated with Claude Code

…lete

The weekly port has died at the 2h converter alarm (exit 142) on every
run since 10/12, and each time every edit was discarded with the runner
because the failing port step skipped the commit/PR steps. On 10/05 the
opposite happened: opencode ended on "Error: Tool execution aborted" but
exited 0, so a half-finished tree was labelled eval-failed as if the eval
had judged it.

- scripts/upstream: capture opencode's status. Exit 142 on timeout, pass
  other failures through, and exit 4 when opencode exits 0 but its last
  output line is an Error (mid-run tool errors it recovers from are fine).
- workflow: record the exit code instead of failing the port step, so
  partial work is still committed and pushed to upstreamer/sync. Classify
  the outcome as passed / eval-failed / port-incomplete, with distinct
  titles and labels, and drop stale outcome labels on a reused PR. An
  incomplete run never advances state.yaml. A final step fails the job.
- workflow: add a timeout_minutes dispatch input (default 120, max 300)
  and raise the job limit to 330 so the converter alarm always fires
  before the job is killed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant