You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: pass plugin workers to issue tree resume (#13757)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - Issue tree controls can resume tasks and wake their assigned agents.
> - A sandbox-backed run needs the shared plugin worker manager to
acquire its lease.
> - The issue tree route constructed a heartbeat service without that
manager.
> - A ready sandbox provider therefore appeared offline and the resumed
run failed setup.
> - This pull request passes the existing manager to the route and
distinguishes missing wiring from a stopped worker.
## Linked Issues or Issue Description
Related implementation: #10262 identified this wiring defect in several
dispatch paths. This PR applies the issue-tree resume fix to current
master and adds coverage in the current route and runtime suites. The
other dispatch paths remain in the scope of that earlier PR.
**What happened?**
Resuming a paused issue subtree can fail to acquire a sandbox lease even
while its provider plugin is ready and its worker is running. The error
says the worker is not running because this route's heartbeat service
never received the process's worker manager.
**Expected behavior**
Resumed work uses the same worker manager as normal issue dispatch.
Missing wiring and an actually stopped worker produce distinct
diagnostic errors.
**Steps to reproduce**
1. Configure an agent with a plugin-backed sandbox environment and start
the provider worker.
2. Pause a subtree assigned to that agent.
3. Release the hold with `metadata.wakeAgents: true`.
4. The old route constructs an unwired heartbeat service and the resumed
run fails during setup.
**Paperclip version or commit**
Reproduced by source inspection and regression coverage against
`9d19f98b50`.
**Deployment mode**
Server with a plugin-backed sandbox environment.
## What Changed
- Pass the process's plugin worker manager from `createApp` through
issue tree controls to heartbeat dispatch.
- Check for a missing manager before reporting the sandbox worker as
stopped.
- Exercise the resume request with a shared manager and cover both
runtime failure cases. Model a stopped worker explicitly in the existing
infrastructure-retry fixture. Existing board and company access checks
remain covered.
## Verification
- Targeted Vitest route/runtime/recovery suites: 17 passed; 384 native
database tests skipped because embedded Postgres cannot start on this
host.
- Direct server `tsc --noEmit` passed.
- `pnpm -r typecheck`, server typecheck wrapper, and `pnpm build` were
attempted. Their runner dependency requires `cargo`, which is absent on
this host. CI must pass these checks before merge.
- Full `pnpm test:run` was attempted. The general server stage reported
8,146 passed, 4,747 skipped, and 14 failed tests across 35 failed
suites. Failures were embedded Postgres startup errors (with related
teardown errors) and 10 cache-directory rename failures on this macOS
host. The local run stopped there; Linux CI must pass the complete suite
before merge.
- All CI gates are green, including the native database recovery suite,
workspace typecheck/build, runner checks, and browser tests. Greptile
reviewed the current commit at 5/5 with no unresolved threads.
- No live provider operations were performed by these tests.
## Risks
Low risk: dependency forwarding and error classification only. The route
retains board authorization, company boundaries, hold semantics, and
existing cancellation/replay guards. The change does not replace a
sandbox or discard a retained lease. No schema or API shape changes.
## Model Used
OpenAI GPT-6 (Codex), with reasoning, repository tooling, 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] This fixes existing behavior and does not add planned core
features
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have described the issue in-PR following the bug issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links
- [x] My branch name describes the change and contains no private ticket
or instance data
- [x] Targeted local tests pass; full-suite and toolchain limits are
recorded above
- [x] I have added or updated tests where applicable
- [x] No documentation changes are needed for dependency forwarding
- [x] I have considered and documented 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 reviewer comments before requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
Copy file name to clipboardExpand all lines: server/src/services/environment-runtime.ts
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1785,14 +1785,16 @@ function createSandboxEnvironmentDriver(
1785
1785
`Sandbox provider "${parsed.config.provider}" is installed via plugin "${pluginProvider.resolved.plugin.pluginKey}", but that plugin is currently ${pluginProvider.resolved.plugin.status}.`,
1786
1786
);
1787
1787
}
1788
-
if(pluginProvider.state==="worker_unavailable"){
1788
+
// A missing manager is a wiring failure, even when the plugin worker
1789
+
// is healthy elsewhere in this process. Check it before worker state.
1790
+
if(!pluginWorkerManager){
1789
1791
thrownewError(
1790
-
`Sandbox provider "${parsed.config.provider}" is installed via plugin "${pluginProvider.resolved.plugin.pluginKey}", but its worker is not running.`,
1792
+
`Sandbox provider "${parsed.config.provider}" is installed, but sandbox plugin workers are unavailable in this server process.`,
1791
1793
);
1792
1794
}
1793
-
if(!pluginWorkerManager){
1795
+
if(pluginProvider.state==="worker_unavailable"){
1794
1796
thrownewError(
1795
-
`Sandbox provider "${parsed.config.provider}" is installed, but sandbox plugin workers are unavailable in this server process.`,
1797
+
`Sandbox provider "${parsed.config.provider}" is installed via plugin "${pluginProvider.resolved.plugin.pluginKey}", but its worker is not running.`,
0 commit comments