Files
PaperClipAI/tests
DottaandPaperclip caaa013a69 fix(e2e): wait for reset preparation and repository recovery (#23288)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Product E2E tests check real user work through the app and native
agents.
> - A chat reset gets its reset marker during run preparation.
> - The observer can count that active reset as extra model work before
preparation ends.
> - The repository observer also omits the deadline needed to recognize
a scheduled same-run recovery.
> - This pull request keeps both observations open until the existing
bounded transition completes.
> - The final success checks still require the original run counts,
saved results, and evidence.

## Linked Issues or Issue Description

**What happened?**

The chat observer can throw `chat_continuity_extra_run` while `/new` is
queued or running without its reset marker. The repository observer
throws `agent_run_failed` for an exact-session recovery that the server
has already scheduled.

**Expected behavior**

Observe each transition under the original campaign deadline. Require
the same final reset receipt, model turn count, completed repository
runs, and artifact checks. An active or failed run must never count as a
pass.

**Steps to reproduce**

1. Return an unmarked queued or running reset between the second model
reply and the completed reset receipt.
2. Run the chat journey observer. Before this change it reports extra
model work.
3. Return a bound native repository run with `retryable_failure` and an
eligible `retry_scheduled` projection. Before this change the observer
rejects it before its scheduled recovery.

Related: https://github.com/paperclipai/paperclip/pull/18784 and
https://github.com/paperclipai/paperclip/pull/22826. The latter adds the
shared recovery rule. This change supplies the repository caller's
missing deadline.

## What Changed

- Count excess unmarked provider runs after they succeed. Keep the
existing reset count, scope, run cap, deadline and final grading checks.
- Supply the repository campaign deadline to the existing native
recovery validator.
- Add observer regressions for queued and running reset preparation,
completed extra work, immediate failed/cancelled rejection, scheduled
repository recovery through success, exhausted or late recovery and the
original deadline.

## Verification

- Chat regression before the fix: 2 failed and 16 passed. Both failures
report `chat_continuity_extra_run`.
- Repository regression before the fix: 2 failed and 1 passed. Both
failures report `agent_run_failed`.
- After the fixes: 109 tests pass in five affected observer, grading and
recovery files.
- `pnpm test:e2e:runner:typecheck` passes on the final source.
- `pnpm verify` cannot select tests because the managed Git storage
guard rejects `git ls-files`. The focused command above supplies local
test evidence. Final-head CI 46425283547 passes the selected Runner
support, package, static, typecheck, policy and verification gates.
General/build jobs are path-skipped.
- The real observer functions ran with simulated API/browser boundaries.
No new hosted provider run or deployment was made. A fresh hosted
journey with the reviewed harness is still required for staging
acceptance.

## Risks

The chat observer can wait longer before it rejects active extra work.
The original deadline and four-run cap still bound it. A completed extra
provider run remains fatal. Failed or cancelled chat runs already fail
in the reader before the excess-work predicate; tests prove first-read
rejection with no new message. Repository recovery uses the existing
shared eligibility rules; terminal, exhausted, foreign or late recovery
still fails. This change does not repair or explain an underlying
provider timeout. No prompt, grading rule, test selection, budget, pin
or production behavior changes.

## Model Used

OpenAI Codex, GPT-6 family, with reasoning and code execution. The exact
model build is not exposed in this session.

## 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-01 15:51:39 +00:00
..