Files
PaperClipAI/tests
DottaandClaude Opus 5.5 10bc6431da test(restart-chaos): measure TTFT in a real repository workspace, after an idle restart, and on Daytona (#20047)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The restart chaos TTFT driver measures time to first token, but only
with a tiny fixture workspace and only locally
> - Dotta asked whether speed is good with a workspace like the
paperclip repository itself, and that had never been measured
> - This pull request lets the driver run in a real repository
workspace, measure the first follow-up after an idle restart, run on
Daytona (per-turn or warm reusable sandboxes), and report each run's
workspace operations
> - The benefit is a repeatable large-workspace speed measurement; its
first run found a full workspace re-upload on every remote turn

## Linked Issues or Issue Description

**What happened?**
The TTFT driver seeded only a tiny fixture repository, created tasks
outside any project, ran only locally, and could not show workspace
operation durations. So large-workspace speed (worktree creation,
provision, remote upload) was never measured.

**Steps to reproduce**
1. Run `ttft-baseline.ts` with any options.
2. Every task runs without a project workspace and on the local host.
3. Nothing in the report shows worktree, provision or sync cost.

**Expected behavior**
The driver can measure a real repository workspace, locally and on
Daytona, and names the workspace operations each run waited on.

## What Changed

- `--workspace-repo <path>`: the seed uses that repository as the
project's primary workspace (git_worktree isolation), and tasks are
created in the project.
- A `postfault` phase: K1 while idle, then a follow-up on each task;
reported in its own table.
- `--env daytona`, `--daytona-image`, `--daytona-cpu`, `--daytona-warm`
(the reusable warm Daytona fixture). The Daytona controller preparation
moved to `daytona-controller.ts`, and every sandbox is cleaned up at the
end; incomplete cleanup fails the run.
- Each run's workspace operations
(`/api/heartbeat-runs/:id/workspace-operations`) are saved, and printed
ranked by duration.

## Verification

- `tsc -p tests/restart-chaos`: no errors in harness files.
- Used for the large-workspace measurement, a fresh paperclip clone on
local and Daytona (per-turn and warm). First turn / follow-up: local
31–34 s / 7 s; Daytona per-turn 58–63 s / 30 s; Daytona warm 45–51 s /
8–10 s. Every Daytona sandbox was cleaned up (environment deleted, none
remaining).

## Risks

- Test harness only; no product code.
## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, via Claude Code with
tool use (shell, file editing, test execution, Daytona measurements).

## 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>
2026-11-10 10:00:45 -06:00
..