Skip to content

ci: cancel superseded ci.yml runs per ref - #1091

Merged
stamp-build[bot] merged 1 commit into
mainfrom
agent/lookout/ci-concurrency
Nov 20, 2026
Merged

stamp-build[bot] merged 1 commit into
mainfrom
agent/lookout/ci-concurrency

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Lookout from open-agent-runtime opened this pull request through Stamp
View in Stamp →


Summary

Add a workflow-level concurrency group per ref with cancel-in-progress: true to .github/workflows/ci.yml (#core:#387):

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

Why

On main, each push schedules ~15 macOS jobs. Without workflow-level concurrency cancellation, successive merges queue superseded main runs ahead of the release commit's run, starving the macOS runner pool until release.yml's 60-minute CI gate times out. main has now had to be unblocked by hand three times:

  • 0.122.0 on 2026-11-19
  • 0.125.0 on 2026-11-20 at 06:02 UTC (9 queued runs, #378)
  • 0.126.0 on 2026-11-20 at 18:50 UTC (5 older queued runs)

With group: ${{ github.workflow }}-${{ github.ref }} and cancel-in-progress: true:

  • push to main and workflow_dispatch on main share ci-refs/heads/main, so newer main pushes and manual recovery dispatches cancel older queued/running main runs immediately.
  • Each pull request uses ci-refs/pull/<N>/merge, so pushes to a PR cancel only older runs on that same PR and never collide with main, other PRs, or a workflow_dispatch on the branch ref (ci-refs/heads/<branch>).

Dependency Audit (verified before changing)

  • .github/workflows/release.yml (untouched): Lines 79-80 query only actions/workflows/ci.yml/runs?head_sha=$GITHUB_SHA, selecting .event == "push" or .event == "workflow_dispatch" and taking first (newest run for that exact commit). It never reads older commits' runs. If another commit merges to main while a release commit's CI is running, the superseded commit's run is cancelled and release.yml fails closed (CI did not succeed on $GITHUB_SHA), matching its contract that a dispatched release is only ever the current head of main.
  • Other workflows in .github/workflows/: None use workflow_run on ci.yml or depend on older ci.yml runs. osv-scanner.yml, runtime-latest.yml, and release.yml already declare workflow-level concurrency.
  • Stamp (stamp settings -R botiverse/oar, stamp repo guard list -R botiverse/oar): merge_hold has no active holds (holds: []), ci_on_ready has no custom rules, and workflow_guard is off. Verified empirically on the 5 cancelled main runs from 2026-11-20 (44738501140, 44751339691, 44758089023, 44770042974, 44777833935): Stamp posted zero false post-merge failure comments on their PRs (#1084, #1085).

Verification

  • Validated .github/workflows/ci.yml YAML parsing.
  • CI=1 pnpm run check passes locally (typecheck, oxlint --type-aware --deny-warnings, unit tests, mock sea-trial).

@stamp-build
stamp-build Bot merged commit 9324e69 into main Nov 20, 2026
25 checks passed
@stamp-build
stamp-build Bot deleted the agent/lookout/ci-concurrency branch November 20, 2026 20:08
stamp-build Bot added a commit that referenced this pull request Nov 20, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/ZXll.svg"
width="16" height="16" align="absmiddle" alt=""> <b>Lookout</b> from
open-agent-runtime opened this pull request through
Stamp</sup><br><sup><a
href="https://stamp.build/review?receipt=prc_d326ec9e59a8265a6ee34e5c43a7f85f"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img
src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg"
width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp
→</a></sup>

---
<!-- /stamp:review:v1 -->

## Summary

Follow-up to `#1091` (`#core:#387`): require the `workflow_dispatch`
release gate in `.github/workflows/release.yml` to verify that
`$GITHUB_SHA` is the merge commit of the matching merged `chore: release
$TAG` PR on `main`, reusing `release_only`'s exact PR-matching filter so
the rule lives in one place.

## Why

With per-ref CI cancellation on `main` (`#1091`), a commit merged after
a release PR cancels that release commit's CI. Re-dispatching
`release.yml` from `main` without checking the commit's PR would run
against the new head of `main` and publish it with the non-release PR's
notes.

## Changes

- **`.github/workflows/release.yml`** (gate and shared filter only;
publish steps and `release` job untouched):
- Hoisted `release_only`'s exact `jq` PR-matching rule into
workflow-level `env.RELEASE_PR_FILTER` (keeps `release_only` free of
`actions/checkout` and untrusted code).
- Added `pull-requests: read` to `publish.permissions` so the gate can
read `repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/pulls`.
- Updated `publish`'s `gate a dispatched release on main's CI` step to
evaluate `$RELEASE_PR_FILTER` against `$GITHUB_SHA` before entering the
60-minute CI poll loop, failing closed on any non-release, unmerged,
wrong-commit, or ambiguous PR.
  - Updated `release_only` to reference `"$RELEASE_PR_FILTER"` directly.
- **`tests/release-only-workflow.test.ts` and
`tests/fixtures/release-only-cli.ts`**:
- Execute the actual `gate a dispatched release on main's CI` bash step
extracted from `.github/workflows/release.yml` with `RELEASE_PR_FILTER`
read from the workflow.
- Verify the gate accepts a matching merged `chore: release $TAG` PR and
refuses non-release PRs, wrong commits, unmerged/ambiguous PRs, null
notes, API failures, and existing tags before polling `ci.yml/runs`.
- Verify `publish` declares `pull-requests: read` and both steps
reference `"$RELEASE_PR_FILTER"`.

## Verification

- Validated `.github/workflows/release.yml` YAML parsing.
- `CI=1 pnpm run check` passes locally (typecheck, `oxlint --type-aware
--deny-warnings`, unit tests including all 27 cases in
`tests/release-only-workflow.test.ts`, mock `sea-trial`).

---------

Co-authored-by: Lookout <[email protected]>
@stamp-build stamp-build Bot mentioned this pull request Nov 21, 2026
stamp-build Bot added a commit that referenced this pull request Nov 21, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup>opened from existing branch <code>agent/cindy/release-0.127.0</code> @ <code>b15d311f509d</code>, which the agent did not push</sup><br><sup><a href="https://stamp.build/review?receipt=prc_73c76ce0b5c49eb86a194fb0d706127f"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup>

---
<!-- /stamp:review:v1 -->

## OAR 0.127.0

### Behavior changes hosts should know

- **Pi is an optional dependency of `@botiverse/oar`** (#1098). A default install still includes `@earendil-works/pi-ai` and `@earendil-works/pi-coding-agent`, so nothing changes unless you opt out. `npm install --omit=optional` (or `pnpm install --no-optional`) leaves both out; note that these flags drop every optional dependency in the tree, not only Pi's. Pi stays in `defaultRuntimes` either way. `@botiverse/oar-cli` keeps both packages as direct dependencies.
  - Without the packages, `installation()` reports `unsupported` with code `dependency_missing` in a normal Node host for every Pi mode. In-process Pi SDK used to report `not_found` here, so hosts that branch on `not_found` should handle the new code.
  - Pi RPC with an explicit `command` now also checks the host packages, because the host process needs them for session lookup, project-package checks and context-overflow detection. Its command check runs first, so a missing or too-old `pi` still reports `not_found` or `version_unsupported`. Default Pi RPC in a single-file or Electron host still reports `unsupported_host` first.
  - The declarations of every entry point except `@botiverse/oar/pi-durable` no longer import Pi, so TypeScript hosts with `skipLibCheck: false` compile without it. `pi-durable` still needs `@earendil-works/pi-ai`.
- **Ending a process through stdin EOF takes one kill grace, not two** (#1097). When OAR closes stdin to end an idle Claude or Codex session, Codex's login process after a completed login, or a Qoder or Qwen session or model list, and the process is still alive after the kill grace (10 s by default, `OAR_KILL_GRACE_MS`), OAR now force-ends the process tree at once. Before, it sent SIGTERM and waited a second grace, so this could take up to 20 s. Processes that already ended after one grace are unchanged: Claude and Codex model, inventory and account queries, DSH, Factory and Pi RPC. A session with an active turn is still stopped at once.
- **Explicit context overflow is `input_too_large` on more paths** (#1093). The generic error-text rules now check for an explicit overflow first ("This model's maximum context length is N tokens. However, ...", "Your input exceeds the context window of this model", "Prompt is too long", with an optional `Internal error: ` prefix) and keep the original reason. A specific native category or provider code still takes precedence.
  - OpenCode 2.2.7 and 2.3.2 report an overflow and other invalid requests with the same JSON-RPC code (`-32603`) and native name (`provider.invalid-request`); an explicit overflow there is now `input_too_large`. On OpenCode, a rejected summary request still reports `kind: "failed"` with `failure: "provider"`.
  - The same rules cover the ACP fallback (every ACP runtime), Cursor, Factory, Grok, Pi in-process, Pi Durable and Morph, Claude's generic invalid-request fallback, and `invalid_request_error` provider bodies on Pi and Codex. An Anthropic-style "prompt is too long" body that used to be `invalid_request` is now `input_too_large`.
  - The runtime matrix gains "Recovery after automatic compaction fails": after a measured failed automatic compaction, Claude, Pi, DSH, OpenCode v2 and threshold-triggered Codex returned to `idle` and completed the next prompt on the same session. The failed turn stays readable from `turn_ended.outcome` and `status().value.lastTurnOutcome`.

### New

- **Codex MCP startup per server** (#1092). From Codex 0.169.0 (executable installs, stable versions), `sessionCapabilities(installation).mcpStartup` is `{ kind: "per_server", firstModelRequest: "may_start_pending" }`: Codex can send the first model request while an MCP server is still listing tools, and that tool is then missing from turn one. A missing declaration means unknown.
  - Native startup reports that carry a thread ID become `mcp_server_startup` events with the server name and `pending`, `ready`, `failed` or `cancelled` (native `starting` is `pending`). This is a new `RuntimeEventBody` variant, so code that switches exhaustively on event kinds needs a case for it.
  - `mcpStartupOf(records, sessionId)` (from `@botiverse/oar` and `@botiverse/oar/observe`, with type `McpStartupStatus`) returns the latest state per server for the root agent.
  - A host that needs a server on turn one can subscribe with `session.events(observer, { cursor: { sessionId: session.id, afterSeq: -1 } })`, which replays startup reports, and wait for its `ready` before the first input. A server that never reports stays unknown, so set your own time limit.

### Tests and CI

- The release workflow's dispatch, tag-push and `release_only` paths all require the commit to be the merge commit of exactly one merged `chore: release vX.Y.Z` pull request (#1095, #1096). `ci.yml` cancels superseded runs per ref (#1091). Tests check a fixture process's identity before cleanup (#1089), and DSH's `lastInput` and `requestsForTurn` share one trailing synthetic-context check (#1090).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Cindy <[email protected]>
Co-authored-by: xxchan <[email protected]>
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.

0 participants