mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-30 17:14:54 +01:00
fix(runner): ship provider pack in the standard Docker image (#14854)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Remote OpenCode and ACPX runs need a provider pack from the application build. > - Cloud now builds its application image from the standard production image. > - The provider pack was added only to the legacy cloud image target. > - The standard image therefore cannot supply the pack to downstream Cloud images. > - This pull request adds the pack to the production image and lets the cloud target inherit it. > - Remote runs can then use the pack that matches the application source commit. ## Linked Issues or Issue Description Refs #13827. Refs #14024. The standard production image does not include the remote provider pack. Downstream Cloud images inherit that omission. Remote OpenCode and ACPX runs fail with `runner_remote_provider_artifact_incompatible` and ask for `PAPERCLIP_RUNNER_REMOTE_PROVIDER_PACK_PATH`. ## What Changed - Build and copy the provider pack into the standard production image. - Set the pack path and check that an unprivileged user can read its artifacts and execute Node. - Let the legacy cloud target inherit the pack from production. - Add regression checks for production packaging and cloud inheritance. - Document stamped image behavior and the default pack path. ## Verification - The 12 focused Docker stamp and provider-pack reuse tests pass on commit `4a11f8d52aead55f85527c8e82c6d7f2644ce0da`. - The new packaging regression failed against the old Dockerfile and passed with the fix. - On the current commit, `pnpm build` and `pnpm -r typecheck` pass. All seven standard-image contract tests also pass. - The current-head CI build, typecheck, test, browser, and native Runner checks passed. The local full suite hit one chat-channel assertion failure; that exact test passed in isolation. The remaining local run was stopped after CI completed to avoid duplicating its full suite. An earlier run on the pre-rebase base had a heartbeat comment batching timeout; the external chat wait integration suite passed all 142 tests in isolation. - [The stamped preview image build passed](https://github.com/paperclipai/paperclip/actions/runs/36885002850/job/110446106393), including the production-stage provider pack build, copy, and unprivileged artifact readability/executable check. Publication, compatibility validation, and deployment of this exact commit to a staging QA instance passed. - Reproduced the exact missing-pack error on an existing staging image with Paperclip Runner, ACPX, and Claude in a remote Daytona computer. The legacy Claude adapter succeeds with the same account and computer. After deploying this commit, the same native task succeeded: it computed `5050` with a real remote shell command, wrote a proof file, read it back in a separate call, uploaded the file as a deliverable, and completed the task. The uploaded file contents and Done state persisted after a page reload. The run trace confirms Paperclip Runner, ACPX, and Claude. The first run took 2m 59s, including approximately 97s of remote artifact preparation. A second native run read the unchanged file from the prior run and completed successfully. Its startup took about 120s; this verifies repeated execution and file persistence, not fast provider-pack reuse. ## Risks - Stamped standard images now include the provider pack and its build cost. A pack build failure now fails the production image build. - Unstamped local builds still skip pack generation. Setting the path alone does not create a pack. - No database, provider authentication, or runner verification rules change. ## Model Used OpenAI Codex, GPT-6. The exact serving model identifier and context window are not exposed in this session. Capabilities used: repository inspection, code editing, shell verification, and browser testing. ## 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 - [ ] 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>
This commit is contained in:
1 parent
33a00d2f1e
commit
6395cae072
4 files changed
+63
-35
No files matched your search
@@ -106,21 +106,32 @@ describe("Docker Rust dependency cache", () => {
|
||||
});
|
||||
|
||||
|
||||
describe("Cloud remote provider pack", () => {
|
||||
it("ships a build-owned pack without provisioning Grok on the controller", () => {
|
||||
const pack = stageBody(dockerfile, "cloud-provider-pack");
|
||||
const cloud = stageBody(dockerfile, "cloud");
|
||||
describe("Standard image remote provider pack", () => {
|
||||
it("ships the build-owned pack in the production base used by downstream images", () => {
|
||||
const pack = stageBody(dockerfile, "runner-provider-pack");
|
||||
const production = stageBody(dockerfile, "production");
|
||||
expect(pack).toContain("FROM build AS runner-provider-pack");
|
||||
expect(pack).toContain('PAPERCLIP_RUNNER_SOURCE_REVISION="${PAPERCLIP_BUILD_COMMIT}"');
|
||||
expect(pack).toContain("build-provider-pack.mjs /provider-pack");
|
||||
expect(pack).toContain('if [ -n "${PAPERCLIP_BUILD_COMMIT}" ]; then');
|
||||
expect(pack).toContain("mkdir -p /provider-pack");
|
||||
expect(pack).toContain("Skipping remote provider pack");
|
||||
expect(cloud).toContain("--from=cloud-provider-pack /provider-pack /opt/paperclip-runner/provider-pack");
|
||||
expect(cloud).not.toContain("--chown=node:node --from=cloud-provider-pack");
|
||||
expect(cloud).toContain("chmod -R a+rX /opt/paperclip-runner/provider-pack");
|
||||
expect(cloud).toContain("gosu 65534:65534 node");
|
||||
expect(cloud).toContain("Object.values(manifest.payload.artifacts)");
|
||||
expect(cloud).toContain("PAPERCLIP_RUNNER_REMOTE_PROVIDER_PACK_PATH=/opt/paperclip-runner/provider-pack");
|
||||
expect(production).toContain("--from=runner-provider-pack /provider-pack /opt/paperclip-runner/provider-pack");
|
||||
expect(production).not.toContain("--chown=node:node --from=runner-provider-pack");
|
||||
expect(production).toContain("chmod -R a+rX /opt/paperclip-runner/provider-pack");
|
||||
expect(production).toContain("gosu 65534:65534 node");
|
||||
expect(production).toContain("Object.values(manifest.payload.artifacts)");
|
||||
expect(production).toContain("PAPERCLIP_RUNNER_REMOTE_PROVIDER_PACK_PATH=/opt/paperclip-runner/provider-pack");
|
||||
expect(workflow).toMatch(/^\s*target: production$/m);
|
||||
expect(dockerfile).not.toContain("provision-grok.mjs");
|
||||
});
|
||||
|
||||
it("lets explicit cloud preview builds inherit the same pack and configuration", () => {
|
||||
const cloud = stageBody(dockerfile, "cloud");
|
||||
expect(cloud).toContain("FROM production AS cloud");
|
||||
expect(cloud).not.toContain("/opt/paperclip-runner/provider-pack");
|
||||
expect(cloud).not.toContain("PAPERCLIP_RUNNER_REMOTE_PROVIDER_PACK_PATH");
|
||||
expect(dockerfile.match(/build-provider-pack\.mjs \/provider-pack/g)).toHaveLength(1);
|
||||
expect(previewWorkflow).toMatch(/^\s*target: cloud$/m);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user