Files
PaperClipAI/tests
DottaandClaude Opus 5.5 5de2842620 fix(restart-chaos): bound each skopeo image copy attempt (#20056)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The restart-chaos harness downloads the signed Daytona runner image
with skopeo before each Daytona wave
> - #20021 made a failed copy retry from an empty directory, but the
retry only runs when skopeo exits
> - A hung blob read never exits, and a Daytona pull stalled for 80
minutes
> - This pull request bounds each copy attempt, so a stall is killed and
retried
> - The benefit is that one network stall costs at most one bounded
attempt, not the whole run

## Linked Issues or Issue Description

Follow-up to #20021. No duplicate PR was found.

**What happened?**

A Daytona chaos run's image pull stalled inside `skopeo copy` for 80
minutes, even after #20021. `copyImageToDir` awaited `execFile` with no
timeout, so a read that hung forever blocked the run forever.

**Expected behavior**

Each copy attempt has a time bound. A stalled attempt is killed and the
next attempt starts from an empty directory.

**Steps to reproduce**

1. Run a Daytona wave or crash point with an uncached image on a network
where a registry blob read hangs.
2. Before this PR, `skopeo copy` never returns and the run waits
indefinitely.

**Paperclip version or commit**

`master` before this PR.

## What Changed

- `copyImageToDir` passes `timeout` (default 20 minutes,
`RESTART_CHAOS_SKOPEO_ATTEMPT_TIMEOUT_MS`) and `killSignal: "SIGKILL"`
to each `skopeo copy`. A timed-out attempt counts as a failed attempt
and retries from an empty directory.
- README updated.

## Verification

- New test: a fake skopeo that writes a partial blob and then hangs is
killed after the 500 ms test bound, and the second attempt succeeds,
within 10 s.
- `pnpm exec vitest run --config tests/restart-chaos/vitest.config.ts
tests/restart-chaos/daytona-image.test.ts`: 18/18. `tsc -p
tests/restart-chaos/tsconfig.json` is clean.

## Risks

- Test harness only. A very slow but progressing pull longer than 20
minutes would now be retried; the bound is configurable.

## Model Used

- Anthropic Claude Opus 5.5 (`claude-opus-5-5`), via Claude Code with
tool use.

## 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-08 09:07:36 -06:00
..