Files
Nicky LeachandClaude Opus 5.5 dc16c47362 refactor(runner): remove the unused plugin task source recovery path (#23590)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - An agent run uses a Runner task that an environment plugin provides.
When a Runner stops, the next run can need its saved session
> - #19134 and #19196 added one way to do this. The next run claims the
stopped Runner's task, and then starts that task again under its own
control
> - Those pull requests added the claim and its checks. They did not add
a caller. #19157 was to add the caller, and it did not merge
> - Nothing on `master` calls the claim. No lease gets the two records
that the claim writes, so every check of those records does nothing
> - The unused path still looks active. A reader can change it, and can
think that the change fixes a failure
> - This pull request removes the claim and all code that only reads its
records
> - The benefit is that the code shows only the recovery paths that can
run

## Linked Issues or Issue Description

Refs #19134, #19196 (added the path), #19157 (closed draft that called
it).

**Issue type**

Dead code

**What happened?**

`claimPluginTaskSourceRecovery` has no caller on `master`. Only the
claim writes `runnerTaskSourceConsumer` and `runnerTaskSourceRecovery`
to a lease. Six other server files read those records.

**Expected behavior**

The server contains only recovery code that can run.

**Steps to reproduce**

1. Run `git grep claimPluginTaskSourceRecovery master -- server`.
2. See only the definition.
3. Run `git log -G claimPluginTaskSourceRecovery master`.
4. See that the commits added the path, and later removed its tests. No
commit added a caller.

## What Changed

- Removed the source recovery claim and its checks
(`plugin-task-source-recovery.ts`).
- Removed the special handling of a claimed source from plugin task
dispatch, task resume, checkpoint writes, task ownership, and retained
and warm sandbox expiry.
- A Runner task owner no longer takes `codexSourceRecoveryVersion`.
Nothing set it, so the owner always refused to prepare a predecessor's
launch. It still refuses.
- The checkpoint writer still locks both runs, and still refuses a late
write from a session that moved to another task.
- The plugin SDK still accepts `codexSourceRecoveryVersion` and
`acpxSourceRecoveryVersion`, so a plugin that sends them does not fail.
The guide now says that Core does not use them.
- The Runner package does not change.

## Verification

- `npx vitest run` on eight test files for the changed code: 319 tests
pass.
- `npx tsc --noEmit` in `server` has no errors.
- The test of a late write to a retired checkpoint used the removed
records. It now uses the records of a session that moved to another
task.
- Not run locally: the suites that start a real Runner. CI runs them.

## Risks

- No production code wrote these records, so no saved lease should
contain them. A lease that does contain them is no longer held by them.
- #19157 depended on this path. It is closed and did not merge.
- No migration. No change to the plugin or Runner protocol.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, in Claude Code, with
extended thinking, 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
- [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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 07:43:49 -08:00
..