Files
PaperClipAI/server
Devin FoleyandPaperclip 7d2b1d5362 fix(responsibilities): use configured plugin workers for task wakeups (#23705)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Responsibility actions create tasks and wake their assigned agents.
> - Plugin execution needs the server's configured plugin worker
manager.
> - Five responsibility route groups constructed heartbeat services
without that manager.
> - The task could be created successfully, then fail during environment
setup.
> - This pull request gives those routes the existing configured
heartbeat service so the first run can start.

## Linked Issues or Issue Description

**What happened?**

Starting a responsibility bar conversation created a task, but its first
run failed during sandbox setup. Delegation, dashboard conversations,
automation conversations, and status update requests used the same
incomplete heartbeat construction. Background recovery could later start
the task through a configured service.

**Expected behavior**

The first wake uses the application's configured plugin workers, so it
can acquire the assigned execution environment.

**Steps to reproduce**

1. Enable Responsibilities and configure an agent to use a plugin-backed
execution environment.
2. Start a responsibility bar conversation with that agent.
3. Observe that task creation succeeds but sandbox setup fails because
the heartbeat service has no plugin worker manager.

**Paperclip version or commit**

Reproduced against master at `0f36a88f41e36e93e50f146196353840e2def341`
with an application-level regression test. All five wakeup cases failed
before the fix.

**Deployment mode**

A server with a plugin-backed execution environment. The regression test
uses the normal application factory, a disposable local Postgres
database, and a configured plugin worker manager.

No duplicate public issue or pull request was found in the pre-change
search.

## What Changed

- Pass the existing worker-enabled heartbeat service to the five
responsibility route groups.
- Keep the automation route's plugin worker manager for its routine
service.
- Add application-level coverage for all five wakeup paths and the
disabled-feature gate. The tests use the real route registration and
database services, and intercept execution before provider work starts.

## Verification

- Red: all five application wakeup cases failed on the original route
wiring because the worker manager was missing.
- Green: 109 tests passed across the application wakeup,
responsibilities, bars, dashboard, automation conversations, and status
report suites.
- Server typecheck: after fixing an optional-input type error in the
test fixture, `node scripts/typecheck-layers.mjs` from `server/` passed
all source and test layers. The Runner TypeScript build and plugin SDK
prerequisites also passed.
- `node scripts/check-test-budget.mjs --files
server/src/__tests__/responsibility-app-wakeups.test.ts`: passed.
- `node scripts/check-module-boundaries.mjs`: passed.
- `git diff --cached --check` and a Gitleaks scan of the staged diff:
passed.
- The first `pnpm verify` selection was invalidated by the fixture type
fix. The final `pnpm verify --explain` passed and selected 2,008 test
files conservatively for this application change. Local validation used
the six focused suites above. Required CI supplies the broader test,
typecheck, build, Runner, and E2E coverage.
- [Greptile
review](https://github.com/paperclipai/paperclip/pull/23705#issuecomment-7402767043):
5/5 on `10035ffae203942ee93a5ee65879cd55a2130d4b`, with no inline
comments or unresolved review threads. [CI run
47276399658](https://github.com/paperclipai/paperclip/actions/runs/47276399658)
completed successfully on that same commit: typecheck, build, Runner
checks, all general and serialized test shards, and all 16 E2E shards
passed. Both required checks (`ci / verify` and `ci / e2e`) passed. The
branch has no merge conflicts with master. All 71 checks have settled
with no blocking results. The external Superagent Security Scan
completed with a neutral conclusion; Socket and Snyk checks passed.
GitHub reports the pull request as clean and mergeable.

## Risks

Low risk. The change reuses a heartbeat service that already has the
server's plugin worker manager. Route authorization and feature gates
keep their current behavior. No schema migration or configuration change
is required. Live provider execution and a Cloud rollout are outside
this PR's local verification; the tests verify the
application-to-execution dependency boundary.

The code and regression tests describe the corrected internal wiring, so
no user documentation change is needed.

## Model Used

OpenAI Codex, `gpt-6.1-sol`, with xhigh reasoning effort and repository
tools.

## 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

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-04 09:53:20 -08:00
..