mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-08 21:01:54 +01:00
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - The Product regression TestOps plan runs 20 Product E2E cells
through `runner-full-stack-e2e.yml`
> - The full 20-case TestOps launch on `master` 4740d251 passed 13 of 20
> - Four failures came from the eval's observation, not from the product
> - Three Agent Chat handoff cases raced the product's completed-handoff
reply turn, and the run-count contract treated that reply as an
unexpected run
> - One continuation case waited for `DOMContentLoaded` after a server
restart, which the dev server can leave pending while the page is
interactive
> - This pull request makes the eval observe those two behaviors
explicitly
> - The benefit is that these cases measure the product again, and the
handoff cases now also prove that the result returns to the chat
## Linked Issues or Issue Description
Refs #14408, #19053
**What happened?**
TestOps launch https://paperclip.testops.cloud/launch/2694 (GitHub run
https://github.com/paperclipai/paperclip/actions/runs/41915965118)
failed these cells:
- `agent-chat` `multi-repository`, `clarify-reuse`, `plan-handoff`:
"Declared total provider-run bounds". Each final run ledger has exactly
one extra run. That run is the source chat's `chat_task_completed` turn,
with `chatCompletionUpdates` naming the finished task.
- `continuation` `completed-action-resume`: `page.goto: Timeout 30000ms
exceeded` waiting for `domcontentloaded` right after the deliberate
server restart. The server log shows the page loaded and called the API
during that wait.
**Expected behavior**
A completed handoff returns to the source chat (#14408). The eval must
observe that reply, require it, and count it. After a restart, the eval
must wait for the rendered task, not for a browser load event.
**Steps to reproduce**
Run the cells listed above on `master` with the Product regression
TestOps lane.
## What Changed
- `chat-flow.ts`: after the delegated task is `done`, the handoff branch
waits for the source chat's completion-reply turn
(`chat_task_completed`, correlated by `chatCompletionUpdates[].id`). It
requires exactly one such turn, `succeeded`, and exactly one agent
comment created by that turn.
- `chat-cases.ts`: the declared run counts include that one reply turn:
`multi-repository` 2 → 3, `clarify-reuse` 3 → 4, `plan-handoff` 4 → 5.
The minimum and maximum stay equal, so a missing reply or an extra run
still fails.
- `catalog.test.ts`: the catalog run-count total changes from 385 to 397
for these three cases across their profiles.
- `continuation-flow.ts`: `open()` uses `waitUntil: "commit"` with a 60
s navigation limit, then requires the rendered task thread
(`waitForTaskChatRendered`). This matches the existing restart handling
in `chat-flow.ts`.
## Verification
- `npx vitest run --config tests/runner-e2e/vitest.config.ts
tests/runner-e2e/chat-flow.test.ts tests/runner-e2e/continuation.test.ts
tests/runner-e2e/catalog.test.ts
tests/runner-e2e/kimi-qualification.test.ts
tests/runner-e2e/non-execution-wake.test.ts
tests/runner-e2e/product-regression-testops-catalog.test.ts
tests/runner-e2e/lifecycle-live.test.ts`: all pass.
- `tsc -p tests/runner-e2e/tsconfig.json`: no errors in
`tests/runner-e2e`.
- The retained ledgers from run 41915965118 show the reply turn:
`multi-repository` 3 runs, `clarify-reuse` 4 runs, `plan-handoff` 5
runs, each with one `chat_task_completed` run on the chat issue.
- Live single-case TestOps runs against this branch: see the PR
comments.
## Risks
- Changed eval conditions: the three handoff cases now also require the
completion reply. A product regression that drops the reply now fails
these cases, as intended.
- The continuation navigation allowance changes from 30 s
(`domcontentloaded`) to 60 s (`commit`) plus a rendered-thread check.
That is an observation deadline, not a product latency requirement. The
rendered-thread check is stronger than the old load event.
- Three other plan failures are not changed here. They are product
failures: the agent creates `human_only` confirmations, and
`resolve-from-comment` then refuses to record the user's explicit text
approval (`interaction_human_only`).
## Model Used
- Claude Opus 5.5 (`claude-opus-5-5`), via Claude Code with tool use and
code execution.
## 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
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
4.5 KiB
TypeScript
79 lines
4.5 KiB
TypeScript
import type { RunnerTaskFixture } from "./types.js";
|
|
|
|
// Markers cross the rich-text composer and Markdown persistence boundary.
|
|
// Alphanumeric text has identical visible and stored representations.
|
|
export function chatMarker(
|
|
prefix: "CHAT" | "DRAFT" | "OLDCONTEXT",
|
|
nonce: string,
|
|
) {
|
|
return `${prefix}${nonce.replace(/[^a-zA-Z0-9]/g, "")}`;
|
|
}
|
|
|
|
export const CHAT_CASES = [
|
|
["create-backlog", "Save a planned task without starting work", 2],
|
|
["reassign-task", "Reassign existing work and preserve queued context", 2],
|
|
["continuity-restart", "Conversation continuity across restart", 3],
|
|
["new-session", "Fresh context within preserved history", 2],
|
|
["stop-new-resume", "Stop, reset, and resume", 3],
|
|
// Handoff cases include the source chat's one completion-reply turn.
|
|
["plan-handoff", "Draft, revise, approve, and hand off a plan", 5],
|
|
["clarify-reuse", "Clarify and reuse an existing project", 4],
|
|
["multi-repository", "Create a project with multiple repository URLs", 3],
|
|
] as const;
|
|
export type ChatCase = (typeof CHAT_CASES)[number][0];
|
|
const HARDENING_CASES = [
|
|
["stop-startup-new-resume", "Stop during startup, reset, and resume", 3],
|
|
["hire-delegate-reuse", "Hire through chat, delegate, and reuse the same teammate", 5],
|
|
["blocked-status-review", "Read the actual blocker and hand source material to a reviewer", 4],
|
|
["committed-send-retry", "Recover a lost send acknowledgement without repeating committed work", 2],
|
|
...CHAT_CASES.filter(([id]) => ["stop-new-resume", "continuity-restart"].includes(id)),
|
|
] as const;
|
|
function buildChatTasks(definitions: readonly (readonly [string, string, number])[]): readonly RunnerTaskFixture[] {
|
|
return definitions.map(
|
|
([id, label, expectedRunCount]) => ({
|
|
id,
|
|
label,
|
|
groups: ["chat"],
|
|
flow: "agent_chat",
|
|
workMode: "standard",
|
|
expectedRunCount, // Provider turns, including cancelled turns and handed-off work; reset runs are separate.
|
|
attemptTimeoutMs: { local: 15 * 60_000, daytona: 15 * 60_000 },
|
|
expectedTerminalState: { issue: "in_review", run: "succeeded" },
|
|
buildTitle: (nonce) => `Chat acceptance ${id} ${nonce}`,
|
|
buildPrompt: (nonce) => `Let's discuss ${nonce}.`,
|
|
buildVisibleMarker: (nonce) => chatMarker("CHAT", nonce),
|
|
buildMatchers: () => [{ kind: "issue_status", expected: "in_review" }],
|
|
}),
|
|
);
|
|
}
|
|
export const chatTasks = buildChatTasks(CHAT_CASES);
|
|
export const chatHardeningTasks = buildChatTasks(HARDENING_CASES);
|
|
export const chatStoryTasks = buildChatTasks([
|
|
["enable-disable-resume", "Enable Agent Chat, pause access, and resume preserved history", 2],
|
|
["followup-while-running", "Deliver a follow-up while a provider turn is running", 2],
|
|
["revise-while-running", "Change instructions during active work and save the updated plan", 2],
|
|
]).map(task => ({ ...task, ...(task.id === "enable-disable-resume" ? {} : { minimumExpectedRunCount: 1 }) }));
|
|
|
|
export function chatNeedsApiTools(suiteId: string, caseId: string): boolean {
|
|
return suiteId === "hiring-templates" || (suiteId === "agent-chat-qualification" && caseId === "grounded-answer-quality") || suiteId === "agent-chat-hardening" && ["hire-delegate-reuse", "blocked-status-review"].includes(caseId);
|
|
}
|
|
export function isManagedHiringCase(suiteId: string, caseId: string): boolean {
|
|
return (suiteId === "hiring-templates" && caseId === "hire-coder-template-reuse") || (suiteId === "everyday-workflows" && caseId === "hire-reuse") ||
|
|
(suiteId === "agent-chat-hardening" && caseId === "hire-delegate-reuse");
|
|
}
|
|
|
|
export const chatQualificationTasks = buildChatTasks([
|
|
["active-reassignment", "Reassign an executing task and preserve its saved work", 3],
|
|
["worker-crash-retry", "Recover from worker process loss through visible Retry", 2],
|
|
["grounded-answer-quality", "Ground status, correct stale claims, and acknowledge uncertainty", 2],
|
|
]);
|
|
|
|
export const chatCompletionTasks = buildChatTasks([
|
|
["handoff-completion-idle", "Report a delegated result after the chat goes idle", 4],
|
|
["handoff-completion-busy", "Queue a delegated result behind an active chat reply", 5],
|
|
["handoff-completion-multiple", "Report multiple delegated results as they finish", 7],
|
|
["handoff-completion-restart", "Recover pending completion delivery across a server restart", 5],
|
|
]).map(task => ({ ...task, minimumExpectedRunCount: 2 }));
|
|
|
|
export const chatConfirmationTasks = buildChatTasks([["confirmation-ambiguous", "Clarify ambiguous approval, then resolve only the chosen cards", 4], ["unanswered-question-return", "Move on, reopen a historical question, and deliver the late answer", 3]]);
|