Files
PaperClipAI/tests/runner-e2e/product-journeys
DottaandPaperclip b63445c8f1 fix(e2e): save hiring task intents at the submit boundary (#23400)
## Thinking Path

> - Paperclip manages work by AI agents.
> - Its product journeys verify hiring and task delegation through chat.
> - Cleanup uses saved creation intents to track possible writes.
> - The hiring journey saves each task intent before browser
preparation.
> - A navigation or editor failure can therefore leave an intent for a
request that was never sent.
> - This pull request saves the intent after message validation and
before Send.
> - Cleanup can retain strict write protection without treating failed
preparation as a possible task creation.

## Linked Issues or Issue Description

**What happened?**
The hiring journey can save a review-task intent even when a browser
failure stops the third chat request before submission. Cleanup then
reports an uncertain creation outcome. A controlled navigation failure
reproduces this tracking defect. The original retained browser exception
is unavailable; this change does not claim its cause.

**Expected behavior**
Browser preparation must not register a task write. The creation intent
must be saved before submission can create work. A failed intent save
must stop submission. A send with a possible committed write must retain
the intent.

**Steps to reproduce**
Inject a navigation failure before the review request after the
checklist completes. The original code records the review intent despite
making only two sends. The new code preserves the checklist receipt and
records no review intent.

**Paperclip version or commit**
Reproduced from source at `5a9c06b315d9612022908b7fc189f30bac3619af`.

**Deployment mode**
Linux source checkout, focused workflow tests, and Chromium against the
real production composer. The paid hosted acceptance case remains
pending until merge. Related earlier hiring coverage and spacing fixes:
#18351 and #22825.

## What Changed

- Save delegated-task intents through an awaited callback after the
exact mention chips are verified and before the browser clicks Send.
- Cover failed review navigation, failed intent persistence, rejected
mentions, and a send failure after the intent boundary.
- Keep handoff references and task name in one typed object. A handoff
without its intent name is no longer representable.
- Keep the existing ownership, initial assignment, saved-body,
seven-run, budget, and cleanup checks.
- Document the submission boundary.

## Verification

- Red: the new review-navigation regression failed because the old flow
saved the review intent without sending that request.
- Green: 78 focused flow and evidence tests pass.
- All 8 real-composer Chromium checks pass. They cover both composer
modes, exact saved messages, failed intent persistence, page loss after
persistence, and rejected agent/project mentions.
- `pnpm test:e2e:runner:typecheck` passes.
- `pnpm verify --explain` could not select checks because the managed
Git storage guard rejects `git ls-files`. Even the suggested shallow
fetch fails. This unavailable check is not a pass. The source was
compared with master through the repository API before publication.
- Original head `6914c4b` passed
[CI](https://github.com/paperclipai/paperclip/actions/runs/46723605434)
and Greptile 5/5 with Low impact. Typecheck, four support shards, six
Runner package shards, static checks, and aggregate verification passed.
Build was skipped by the test-only path policy.
- Review head `cd7b03f36d6d9fcac37cf80906fad2f7cd167958` passes the 78
focused tests, all 8 browser checks, and runner E2E typecheck. Its first
browser attempt could not start because the resumed sandbox lacked
Chromium; installation restored the check, which then passed. The
current head passed
[CI](https://github.com/paperclipai/paperclip/actions/runs/46727370488),
including Typecheck + Release Registry, four support shards, six Runner
package shards, static checks, and aggregate verification. Build is
skipped by the test-only path policy. Greptile, Feynman and Ponytail
each gave this head 5/5, with Low impact from Greptile. The actionable
thread is resolved. Hosted acceptance must run only
`hire-delegate-reuse` after merge.

## Risks

The callback and Send cannot form one atomic operation. A failure after
intent persistence still keeps the intent and the existing
uncertain-write protection. This patch does not manufacture absence
proof for old retained manifests. The original browser error remains
unknown.

## Model Used

OpenAI GPT-6 through Codex, with reasoning, shell tools, source editing,
and Chromium. The runtime does not expose a more specific backend model
revision or context size.

## 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 19:56:35 +00:00
..