Files
PaperClipAI/tests/runner-e2e/CHAT-FEATURES.md
T
DottaandPaperclip 1511c92965 fix(evals): account for superseded delegation wakes (#18319)
## Thinking Path

> - Paperclip lets people ask agents to delegate work and return the
result.
> - The chat feature eval checks task creation, worker execution, saved
output, and delivery to the source chat.
> - A task can first belong to the CEO and then move to Morgan.
> - Paperclip correctly cancels the old assignment wake before it
starts.
> - The eval treats that queue record as a failed provider run and stops
before Morgan works.
> - This change accounts for that record separately and preserves the
complete outcome checks.
> - The report also keeps partial check results when an attempt fails.

## Linked Issues or Issue Description

**What happened?**

The delegation journey stopped on an unstarted queue record with
`issue_assignee_changed`. The CEO had created a task, assigned Morgan,
saved the brief, and returned a task link. The test stopped before
worker execution. Its report showed no individual checks even though the
saved observation contained partial results. [Original public
measurement](https://d1p6rlowie26tp.cloudfront.net/runner-e2e/campaigns/chat-progress-39e-112-latest-121-measurements-with-screenshots-40649033672/?view=case&case=chat-features.delegate-announcement).

**Expected behavior**

Keep the obsolete queue record and its events. Continue observing the
intended worker. Pass only after three successful native work runs, a
current Morgan-authored announcement, a completed task, automatic
source-chat delivery, and browser readback.

**Steps to reproduce**

1. Ask the CEO to have Morgan write and save a launch announcement, then
return it to chat.
2. Create the task under the CEO, then assign Morgan before the queued
CEO run starts.
3. Observe the cancelled old assignment. The previous eval aborts at
that point.

**Paperclip version or commit**

Based on `6da112ab40d7b3cc0bcb79e08ddbb9b915a268a4` from
`origin/master`.

**Deployment mode**

Disposable Product E2E fixtures. The live check uses the trusted
default-branch workflow and AWS fleet.

Related contribution: #17794 introduced these two journeys. The open-PR
search found no separate fix for this queue-accounting defect.

## What Changed

- Recognize only explicit dispatch-gate reassignment cancellations with
a null start time and no native issue. Verify the company, prior CEO
owner, and target task now assigned to Morgan before excluding that
record from work-run counts.
- Keep every queue record in the full observation and final ledger.
Retain its events with an explicit reason for the absent provider log.
- Let the feature flow own its complete saved-state and browser oracle.
Return only actual work runs to the common provider checks.
- Record saved-state checks on failures as well as successes. Capture
the required `final-state.png` after the feature-specific browser
readback.
- Add two explicit local OpenCode cells alongside the two existing Codex
subscription cells. Use the current production-qualified model. The
earlier linked campaign used a different model, so this is a new
measurement.
- Advance the grader and suite versions. Keep the original request,
output requirements, 120-second run cap, five-minute observation bound,
budgets, and single-attempt policy.

## Verification

- Red/green regressions cover queue accounting, missing-log collection,
partial checks on evidence failure, and the required final screenshot.
Flow tests invoke the actual polling callbacks: restoring the original
callback reproduces both early-stop errors. Started cancellations still
fail.
- All 87 focused flow/grading/queue tests pass. Catalog/report checks
and the 137 additional Node checks pass. Eval typechecking passes on
final commit `0a6e11408c4470683417e6bf7965c73cec2a9a60`.
- All current CI tests/builds pass. Greptile is 5/5 on the final commit,
with no unresolved review threads.
- The final commit adds only flow test coverage. Its registered
definition digest equals live target
`e4e0be875ee12c134fe8dd2ce15a88bfcbb100ef`:
`ac6bba21d4b9cb86088be5d00df6442af90268186d6e94c9bea7d611d0488563`.
- Replaying the original saved observation still fails for missing
Morgan execution and delivery. Its stale queue record no longer counts
as provider work.

| Operation | Selected coverage | Observed result |
| --- | --- | --- |
|
[41071710105](https://github.com/paperclipai/paperclip/actions/runs/41071710105),
`b8dff816` | Backlog and delegation | Refused at the exact
private-retention gate before fixtures or providers. Preserved without
feature coverage. |
|
[41073708150](https://github.com/paperclipai/paperclip/actions/runs/41073708150),
`39be9e45` | Backlog and delegation | Both passed their full
product/browser oracles. Retained grades correctly fail missing
`final-state.png`; the feature flow had saved the image under another
name. Fixed in `e4e0be87`. Each original archive remains private and
intact; later workflow concurrency superseded only the report
aggregation. |
|
[41076854978](https://github.com/paperclipai/paperclip/actions/runs/41076854978),
`e4e0be87` | Backlog and delegation | Backlog passed in 92.576 seconds,
with a 47.388-second native run, complete required artifacts and passed
cleanup. Delegation was interrupted by a runner-host shutdown at
15:19:23 UTC; all later evidence-upload steps were skipped. Its private
archive is absent, so behavior, usage and cost remain unverified. |
|
[41080065077](https://github.com/paperclipai/paperclip/actions/runs/41080065077),
`0a6e1140` | Delegation only | Passed on the final commit in 240.786
seconds. All 14 product checks plus browser readback passed; exact
private identity, current worker output, Done state, correlated
source-chat reply, required screenshot and cleanup verified. The three
native runs took 42–60 seconds each. Passing control was not repeated.
One-cell workflow and report enforcement passed. |

The completed delegation in `41073708150` passed all 14 product checks
plus browser readback in 222.593 seconds. Morgan saved the current
two-sentence announcement, the task reached Done, and the CEO
automatically delivered that saved text to the original chat. Its three
successful native runs took 49.117, 40.060 and 39.107 seconds. The
failed required screenshot remains a failed result in that measurement.

All live operations use explicit IDs, concurrency one, no automatic
retries, the unchanged 120-second per-run cap, and scoped private
evidence retention bound to the exact workflow, target, original run,
selector and launcher digest. These narrow measurements do not qualify
the full catalog or establish repeated-run reliability.

The broad local support suite passed 5,139 tests, with two skipped. Two
database tests hit exhausted host semaphore capacity after the installed
Postgres package's missing library symlinks were repaired. Their recheck
reported `could not create semaphores: No space left on device`. No host
IPC resources or kernel settings were changed. The corresponding full CI
tests passed on a fresh host.

## Risks

- A broad cancellation exception could hide failed work. This exception
requires the dispatch gate's exact receipt, a null start time, the
expected company and prior owner, and the actual reassigned task.
Started and unproved cancellations still fail. Backlog creation permits
no task wake.
- New manual OpenCode cells can spend provider money only when
explicitly selected. Default scheduled selection is unchanged.
- This changes eval interpretation and evidence collection. It does not
change product scheduling or task ownership.

## Model Used

OpenAI Codex, GPT-6 family, with code execution and tool use. The exact
model ID and context-window size are not exposed to 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
- [ ] 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-10-30 10:40:00 -05:00

9.6 KiB

Chat feature evals

chat-features promotes two entries from the scenario catalog into real Product E2E executions. The scope is deliberately small: prove the fixture, browser interaction, independent grading and report loop before adding more features. Catalog coverage is not live acceptance.

Scenario Actual user request Independent outcome
tasks.create-backlog Add a task for Morgan to draft the launch announcement in Launch, but don't start it yet. Exactly one task, Launch project, Morgan assignee, backlog at creation, no worker execution, usable chat link after reload.
tasks.delegate-announcement Have Morgan write a two-sentence launch announcement using the Launch project brief, save it on the task, and send me the result here when it's finished. Exactly one task, actual Morgan execution, current worker-authored document grounded in the project brief, task Done, automatic completion response in the original chat, usable result after reload.

The queries are read directly from chat-scenarios/tasks.yaml. Context and expected outcomes stay evaluator-side. The fixture creates a disposable company, CEO, Morgan and Launch project through production APIs; both agents use the shipped role instructions. The brief contains a product, date and random invitation code absent from the user query. The browser sends one message through Agent Chat. The harness never creates the result task, writes the announcement, completes the task, or sends a hidden follow-up.

Run the first slice

Follow the installation steps in README.md. The Codex subscription profile uses the catalog's recorded default model and an explicit CODEX_AUTH_JSON login. Load that login privately into the launcher environment; do not print it or save it in tracked configuration. The existing subscription fixture stages only auth.json in the disposable company login slot and removes it with the isolated instance.

The local native OpenCode profile uses the current production-qualified model and OPENROUTER_API_KEY through the existing encrypted company-secret fixture. Each of the two journeys has a cell for each profile. All four cells are manual.

pnpm test:e2e:runner:typecheck
pnpm test:e2e:runner:unit
pnpm test:e2e:runner -- --list --suite chat-features
pnpm test:e2e:runner -- --id chat-features.runner-codex-subscription.local.create-backlog --max-automatic-retries 0
pnpm test:e2e:runner -- --id chat-features.runner-codex-subscription.local.delegate-announcement --max-automatic-retries 0
pnpm test:e2e:runner -- --id chat-features.runner-opencode.local.delegate-announcement --max-automatic-retries 0

Run creation first and inspect its packaged report before delegation. For initial acceptance, run each cell three times against fresh fixtures on the same definition revision. Keep every attempt, including failures; a retry does not erase one. A fixture or product correction starts a new three-sample measurement. All cells are explicit-only and excluded from --all; this does not implement or qualify the rest of the YAML inventory.

Bounds and grading

Creation expects one accounted native work run; delegation expects three (CEO handoff, Morgan work, CEO completion response). Runs have a 120-second timeout and attempts a seven-minute deadline. The visible task and completion reply must settle within five minutes after the human request, including a five-second stable observation. This is an independent journey acceptance bound: three runs may not each consume their maximum timeout and still pass. The outer attempt also covers fixture setup, reload and link checks, and evidence collection. A failed provider run rejects immediately; the historical missing turn-start event was not a five-minute poll timeout. Automatic retries are disabled. Company and agent budgets are 500 cents each, CEO daily work runs are capped at three, Morgan at one, and periodic heartbeats are disabled. Initial production hello probes fall outside heartbeat usage and budget accounting; detailed setup tokens and cost are unavailable. These limits are not an absolute inference or cash cap. Subscription cost coverage must remain explicit in the report.

An obsolete CEO assignment can leave a cancelled queue entry when the CEO creates a task and then assigns it to Morgan. Grader v2 distinguishes that entry from provider work only when the dispatch gate records issue_assignee_changed, an explicitly null start time, no native issue, and its unchanged stale-queue stop receipt. The entry must belong to this company and the one task now assigned to Morgan. It stays in the full observation and final ledger, with its events and an explicit provider-log omission reason. Active, unrelated, or unproved cancellations still fail. The three successful work runs, worker output, completion delivery, and original deadlines remain required. Backlog creation still permits no task wake.

Because this subscription currently reports unpriced usage, setup explicitly sets unpricedUsagePolicy: allow on the disposable company and both agents through the public budget API and verifies all three policies. The 500-cent hard stops remain enabled for reported costs; they cannot cap unknown dollar usage. Run caps and deadlines remain independent bounds. Without this explicit funding prerequisite, the default policy pauses the company after the first unpriced run and cancels the delegated worker. Such a pause is not a successful chat journey.

chat-feature.json retains the scenario ID, capability IDs, grader version, saved records, audit attribution, rendered links and individual checks. chat-feature-runs.json uses the existing native run evidence collector, including on failures. Setup evidence records fixture IDs, synthetic brief, readiness and saved budgets. Ordinary Product E2E evidence packaging, redaction, cleanup, failure classification and dashboards own the result. The definition digest includes the query, defaults, flow and grader sources. Individual saved-state checks are also recorded when the journey fails, so the report shows partial progress without turning it into a passing workflow.

The grader rejects duplicate tasks, wrong owners/projects/companies, early execution, missing audit attribution, missing or stale deliverables, extra human nudges and uncorrelated completion replies. Document provenance binds the current revision to Morgan's actual run. The completion check reuses completionDelivery; a handoff promise or a marker alone cannot establish delivery. Chromium verifies the task link and reload persistence.

The checks establish the specified saved state, two-sentence structure, required brief facts and result access. They do not score writing quality or every semantic claim in the response. Inspect the retained conversation and announcement before accepting the first samples; the existing completion semantic-review rubric still applies. Oracle calibration tests exercise both valid evidence and plausible wrong outcomes without calling a model.

Only after this loop is stable should another scenario be promoted. Keep each starting condition explicit: connected versus missing connection, allowed versus approval-required, and so on. Reuse the fixture/report infrastructure and add a case-specific outcome oracle; do not make all YAML paragraphs executable through an unconstrained model judge.

Initial measurement — 2026-10-26

Three fresh samples per cell on definition 7fb20426ce3f1dd4efeddfb79f231336ea65a16b9c2a73bf6131e997acd74e9d produced 5/6 passes: backlog creation 3/3 and delegation 2/3. These used local native Codex subscription execution with gpt-5.6-sol. All six cleaned up successfully. Both workflows have successful browser-to-provider evidence, but the initial repeatability target is not met.

In campaign local-2026-10-26T15-48-12-199Z, the first CEO run in delegation failed before creating a task: runnerd did not report the provider turn identity. Retained events show submission and provider startup, followed by the transport's turn-start deadline. The precise cause of the missing event remains unresolved; the existing machine classification is retained without claiming that the provider or infrastructure has been proven responsible. Investigate this before expanding the suite. No replacement sample erased this failure.

The local results/chat-feature-acceptance/acceptance.md records every sample and earlier failed revision; its sibling dashboard uses the standard report generator. Results are ignored generated artifacts, so retain or publish them through the existing Product E2E pipeline when handing this measurement to another machine.

Follow-up measurement — 2026-10-26

The unchanged delegation cell subsequently passed three fresh executions: local-2026-10-26T16-50-50-751Z, local-2026-10-26T16-54-58-203Z, and local-2026-10-26T16-58-39-074Z. The latter two campaigns also ran backlog creation concurrently and passed both cells. All five selected executions used one attempt with zero automatic retries, retained the same definition above, and passed cleanup. Five existing turn-identity, early-terminal and runner-exit regressions passed as well.

These are green rechecks, not a demonstrated repair of the earlier startup interruption: no production code, timing limits or oracle assertions changed, and the missing turn-start event did not reproduce. Keep the original failure in the history. Across the original final-definition batch and this recheck, backlog is 5/5 and delegation is 5/6. The local results/chat-feature-recheck/verification.md records the follow-up evidence; its standard dashboard is explicitly scoped to the latest campaign.