Files
PaperClipAI/packages
Devin FoleyandPaperclip 8a5b374a9c test: order Antigravity mode changes before admission readback (#23685)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The Runner checks provider settings before it admits an Antigravity
swarm.
> - A test changes a confirmed mode during admission and expects
rejection.
> - The fake CLI could complete model readback before it sent the mode
change.
> - Pipe scheduling could then move the change past admission and fail
the test.
> - This pull request sends the mode change before model readback.
> - The test can now check admission rejection without depending on pipe
timing.

## Linked Issues or Issue Description

**What happened?**

[Cloud readiness run 47231816304, attempt
2](https://github.com/paperclipai/paperclip/actions/runs/47231816304/job/144707142899)
failed the Antigravity test named “turns a provider mode change during
admission into a typed failure, stops the CLI, and keeps the caller
alive”. The open promise resolved instead of rejecting. This cancelled
[image run
47231816399](https://github.com/paperclipai/paperclip/actions/runs/47231816399).

**Expected behavior**

The fixture must deliver the mode change while admission still waits for
model readback. The runtime must reject with
`ANTIGRAVITY_SWARM_RECEIPT_MISMATCH` and stop its child process.

**Steps to reproduce**

Run `PAPERCLIP_VITEST_RETRY=0 pnpm exec vitest run
src/drivers/acpx/antigravity-swarm-runtime.test.ts --maxWorkers=1` from
`packages/paperclip-runner`. Before this change, the `mode-flip` fixture
wrote the valid model update before the invalid mode update. Separate
pipe reads could let admission finish between them. The CI failure shows
this outcome. One focused local baseline attempt passed, so the
intermittent failure was not reproduced locally.

## What Changed

- Send the `mode-flip` notification before the model configuration
update. Admission cannot finish model readback before it receives the
invalid mode.
- Keep the existing rejection and child retirement assertions. The idle
mode-change fixture and runtime code stay as they are.

## Verification

- The full Antigravity swarm runtime file passed: 66 tests, retries
disabled, one worker.
- `node --check
packages/paperclip-runner/test-fixtures/antigravity-cli/fake-agy-acp.mjs`
passed.
- `node scripts/check-test-budget.mjs --base origin/master` passed.
- `git diff --check` passed.
- `pnpm verify --explain` returned exit 2 because a Runner fixture needs
broad CI coverage. Required CI will supply that coverage.
- Final head `2c55808f394ad07dc279a6d074fecb9f61fa540f`: [PR CI run
47239627453, attempt
2](https://github.com/paperclipai/paperclip/actions/runs/47239627453/attempts/2)
passed. It reports 76 successful jobs and one skipped selection job.
Both required gates (`ci / verify` and `ci / e2e`) passed. Standalone
Runner image checks, macOS checks, and Windows Rust checks passed. No
checks remain active. GitHub reports `CLEAN` and `MERGEABLE`.
- Greptile scored this exact head 5/5 with no actionable findings or
unresolved review threads.
- Earlier failures remain accounted for: [the delayed initial
run](https://github.com/paperclipai/paperclip/actions/runs/47239537426)
was superseded by the `full-ci` label run and cancelled by PR
concurrency. Attempt 1 of the replacement run passed 73 jobs, but
[policy](https://github.com/paperclipai/paperclip/actions/runs/47239627453/job/144728063451)
exceeded its 10-minute limit. Both final gates then failed with `Policy
must succeed`, actual `cancelled`. Policy logs returned `BlobNotFound`,
so the stalled step and cause are unknown. After the run completed,
GitHub accepted a policy-job rerun request. This reran the reusable CI
workflow in attempt 2, which passed in full. The passing retry
establishes recovery; it does not establish the timeout's cause.
- Separate operational issue: master image runs
[47235737261](https://github.com/paperclipai/paperclip/actions/runs/47235737261)
and
[47238936675](https://github.com/paperclipai/paperclip/actions/runs/47238936675)
failed their source observers because GitHub's Actions job-list API
returned HTTP 502. Their architecture builds and exact-source readiness
runs passed. The current master's job-list request still returns 502
with `per_page=100`. Small pages can read that image run, but a
small-page source-readiness request also failed. There is no verified
pagination workaround. This fixture change does not resolve that API
failure or prove image publication.

## Risks

- Low risk. The diff changes one notification's order in a test fixture.
It adds no runtime behavior or configuration.
- The original intermittent failure was observed in CI. The local
baseline attempt passed. The fix removes the ordering gap identified in
that failure. The full CI workflow passed for the final revision.
- Documentation does not change because the runtime contract stays the
same.

## Model Used

- OpenAI `gpt-6.1-sol`, through the Codex harness in T3 Code, with xhigh
reasoning effort and shell tools. The context window size is not exposed
by the runtime.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-03 17:27:03 -08:00
..