mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-04 21:21:27 +01:00
a30541b793995147d3d0fece87f204ea450fc7cf
8859
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a30541b793 |
fix(ui): fade out task status update caret unless hovered (#23402)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - On a task page, the activity thread shows status update rows such as "Ran commands, searched files" and their expanded activity rows. > - In `TaskChatRunnerActivityGroup`, the disclosure caret on the right edge stays at full opacity even when the user does not hover over the row. > - Other collapsible rows in the task thread (`TaskChatThinking`, `TaskChatProtocolActivityRow`) hide their disclosure carets at rest while preserving touch-device discoverability (`tc-hover-disclosure-caret`) and keeping expanded carets legible (`rotate-90 opacity-80`). > - This pull request fades out the right-side caret on runner activity phase toggles, folded read runs, and expandable activity rows unless hovered, keyboard-focused, or expanded, while sharing the repository's `.tc-hover-disclosure-caret` touch fallback. > - The benefit is a calmer task thread with no layout shift on hover, full keyboard accessibility, and consistent disclosure behavior across all task-chat rows. ## Linked Issues or Issue Description **What existing behavior does this improve?** The disclosure carets on the right side of task status update rows in `TaskChatRunnerActivityGroup` on the task page. **Subsystem affected** ui/ — React + Vite board UI **Current behavior** Activity status update rows such as "Ran commands, searched files", folded file-read rows, and expandable activity rows keep their right-side chevron caret visible at full opacity at rest. **Proposed behavior** When collapsed and not hovered, the right-side caret stays faded out (`opacity-0`). It fades in smoothly with the shared motion tokens (`--motion-duration-fast` and `--motion-ease-standard`) on row hover or keyboard `focus-visible`, and fades back out when hover or focus ends. While a row is expanded, the caret stays visible (`rotate-90 opacity-80`, brightening to `opacity-100` on hover/focus). All three carets include the shared `.tc-hover-disclosure-caret` class so touch-only devices (`@media (hover: none)`) keep the disclosure affordance discoverable. **Reason and benefit** Hiding the right-side caret at rest removes visual noise across activity updates in the task thread and aligns `TaskChatRunnerActivityGroup` with the existing hover-disclosure pattern in `TaskChatThinking`, `TaskChatProtocolActivityRow`, and `ui/src/index.css` (related: #12640, #15048). Using opacity instead of unmounting keeps row alignment stable on hover. **Breaking changes** None. ## What Changed - Extract a shared `DISCLOSURE_CARET_CLASS` constant in `ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx` including `tc-hover-disclosure-caret` and the shared motion tokens (`--motion-duration-fast`, `--motion-ease-standard`, `motion-reduce:transition-none`). - Add named group hooks (`group/activity-phase`, `group/read-run`, `group/activity-row`) to the three disclosure buttons in `TaskChatRunnerActivityGroup.tsx`. - Fade out each right-side `ChevronRight` caret at rest (`opacity-0`), reveal it on hover or keyboard focus (`group-hover/...:opacity-100`, `group-focus-visible/...:opacity-100`), and keep it visible while open (`rotate-90 opacity-80`). - Add unit tests in `ui/src/components/task-chat/TaskChatRunnerActivityGroup.test.tsx` covering completed summaries, active toggles, folded read runs, expanded activity rows, open/close state transitions, and `tc-hover-disclosure-caret`. ## Verification - Local focused Vitest on `0b46f7cf99`: `node node_modules/vitest/vitest.mjs run ui/src/components/task-chat/TaskChatRunnerActivityGroup.test.tsx ui/src/components/task-chat/antigravity-thread.test.tsx ui/src/components/task-chat/completed-activity-summary.test.ts` — 36/36 tests passed. - Local focused Vitest on `0b46f7cf99`: `node node_modules/vitest/vitest.mjs run ui/src/components/TaskChatThread.test.tsx` — 436 passed, 1 skipped. - Local token gates on `0b46f7cf99`: `pnpm check:token-gates` — all 4 token gates clean. - Local UI build on `0b46f7cf99`: `pnpm --filter @paperclipai/ui build` — built cleanly and verified compiled CSS emits `@media (hover:none){.tc-hover-disclosure-caret{opacity:1}}` and scoped `group-hover/*:opacity-100` rules. - GitHub Actions CI on `0b46f7cf99` ([run 46734780674](https://github.com/paperclipai/paperclip/actions/runs/46734780674)): all 30 checks passed (`ci / verify`, `ci / Build`, `ci / Typecheck + Release Registry`, `ci / General tests`, `ci / policy`, all 16 `ci / e2e` shards, `commitperclip PR Review`, `Socket Security`, `Superagent Security`, and `security/snyk`). - Automated reviews on `0b46f7cf99`: `ponytail-paperclip-review` (5/5, ship), `feynman-nuclear-review` (5/5), and `Greptile Review` (5/5; P2 note about `tc-hover-disclosure-caret` answered and resolved in-thread). ## Risks - Low risk. Only the opacity, rotation, and transition classes on the right-side disclosure carets change; click, expand/collapse, keyboard, and touch-device discoverability semantics stay intact. > This is a small UI polish change and does not overlap with planned core features in `ROADMAP.md`. ## Model Used - Google DeepMind Antigravity coding agent (Gemini model with reasoning/thinking mode, file editing, shell execution, and GitHub CLI tools; exact model ID and context window are not exposed by the runner environment). ## 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 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>canary/v2026.1204.0-canary.885900 |
||
|
|
3f882fc589 |
fix(native): stage task-description attachments for native agents (#23688)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - People often create a task with a screenshot in its description and
assign it to a native agent.
> - The native Runner stages wake-comment files into the agent
workspace, so the agent can open an image with its file reader.
> - Files attached to the task description have no comment, so the
Runner never staged them.
> - The agent then said that it could not see the screenshot, or it
guessed from the text.
> - This pull request stages the task's own files on every native wake.
> - The benefit is that an agent can see the screenshot that explains
the task.
## Linked Issues or Issue Description
**What happened?**
A user created a task with the description "This list should probably be
sorted alphabetically" and pasted a screenshot of the list. A Claude
agent on a native sandbox replied that it could not open the screenshot
and asked which list to sort. It found the attachment through the API,
but the run had no staged path and no tool that put the image in its
workspace. When the same image was attached to a comment, the agent
opened it at once.
**Expected behavior**
A native agent can inspect files that are attached to the task
description, the same as files attached to a wake comment.
**Steps to reproduce**
1. Create a task and paste an image into its description.
2. Assign the task to a native `paperclip_runner` agent.
3. Ask the agent what the image shows.
4. The prompt has no "Paperclip native attachment access" entry for the
image, and the agent cannot see it.
**Paperclip version or commit**
`master` at
canary/v2026.1204.0-canary.885800
|
||
|
|
0d867729db |
fix(server): encode non-Latin-1 workspace download filenames (#23683)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Board users can open and download files from a task's workspace through the file-resources route > - The download response builds a raw `Content-Disposition` header from the file name > - Node rejects header values that hold characters outside Latin-1, such as the U+202F narrow no-break space in macOS screenshot names, or CJK text > - The route then fails with `TypeError: Invalid character in header content ["Content-Disposition"]` and returns 500 > - This pull request makes the route use `res.attachment()`, which encodes the name correctly > - The benefit is that users can download workspace files with any name ## Linked Issues or Issue Description Refs #22892. That PR fixes the same defect in the asset and invite-logo routes. This PR fixes the last route that builds the header by hand: the workspace file download. The two PRs change different files and do not conflict. **What happened?** A staging server reported `TypeError: Invalid character in header content ["Content-Disposition"]` from `ServerResponse.setHeader`. A workspace file download with a non-Latin-1 file name returns HTTP 500 for the same reason. **Expected behavior** The download succeeds. The header holds an ASCII `filename` fallback and an RFC 6266 `filename*` parameter with the full UTF-8 name. **Steps to reproduce** 1. Put a file named `Screenshot 10.32.55 PM.png` (with U+202F before `PM`) in a project workspace. 2. Download it through `GET /api/issues/:issueId/file-resources/content?download=1`. 3. The server returns 500. **Relevant logs or output** `TypeError: Invalid character in header content ["Content-Disposition"]` at `ServerResponse.setHeader (node:_http_outgoing)`. ## What Changed - `server/src/routes/file-resources.ts`: the download path now calls `res.attachment(safeAttachmentFilename(title))` instead of writing the raw header. The call comes before `Content-Type`, so the route keeps its own content type. - `server/src/__tests__/file-resources.test.ts`: a new test downloads a file whose name holds U+202F and Japanese text. It checks the status, the content type, the encoded `Content-Disposition`, and the bytes. ## Verification - Red: without the route change, `npx vitest run src/__tests__/file-resources.test.ts -t "not Latin-1"` fails with `expected 500 to be 200`. - Green: with the change, `npx vitest run src/__tests__/file-resources.test.ts` passes (53 of 53). The old `archive.bin` and `index.html` download tests still get `attachment; filename="..."` unchanged. - I also reproduced the Node error directly: `setHeader("Content-Disposition", 'inline; filename="Screenshot 10.32.55 PM.png"')` throws the same message. ## Risks Low risk. ASCII file names produce the same header as before. Non-Latin-1 names now get a `?` fallback in `filename` and the full name in `filename*`, which current browsers use. `res.attachment()` also sets `Content-Type` from the extension, but the route sets its own value right after that call. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), used as an agent with tool use (shell, code edits, test runs). ## 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: paperclipbugbot <356415228+paperclipbugbot@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>canary/v2026.1204.0-canary.885700 |
||
|
|
8a5b374a9c |
test: order Antigravity mode changes before admission readback (#23685)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The Runner checks provider settings before it admits an Antigravity swarm. > - A test changes a confirmed mode during admission and expects rejection. > - The fake CLI could complete model readback before it sent the mode change. > - Pipe scheduling could then move the change past admission and fail the test. > - This pull request sends the mode change before model readback. > - The test can now check admission rejection without depending on pipe timing. ## Linked Issues or Issue Description **What happened?** [Cloud readiness run 47231816304, attempt 2](https://github.com/paperclipai/paperclip/actions/runs/47231816304/job/144707142899) failed the Antigravity test named “turns a provider mode change during admission into a typed failure, stops the CLI, and keeps the caller alive”. The open promise resolved instead of rejecting. This cancelled [image run 47231816399](https://github.com/paperclipai/paperclip/actions/runs/47231816399). **Expected behavior** The fixture must deliver the mode change while admission still waits for model readback. The runtime must reject with `ANTIGRAVITY_SWARM_RECEIPT_MISMATCH` and stop its child process. **Steps to reproduce** Run `PAPERCLIP_VITEST_RETRY=0 pnpm exec vitest run src/drivers/acpx/antigravity-swarm-runtime.test.ts --maxWorkers=1` from `packages/paperclip-runner`. Before this change, the `mode-flip` fixture wrote the valid model update before the invalid mode update. Separate pipe reads could let admission finish between them. The CI failure shows this outcome. One focused local baseline attempt passed, so the intermittent failure was not reproduced locally. ## What Changed - Send the `mode-flip` notification before the model configuration update. Admission cannot finish model readback before it receives the invalid mode. - Keep the existing rejection and child retirement assertions. The idle mode-change fixture and runtime code stay as they are. ## Verification - The full Antigravity swarm runtime file passed: 66 tests, retries disabled, one worker. - `node --check packages/paperclip-runner/test-fixtures/antigravity-cli/fake-agy-acp.mjs` passed. - `node scripts/check-test-budget.mjs --base origin/master` passed. - `git diff --check` passed. - `pnpm verify --explain` returned exit 2 because a Runner fixture needs broad CI coverage. Required CI will supply that coverage. - Final head `2c55808f394ad07dc279a6d074fecb9f61fa540f`: [PR CI run 47239627453, attempt 2](https://github.com/paperclipai/paperclip/actions/runs/47239627453/attempts/2) passed. It reports 76 successful jobs and one skipped selection job. Both required gates (`ci / verify` and `ci / e2e`) passed. Standalone Runner image checks, macOS checks, and Windows Rust checks passed. No checks remain active. GitHub reports `CLEAN` and `MERGEABLE`. - Greptile scored this exact head 5/5 with no actionable findings or unresolved review threads. - Earlier failures remain accounted for: [the delayed initial run](https://github.com/paperclipai/paperclip/actions/runs/47239537426) was superseded by the `full-ci` label run and cancelled by PR concurrency. Attempt 1 of the replacement run passed 73 jobs, but [policy](https://github.com/paperclipai/paperclip/actions/runs/47239627453/job/144728063451) exceeded its 10-minute limit. Both final gates then failed with `Policy must succeed`, actual `cancelled`. Policy logs returned `BlobNotFound`, so the stalled step and cause are unknown. After the run completed, GitHub accepted a policy-job rerun request. This reran the reusable CI workflow in attempt 2, which passed in full. The passing retry establishes recovery; it does not establish the timeout's cause. - Separate operational issue: master image runs [47235737261](https://github.com/paperclipai/paperclip/actions/runs/47235737261) and [47238936675](https://github.com/paperclipai/paperclip/actions/runs/47238936675) failed their source observers because GitHub's Actions job-list API returned HTTP 502. Their architecture builds and exact-source readiness runs passed. The current master's job-list request still returns 502 with `per_page=100`. Small pages can read that image run, but a small-page source-readiness request also failed. There is no verified pagination workaround. This fixture change does not resolve that API failure or prove image publication. ## Risks - Low risk. The diff changes one notification's order in a test fixture. It adds no runtime behavior or configuration. - The original intermittent failure was observed in CI. The local baseline attempt passed. The fix removes the ordering gap identified in that failure. The full CI workflow passed for the final revision. - Documentation does not change because the runtime contract stays the same. ## Model Used - OpenAI `gpt-6.1-sol`, through the Codex harness in T3 Code, with xhigh reasoning effort and shell tools. The context window size is not exposed by the runtime. ## 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> |
||
|
|
ded4c1bf15 |
fix(server): encode Unicode asset response filenames (#22892)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - People open uploaded files and company logos from their browser. > - Two routes put the stored filename directly into an HTTP header. > - Node rejects some valid Unicode names used by screenshot tools and people. > - This change formats both filenames with the same Express API used for issue attachments. ## Linked Issues or Issue Description Fixes: #7493 Thanks to dosthcpp for the report and the earlier proposal in #7494. The issue attachment route already uses Express to format the filename. The asset content and invite logo routes still wrote it directly. Related #8716 and #9570 cover attachment display policy and ZIP downloads. ## What Changed - Format the filename with Express in the asset content and invite logo responses. Keep the current content type and inline or attachment choice. - Exercise a screenshot with a narrow non-breaking space and a logo with Japanese characters. ## Verification - On the preceding master `f1dd9288d`, both Unicode cases returned 500 before the fix. - On `3fbf872d9` with the fix, 57 tests passed across the assets, invite logo, and issue attachment suites. The new checks verify status, Unicode filename encoding, and inline disposition. - Full server typecheck, test budget, and `git diff --check` passed. PR CI is pending. ## Risks - Both routes still set the content type from storage metadata after formatting the filename. The existing disposition, range, and content policy behavior remain covered by the route tests. ## Model Used - OpenAI Codex (GPT-6 family) with terminal and Vitest access. Exact model identifier and context window were not exposed in this session. ## 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 - [ ] 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 |
||
|
|
c5f5d3163d |
test: remove recovery and Tailscale readiness races (#23678)
## Thinking Path > - Paperclip requires checks for an exact Core source commit before it publishes images. > - Cloud readiness runs the server integration tests without retries. > - Server shard 18/20 failed in recovery cleanup and Tailscale enrollment. > - The recovery test returned before its status wake reached the heartbeat drain. > - The Tailscale fixture exposed state before it was safe to read or observe. > - This pull request makes those fixtures wait for their actual completion boundaries. ## Linked Issues or Issue Description Refs #23227. Related earlier cleanup fix: #23673. **What happened?** [Docker run 47225196060](https://github.com/paperclipai/paperclip/actions/runs/47225196060) stopped after [Cloud readiness server shard 18/20](https://github.com/paperclipai/paperclip/actions/runs/47225196237/job/144677926140) failed. Staging image preparation then waited for a verified Core image. The previous Runner reattachment cleanup fix passed its protocol lane in that run. The recovery test deleted agents after a late wake inserted a child row. The Tailscale test failed its first connection. On the [next master run](https://github.com/paperclipai/paperclip/actions/runs/47227863572/job/144687185775), the Tailscale blocked-save test timed out while waiting for a callback that startup might never reach. **Expected behavior** Fixture teardown must join the status wake. The fake Tailscale CLI must publish complete state and receive each simulated consent event reliably. Tests must await enrollment completion and fail promptly when connection setup fails. **Steps to reproduce** Run the two changed test files or server shard 18/20 with retries disabled. The unmodified local files reproduced a consent callback failure. The CI links above record the foreign-key and blocked-save failures. The foreign-key failure did not reproduce in the initial local run. **Paperclip version or commit** Failures on `07150650c926d8947ae591f61e4ed854ca284149` and `ba521863f6090e40a37ed3cb6b1ecaf358a11424`. The fix starts from the latter and is rebased onto `86042310917c15eb04be121baf58a6929e52a7d2`, which adds release notes only. **Deployment mode** Source checkout in GitHub Actions. Local checks use macOS arm64, Node 25.6.1, hermetic Tailscale executables, and disposable embedded PostgreSQL. Searched open PRs and issues for the failing files, `ENOTEMPTY`, Runner cleanup, and Tailscale tests. No duplicate fix was found. Issue #23227 describes the startup-dependent expiry window and is also addressed here. ## What Changed - Wait for the accepted recovery status change to persist its wake before the existing heartbeat drain deletes fixture tables. The wake has an asynchronous route prologue that can outlive the HTTP response. - Register a signal handler in the owned fake CLI before exposing the login URL. Publish fixture state atomically, then signal that exact child to simulate consent. This removes the dependency on filesystem notification delivery. - Await the network manager's completion promise instead of a short callback polling window. - Start the expiry test with a valid window, advance the application clock after startup, and submit late consent. Keep real subprocess timers and restore the clock spy in `finally`. - Race blocked-save admission against early connection settlement so startup failures are reported instead of hanging the test. - Only two test files change. Runtime behavior, release gates, and deployment policy do not change. ## Verification - Baseline: the unmodified two-file run failed the consent callback assertion; 129 tests passed. The recovery cleanup passed locally, with its CI failure retained above. - An intermediate expiry check failed its one-second callback wait. A later parallel shard run still lost a filesystem notification. The final fixture uses an explicit consent signal and awaits manager completion. - That eight-worker shard run also timed out in unchanged workspace-trust and runtime-control fixtures while a monolithic typecheck ran concurrently. Those two unchanged files passed in a serial control with the changed fixtures: 186 tests passed across four files. The final shard is run separately with four workers and retries disabled. - `pnpm exec tsc --noEmit -p tsconfig.json` from `server/`: passed. - After the release-notes-only rebase, the Tailscale file passed again: 9 tests, retries disabled. The two fixture file contents are identical to the final shard run. - `PAPERCLIP_VITEST_RETRY=0 PAPERCLIP_VITEST_MAX_WORKERS=4 pnpm test:run:general -- --group general-server-without-chat-or-native-runner --shard-index 17 --shard-count 20`: passed on the final fixture contents. 85 files passed, 3 skipped; 1945 tests passed, 18 skipped. Duration: 160 seconds. - `node scripts/check-test-budget.mjs --files server/src/__tests__/issue-recovery-actions.test.ts server/src/services/connectors/tailscale/device-login-network.test.ts`: passed. - `git diff --check` and local secret/PII review: passed. - [Greptile review](https://github.com/paperclipai/paperclip/pull/23678#issuecomment-7396242983): 5/5 on head `13bf3586bcf3201ce137f674812e8faf778ee77d`, with a successful current-head check and no actionable findings or review threads. The [full PR CI workflow](https://github.com/paperclipai/paperclip/actions/runs/47231990509) passed on attempt 1. All 71 reported checks are clean on this head; GitHub reports `CLEAN` / `MERGEABLE` and there are no unresolved review threads. ## Risks Low risk. The change is limited to fixtures. A missing status wake or failed enrollment still fails the tests. The expiry case now checks actual late-consent rejection without making success depend on process startup time. No schema, API, or runtime changes are required. The tests and PR explain the behavior; no documentation update is needed. A new verified master image is still required before staging can resume. ## Model Used OpenAI `gpt-6.1-sol` through the Codex harness in T3 Code, with xhigh reasoning effort, shell and file tools. The harness does not expose the context window size. ## 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> |
||
|
|
c2a8821809 |
fix(agents): keep a prepared agent setup when its configuration changes (#23669)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - A new agent can use a plugin environment that requires an agent. A lifecycle plugin prepares that environment before the agent can work. > - The setup flow creates a draft agent first, so that this preparation can start before the person finishes setup. > - Each change to the draft's harness, model, or sign-in started preparation again. The hire also started it again. > - Verification cannot start until the last preparation is complete. So the early preparation did not decrease the wait after the hire. > - This pull request keeps the preparation when the agent stays on the same environment driver. > - The benefit is that a person who finishes setup waits only for verification. ## Linked Issues or Issue Description I searched the open and closed issues and pull requests. I did not find a duplicate. **What happened?** Create an agent in setup on a plugin environment that declares `requiresAgent: true`. The draft is prepared. Then choose a harness, sign in, and hire the agent. Each of these three steps starts `preparing` again. The agent page shows preparation after the hire, although the environment was ready before the person signed in. **Expected behavior** A change to the harness, model, credentials, or instructions does not change the environment. It must not start preparation again. The hire must go directly to verification. If preparation is in progress, the hire must join it. **Steps to reproduce** 1. Install a lifecycle plugin with an environment driver that declares `requiresAgent: true`. 2. Make that environment the instance default. 3. Create a setup draft and wait until `lifecycleState` is `verifying`. 4. Save a different model on the draft. `lifecycleState` goes back to `preparing`. 5. Hire the draft. `lifecycleState` goes back to `preparing` again. **Paperclip version or commit** `7e025ae65f` **Deployment mode** Self-hosted server with a plugin environment that requires an agent. ## What Changed - A configuration change restarts `preparing` only when the agent moves to an environment that needs setup. The existing environment and driver check makes this decision. - A prepared setup draft stays prepared when its harness, model, credentials, or runtime configuration change. - The hire of a prepared draft goes directly to `verifying` with a new operation. - The hire of a draft that is still `preparing` keeps the operation and its version. Verification starts when that operation is complete. - A hire that moves to an environment that needs setup starts `preparing` again, as before. - A save that changes an environment to another driver of the same plugin now also refuses `preparing` agents, the same as `ready` and `verifying` ones. - A change to instructions alone does not restart verification. The hire writes the managed instruction files immediately after it commits, and verification does not read them. - The hire clears an old lifecycle error on the draft. - These behaviors do not change: - a draft that no longer needs preparation goes to `pausing` - a hire that needs approval, a hire with a hold, and a company hold - an edit to other execution configuration during verification - an edit during `resuming` - `doc/AGENT-LIFECYCLE.md` describes the new rules. ## Verification - `npx vitest run src/modules/agent-lifecycle`: 224 passed. Four new tests cover a prepared draft, a hire from a prepared draft, a hire during preparation, and an instruction change. Three of them failed before the change. The fourth could not run because a test before it left the fixture blocked. - `npx vitest run` on the hire, lifecycle delivery, agent secret, pending approval, secret binding, managed plugin environment, and plugin task tests: all passed. - `npx vitest run` on the two Dot onboarding files: 25 passed. - `pnpm --filter @paperclipai/server typecheck`: passed. - Not done: a live test with a plugin environment. Three existing tests used an agent in `preparing` to test that a configuration change fences verification. They now use `verifying`. ## Risks - A lifecycle plugin that reads the agent's harness or model during `preparing` is not called again when they change. The lifecycle request does not carry them. Verification still tests the final configuration. - A prepared environment can be lost between preparation and hire. Verification then fails and retries, and a pause and resume prepares it again. Before this change, the hire prepared it again. - An edit during `preparing` does not cancel the attempt in progress. A plugin must not fail because the agent's configuration changed during its call. - No migration. ## 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> |
||
|
|
8604231091 |
docs(release): stable notes for the 2026.1203.0-beta.0 soak (v2026.1206.0) (#23580)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The release process promotes a soaked beta to stable. The stable GitHub Release body comes from `releases/beta/v<beta-version>.md` on `master` > - Beta `2026.1203.0-beta.0` published in workflow run 47005574134. Its `draft_stable_notes` job pushed a commit-log skeleton to this branch > - The skeleton is a raw commit list. It is not usable as release notes > - This pull request replaces the skeleton with curated stable notes. Each claim traces to a pull request in `v2026.1202.0..89c6e38` > - The benefit is that the stable promotion for this beta (v2026.1206.0) finds finished notes on `master` ## Linked Issues or Issue Description **Issue type** Missing content **Where is the issue?** `releases/beta/v2026.1203.0-beta.0.md` is the stable-notes file for the `2026.1203.0-beta.0` soak. At the branch head before this commit, it holds only the auto-generated commit-log skeleton. **What's wrong?** The stable promotion reads this file from `master` and publishes it as the GitHub Release body. A raw commit list is not suitable as a release body. **Suggested fix** Merge the curated notes. Correct the H1 and the `> Released:` line in a follow-up if the promotion date moves. ## What Changed - Replaced the skeleton in `releases/beta/v2026.1203.0-beta.0.md` with curated stable notes for v2026.1206.0. The layout is the same as the v2026.1202.0 notes: overview, Breaking Changes, Highlights, Improvements, Fixes, Upgrade Guide, Contributors - The notes are delta-framed against the published v2026.1202.0 notes. None of the 107 cited pull requests appears in those notes - The Upgrade Guide lists migrations `0500` through `0513` with one-phrase effects, the new environment variables with defaults, the experimental-setting changes, and the harness pins - Release and CI internals, smoke specs, canary tooling, Paperclip Cloud work, dependency bumps, and test-only changes are left out ## Verification - Beta publish is complete. The npm dist-tag `beta` is `2026.1203.0-beta.0`. The tag `beta/v2026.1203.0-beta.0` points at `89c6e38ad182962d6deb99f58580b822131316f2`. In run 47005574134, `publish_beta`, both `smoke_beta` jobs and `draft_stable_notes` succeeded. The beta Docker build (run 47021510703) succeeded - The GitHub compare API returns 465 commits for `v2026.1202.0...89c6e38ad182962d6deb99f58580b822131316f2`. This number matches the overview and the Contributors section - Contributors are the 24 unique GitHub logins of the commit authors in the range, read from the GitHub API with `[bot]` accounts excluded. External handles are thanked by name - Every `#NNNN` link in the file traces to a commit in the range (107 cited pull requests) - Migration numbers, setting keys, env var names, and defaults were checked in the code at the source commit, not in commit subjects - The file contains no internal ticket ids or instance-local links - The diff changes one file under `releases/` and no source files ## Risks - Low risk: a single markdown file, no source changes. If the promotion date moves past 2026-12-06, the H1 and the `> Released:` line need a one-line update before the stable dispatch - The `draft_stable_notes` job force-pushes this branch name. A rerun of that job replaces this commit with the skeleton. Do not rerun it for this beta ## Model Used - Claude (Anthropic), model ID `claude-opus-5-5` (Claude Opus 5.5), tool use via Claude Code ## 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 (documentation-only change; no tests apply) - [ ] I have added or updated tests where applicable (not 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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>canary/v2026.1204.0-canary.885200 |
||
|
|
ba521863f6 |
perf(skills): import environment skills when a setup draft is created (#23672)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - A plugin environment driver can declare `skillKeys`. Core adds those managed skills to each run on the environment. > - Before a run can use a skill, Core imports it into the company's skill library. This occurs once for each company. > - The import occurs when the first task starts. So the first task in a new company waits for it. > - Each missing skill is imported in its own transaction. Each import checks all bundled skills two times, and the transactions do not share that check. > - This pull request starts the import when a person creates a setup draft, and checks the bundled skills once. > - The benefit is that the first task starts sooner. The setup does not wait for the import. ## Linked Issues or Issue Description I searched the open and closed issues and pull requests. I did not find a duplicate. **What happened?** The first task on a plugin environment with four managed skills spent more than ten seconds in skill import. Most of this time was the check and first import of Core's bundled skills. That check ran again for each managed skill. **Expected behavior** The import must start before the first task, while the person completes setup. One import must check the bundled skills once. **Steps to reproduce** 1. Install a plugin with an environment driver that declares several `skillKeys`. 2. Make that environment the instance default. 3. Create a company, set up its first agent, and give it a task. 4. Measure the skill selection part of the first run's preparation. **Paperclip version or commit** `7e025ae65f` **Deployment mode** Self-hosted server with a plugin environment that declares managed skills. ## What Changed - When a person creates a setup draft, the server imports the environment's missing skills in the background. The response does not wait for this import. - A failed background import writes a warning. It does not change the draft. Run admission still installs the skills that are missing. - The background import is counted as active work, so an idle drain waits for it. It runs once and does not poll or retry. - An environment skill import checks the bundled skills once before it installs the missing skills. Before, each skill did this check two times in its own transaction. - `importPackageFiles` reads the library rows after its own inventory check. It no longer does the check a second time. - `doc/skills-and-teams-catalog.md` describes the new behavior. Skill selection, version pins, and the files that a run receives do not change. ## Verification - `npx vitest run src/__tests__/environment-skills.test.ts`: 7 passed. Two tests are new. They fail when I remove the single check and the background import. - `npx vitest run` on the company skill service, managed skill content, company portability, agent adapter validation, and agent lifecycle tests: all passed. - `src/__tests__/ai-connections.test.ts`: 5 of its tests failed in the same local run. The reconnect tests also fail at `7e025ae65f` without this change on the same local database. They do not use this code. - `pnpm --filter @paperclipai/server typecheck`: passed. - Not done: a measurement of the first task with this change. ## Risks - A draft that a person abandons leaves the imported skills in the company library. The same skills are imported for the next agent on that environment. - The background import and a first task can run together. The existing lock for each skill makes the second one wait and use the first result. - The bundled skill check now runs outside the skill's transaction. If the skill import then fails, the bundled skills remain imported. They are imported by other library reads too. - No migration. ## 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> |
||
|
|
07150650c9 |
test(runner): drain reattachment writers before deleting state (#23673)
## Thinking Path > - Paperclip manages agent work through durable Runner sessions. > - Release images require Cloud readiness for their exact source commit. > - A reattachment test keeps a slow event backlog active during controller recovery. > - Its bounded close can return before queued journal writes finish. > - The fixture then deletes the state directory and can fail with `ENOTEMPTY`. > - This pull request joins the fixture writers before it removes their files. ## Linked Issues or Issue Description **What happened?** [Docker run 47193580475](https://github.com/paperclipai/paperclip/actions/runs/47193580475/attempts/1) was cancelled after [Cloud readiness protocol lane 4/4](https://github.com/paperclipai/paperclip/actions/runs/47193580507/job/144565884014) failed. The event-backlog reattachment test reported `ENOTEMPTY` while removing its control-plane directory. A rerun passed on the same source commit, without fixing the race. **Expected behavior** The fixture must finish all admitted writes and stop its child before it deletes state, including when the transport close deadline expires. **Steps to reproduce** Run `runnerd-codex-transport-reattach-carried-commands.test.ts` with a one-millisecond close budget for the event-backlog case. Before this fix, the new cleanup assertion finds one accounting callback still active. **Paperclip version or commit** Observed on `23ca89e3764377224bc43527bdfa547e9608f1db`. The fix starts from `7e025ae65f9050030edf4d2cab006aa981569261`. **Deployment mode** Source checkout in GitHub Actions. Local reproduction uses macOS arm64, Node 25.6.1, and the real Rust Runner with the hermetic fake Codex fixture. Searched open PRs and issues for `ENOTEMPTY`, carried commands, and Runner teardown. No duplicate fix was found. Related earlier work: #21161 and #21442. ## What Changed - Retain all registered fixture authorities, including the detached controller. - Disable new upgrades, confirm the original child exited, stop authorities, and drain admitted connection processing before deleting state. - Exercise an expired close budget in the existing backlog case. Assert that accounting writes have finished before deletion. - The fixture owns this cleanup. Runtime close behavior and its deadlines do not change. ## Verification - Red: the focused backlog test fails with `state cleanup must wait for admitted event writes: expected 1 to be +0` before the teardown fix. - Green: `pnpm exec vitest run src/live/runnerd-codex-transport-reattach-carried-commands.test.ts` from the Runner package: 11 passed, retries disabled. - `pnpm exec tsc -p tsconfig.test.json --noEmit` from the Runner package: passed. - `git diff --check` and local secret/PII diff review: passed. - `pnpm verify --explain`: exit 2. The conservative selector cannot resolve this Runner test graph. Focused local checks passed; required PR CI supplies the broader coverage. - Tested file contents match PR head `0a6b92e026ae0fdd684cd0e8e2ff7cf513732a02`. - Final review: all 90 checks are clean, GitHub reports `CLEAN` / `MERGEABLE`, and there are no unresolved review threads. The branch includes current `master`. - An initial local attempt could not run because debug binaries were not built yet. Agent preflight completed before the red-green run. - [Linux Runner Vitest lanes 1–6](https://github.com/paperclipai/paperclip/actions/runs/47222552156): passed on PR head. Typecheck, build, Runner static checks, and support suites also passed. - [Greptile review](https://github.com/paperclipai/paperclip/pull/23673#issuecomment-7394943956): 5/5 on PR head, no actionable findings or review threads. The current-head check passed. - [Server shard 14/20](https://github.com/paperclipai/paperclip/actions/runs/47222552156/job/144668670033) was cancelled after its runner received a shutdown signal. This is recorded runner loss, not an assertion failure. The repository started attempt 2 automatically on the same PR head. The retry passed and the full [PR CI workflow](https://github.com/paperclipai/paperclip/actions/runs/47222552156/attempts/2) completed successfully. Both Runner image builds, the macOS runtime build, and all security scans also passed. ## Risks Low risk. Only one test fixture changes. Teardown now waits for its admitted writes instead of deleting their directory early. A stuck write can fail the existing test timeout and preserve the state directory. No schema, API, deployment, or runtime behavior changes. The code and regression test describe the behavior; no documentation update is needed. ## Model Used OpenAI `gpt-6.1-sol` through the Codex harness in T3 Code, with xhigh reasoning effort, shell and file tools. The harness does not expose the context window size. ## 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> |
||
|
|
7e025ae65f |
fix(workspaces): start a new remote workspace when the task's saved one is retired (#23655)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - Before a run starts, Paperclip prepares the task's execution
workspace. With remote workspace storage, it reserves the task's saved
remote workspace.
> - A task stays bound to its workspace after that workspace is archived
or its cleanup fails.
> - For a retired host workspace, the next run already creates a new
workspace. For a retired remote workspace, preparation sent the retired
workspace to the reservation. The reservation refused it with "Workspace
ownership changed." (`remote_workspace_retired`, since #23582).
> - So the task could never run again. Each wake, recovery, or Retry
failed in setup with the same conflict.
> - This pull request makes a retired remote workspace act like a
retired host workspace: the run starts a new remote workspace.
> - The benefit is that a reopened task with an archived remote
workspace runs again, and the retired workspace and its saved snapshot
stay unchanged.
## Linked Issues or Issue Description
**What happened**
A task's own remote workspace was archived by hand (no terminal-cleanup
reason) and later moved to remote storage. When the task was opened
again, every run failed in setup with "Workspace ownership changed." The
task was then escalated for recovery, and the next wake failed in the
same way.
**Expected behavior**
A retired workspace is not reused. The run starts a new workspace for
the task, as it does for a host workspace. A native recovery or a saved
Retry that is bound to the retired workspace still stops with the
conflict.
**Steps to reproduce**
1. Bind a task to its own remote-storage workspace. Set the workspace
status to `archived` or `cleanup_failed`.
2. Start a run for the task with a Paperclip Runner agent in a sandbox
environment.
3. Setup fails with a 409 conflict, "Workspace ownership changed."
(`remote_workspace_retired`).
**Paperclip version or commit**
master at
canary/v2026.1203.0-canary.884900
|
||
|
|
1fb8ddb740 |
feat(trust): allow transient workspace_prepare checkout for low-trust in-boundary projects (#23656)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The low-trust review preset isolates untrusted review agents inside sandboxes with no runtime GitHub tokens and no sandbox network access > - When a low-trust agent is explicitly assigned to a private-repository project with `git.read` enabled, workspace preparation routed the setup-time clone through `resolveGitHubOperationCredentials`, which blocks all low-trust credential export and caused `stage=clone git=auth_failed exit=128` before the agent could start > - Setup-time `prepareRemoteWorkspaceDirectory` runs on the trusted controller path before the agent starts, uses transient `GIT_CONFIG_*` / `PAPERCLIP_GIT_TOKEN` environment variables with `-c core.hooksPath=/dev/null`, and writes zero credentials into `.git/config` > - This pull request adds `resolveGitHubWorkspacePrepareCredentials` for controller-only `workspace_prepare` call sites, allowing transient clone credentials strictly for a repository configured on a project inside `trustBoundary.projectIds` when `git.read` is permitted (preferring an agent-installed GitHub PAT connection when present), while keeping runtime shell credentials (`resolveGitHubOperationCredentials`) strictly denied > - The benefit is that assigning a low-trust agent to a private-repo project works out of the box for local read-only code review without exposing any live GitHub token to the agent runtime ## Linked Issues or Issue Description **What happened?** When an agent configured with `trustPreset: "low_trust_review"` and `allowedToolClasses: ["git.read"]` was assigned a task in a project with a private GitHub repository workspace, workspace preparation failed before the agent started with `remote_workspace_prepare_failed: stage=clone git=auth_failed exit=128 program=git`. **Expected behavior** When a `low_trust_review` run has `git.read` enabled and targets a project explicitly listed in `trustBoundary.projectIds`, the trusted controller should clone that project's configured repository during `workspace_prepare` using transient credentials (preferring an agent-installed GitHub PAT connection if configured, otherwise the run's managed GitHub identity), while leaving zero credentials in `.git/config` and keeping runtime GitHub credential export strictly denied. **Steps to reproduce** 1. Create a project with a private GitHub repository workspace. 2. Configure an agent with `trustPreset: "low_trust_review"`, `projectIds: [projectId]`, and `allowedToolClasses: ["git.read"]`. 3. Run a task in that project on a cloud sandbox environment. 4. Before this fix, `createGitRemoteAuthProvider` falls back to anonymous clone and fails at `stage=clone git=auth_failed exit=128`. **Paperclip version or commit** `master` (`23ca89e376`) ## What Changed - **`server/src/services/github-operation-credentials.ts`**: Added `resolveGitHubWorkspacePrepareCredentials`, `allowsLowTrustWorkspacePrepareCheckout`, and `resolveAgentInstalledGitHubPat`. For `low_trust_review` runs, transient prepare-time clone auth is permitted only when `trust.kind === "low_trust_review"`, `git.read` is in `allowedToolClasses`, the task's project is explicitly in `trustBoundary.projectIds`, and `remoteUrl` matches a configured `project_workspaces.repo_url` on that project. Prefers an active agent-installed GitHub `api_key` (PAT) connection when present and otherwise falls back to `resolveManagedGitHubCredential`. Runtime `resolveGitHubOperationCredentials` remains unchanged and strictly denied for low-trust runs. - **`server/src/services/git-credentials.ts`**: Added optional `purpose?: "workspace_prepare"` to `createGitRemoteAuthProvider` so only controller workspace-preparation call sites invoke `resolveGitHubWorkspacePrepareCredentials`. - **`server/src/services/heartbeat/workspace-preparation.ts`** and **`server/src/services/heartbeat/workspaces.ts`**: Passed `purpose: "workspace_prepare"` at the four controller workspace-preparation call sites. - **`server/src/__tests__/github-operation-credentials.test.ts`**: Added unit, security-boundary, and end-to-end `prepareRemoteWorkspaceDirectory` tests covering managed identity prepare checkout, agent-installed GitHub PAT preference, runtime credential denial, unrelated repo denial, missing `git.read` denial, and zero credentials persisted in `.git/config`. ## Verification - `pnpm --filter @paperclipai/server typecheck` — passed with 0 errors. - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/github-operation-credentials.test.ts` — 30/30 passed (including the 3 new low-trust `workspace_prepare` and local E2E `prepareRemoteWorkspaceDirectory` tests). ## Risks - Low risk. Runtime agent credential endpoints (`/runtime-tools/github/credentials`, native GitHub broker, skill-source fetch) continue calling `resolveGitHubOperationCredentials` and stay strictly denied for `low_trust_review`. - Prepare-time credentials are scoped strictly to repositories already configured in `project_workspaces` for a project explicitly inside `trustBoundary.projectIds` and only when `git.read` is enabled. ## Model Used - Google Gemini (Antigravity agentic coding assistant) with tool use and local code/test 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 - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting mergecanary/v2026.1203.0-canary.884800 |
||
|
|
23ca89e376 |
Link agent names in the chat sidebar to their overviews (#23650)
## Thinking Path > - Paperclip lets people manage agents. > - The chat sidebar lists agents with conversations. > - Each row opens a conversation. > - The agent name gives readers a natural place to open the agent overview. > - Separate links let users choose either destination with a mouse or keyboard. ## Linked Issues or Issue Description **Subsystem affected** Chat sidebar navigation. **Current behavior** Selecting an agent name opens the conversation. **Proposed behavior** Selecting the name opens that agent's overview. Selecting the avatar or role opens the chat. ## What Changed Added a company-scoped overview link on the name and kept a separate chat link across the row. ## Verification The sidebar compiled with esbuild. The diff whitespace check passed. To verify in the app, click the name, return to the list, then click the role. Check both links with Tab and Enter. ## Risks Users who previously clicked the name to open chat will now reach the overview. ## Model Used OpenAI Codex, GPT-6, with shell tools. ## Checklist - [ ] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [ ] I have searched GitHub for duplicate or related PRs and linked them above - [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [ ] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] 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 - [ ] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [ ] 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 - [ ] I will address all Greptile and reviewer comments before requesting mergecanary/v2026.1203.0-canary.884701 |
||
|
|
0208bbfbf7 |
fix(runner): compact Antigravity MCP tool descriptions and nullable/pattern schemas (#23645)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Paperclip Runner exposes Paperclip semantic tools and lifecycle tools (`paperclip_finish`, `paperclip_block`) to the Antigravity CLI (`agy` 1.5.19) over a loopback MCP bridge. > - Follow-up to #23620: real-binary reproduction with `agy` 1.5.19 against a full server catalog (85-91 tools including `runner-bridge-tools`) shows that `agy` budgets full `functionDeclarations` (name + description + inputSchema) at roughly 90 KB serialized (~60 KB raw MCP JSON). > - With only `inputSchema` metadata stripped, uncompacted multi-sentence tool `description` fields still consume ~26 KB and `pattern`/`format`/nullable unions add ~7 KB, pushing 91 tools to 65.5 KB raw and causing `agy` to drop `handoff_case` and `paperclip_finish` (and `set_task_monitor` / `call_api` when additional tools are present). > - This pull request compacts top-level tool descriptions (first sentence / 120 chars), strips `format` and `pattern`, and collapses nullable `anyOf`/`oneOf`/`type` unions in `tools/list` when `compactToolSchemas` is enabled for Antigravity, while keeping full original Ajv validation on `tools/call`. > - The benefit is that all 110/110 tools (including `paperclip_finish`, `paperclip_block`, `set_task_monitor`, `call_api`, and `handoff_case`) fit comfortably within `agy` 1.5.19's declaration budget. ## Linked Issues or Issue Description - Refs #23620 ## What Changed - `packages/paperclip-runner/src/drivers/re2-schema-patterns.ts`: - Added `compactToolDescription(description, maxLength = 120)` to trim top-level MCP tool descriptions to their first sentence (or <= 120 chars). - Extended `compactToolInputSchema` to drop `format` and `pattern` keywords and collapse nullable `anyOf`/`oneOf` (`[T, { type: "null" }]` -> `T`) and `type: [T, "null"]` -> `T`, while preserving property names, literal `enum`/`const` values, types, and `required` lists. - `packages/paperclip-runner/src/drivers/runner-tool-bridge.ts`: - Applied `compactToolDescription` alongside `compactToolInputSchema` to all `tools/list` entries (including `paperclip_finish` and `paperclip_block`) when `compactToolSchemas: true`. - Original full Ajv validators remain untouched for `tools/call`. - `packages/paperclip-runner/src/drivers/re2-schema-patterns.test.ts`: - Tightened the catalog budget regression test (`totalSchemaBytes < 25_000`, `totalDeclarationBytes < 35_000`, every description <= 120 chars, `paperclip_finish` / `paperclip_block` < 3,000 bytes). - Added regression assertions that `tools/call` still enforces stripped `pattern` rules (`read_document` rejecting `"notes.md"`), `re2PortableSchema` rewrites patterns inside properties named `enum`/`const`, and `compactToolDescription` / nullable union collapsing work as expected. ## Verification - `pnpm --dir packages/paperclip-runner exec vitest run src/drivers/re2-schema-patterns.test.ts src/drivers/runner-tool-bridge.test.ts src/drivers/acpx/antigravity-acp-runtime.test.ts` — 59/59 tests pass. - `pnpm --dir packages/paperclip-runner exec tsc -p tsconfig.json --noEmit` — passes. - `pnpm --dir packages/paperclip-runner exec tsc -p tsconfig.test.json --noEmit` — passes. - Real pinned `agy` 1.5.19 binary probe against a local mock Gemini API with 110 tools (full 64 semantic action catalog + server `runnerBridgeDefinitions` + 31 realistic extra tools + `paperclip_finish` + `paperclip_block`): **110/110 tools kept** (`keptDeclBytes: 85,286`; `paperclip_finish`, `paperclip_block`, `set_task_monitor`, `call_api`, and `handoff_case` all present). ## Risks - Low risk. Compaction applies only to `tools/list` when `compactToolSchemas: true` (Antigravity sessions only). All `tools/call` requests continue to validate against the original full Ajv schema and return plain-English schema rule diagnostics on rejection. ## Model Used - Google Gemini (Antigravity agent with tool use, shell execution, and real `agy` 1.5.19 binary verification). ## 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 mergecanary/v2026.1203.0-canary.884600 |
||
|
|
230fc431ba |
fix(runner): queue a startup that timed out again instead of blocking its task (#23636)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - A run in a sandbox must start its Runner before a deadline > - A startup that passes the deadline is cancelled, and its sandbox task is stopped > - The cancelled run then has no successor, so the server blocks the task > - The answers and messages that wait behind the run stay held until a person acts > - The agent did no work, so nothing needs a person > - This pull request queues the same wake again when the evidence shows that no work started > - The benefit is that a slow startup delays a task but does not block it ## Linked Issues or Issue Description No issue exists. **What happened?** A user answered an agent's question. The new run passed its startup deadline. The server stopped the sandbox task and confirmed the stop. The server then set the task to blocked, and the answer was not delivered. **Expected behavior** The server starts the run again with the same answer. It continues the saved session if that is safe. **Steps to reproduce** 1. Use an agent whose environment provider runs Runner tasks. 2. Start a run on a task. 3. Make the startup pass its deadline before the Runner connects. 4. Wait for the server to confirm the stop. 5. See that the task is blocked and that a new message stays held. **Paperclip version or commit** `dc16c47362` **Deployment mode** Self-hosted server with a sandbox environment plugin. ## What Changed - The server queues the same wake again after it confirms the stop of a startup that timed out. The new run keeps the wake reason, the comments and the answer. - The server does this only with all of this evidence: - The startup deadline is the only cause of the cancellation. - The provider confirmed that the task stopped. - No process request, session, turn, Runner checkpoint or result exists. - No workspace recovery or file copy is open. - The new run uses the existing retry limits for an interrupted preparation. - The server queues the new run before it acknowledges the cleanup. The new run cannot start until the cleanup is acknowledged. Held messages stay in order behind it. - The new run continues the saved session when the stopped task still holds the session state of an earlier run. Otherwise, it starts a new session. - If the server stops between these steps, the next cleanup pass completes them. It queues one run only. - If any evidence is missing, or the server cannot queue the run, the task is blocked as before. - A Stop by a person, a pause, a budget or a reassignment does not change. ## Verification - `npx vitest run src/services/native-runtime/native-startup-requeue.test.ts`: 46 passed. These tests use embedded Postgres. They test the full cancellation, the two server-stop points, 24 refusals, the session state transfer, and which run the next run resumes. - `npx vitest run` on the 14 test files that use the changed modules: 2146 passed, 7 skipped, 1 failed. The failed test is `archives a damaged prior epoch before completing guarded same-task replacement with real runnerd`. It also fails at `dc16c47362` on the same computer, without this change. - `npx vitest run` on the retry scheduling and early Stop tests: 79 passed. - `npx tsc --noEmit` in `server` has no errors. - Not done: a live test of this change. CI runs the Runner integration suites. ## Risks - A wrong decision could run work twice. The server refuses when any saved record shows provider work, and the resume path checks the same records again. - A startup that always times out now retries. The existing limit and backoff apply. After the last retry, the task is blocked as before. - The new run uses another sandbox start. Budget checks and retry counts apply to it as to other retries. - A task that is already blocked by this problem does not change. A person must retry it or send a message. - No migration. ## 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>canary/v2026.1203.0-canary.884500 |
||
|
|
bba20403ba |
fix(cloud-trial): do not attach Connect OpenRouter repair card on starter-trial auth failures (#23633)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - When a normal agent fails with a provider authentication error, `connectionIntentService.requestForRunAuthFailure` infers the AI provider from the agent's model and attaches a pending `"Connect <Provider>"` interaction card on the issue thread. > - Cloud starter-inference agents (`runtimeConfig.cloudTrialInference: true`, no saved `aiConnection`) run OpenCode with `openrouter/openai/gpt-6-luna` through Paperclip Cloud's server-side proxy instead of a user-saved OpenRouter connection. > - If a starter-inference run ever encounters an OpenRouter 401 failure, `requestForRunAuthFailure` attached a pending `"Connect OpenRouter"` card, causing the agent to keep nagging the user to respond to that card on subsequent turns even after succeeding. > - This pull request skips `requestForRunAuthFailure` for agents using Cloud starter inference without a saved `aiConnection`, leaving `CloudTrialGate` as the single owner of prompting users to connect a model provider. > - The benefit is that starter-inference chats never accumulate stale `"Connect OpenRouter"` cards. ## Linked Issues or Issue Description Refs #23401, #23616 **Summary** Skip creating a `"Connect OpenRouter"` `connection_intent` card in `requestForRunAuthFailure` when the agent runs on Cloud starter inference (`runtimeConfig.cloudTrialInference: true` without a saved `aiConnection`). **Steps to Reproduce** 1. Run an OpenCode agent configured with `runtimeConfig.cloudTrialInference: true` and `adapterConfig.model: "openrouter/openai/gpt-6-luna"` (no `runtimeConfig.aiConnection`). 2. Trigger an OpenRouter HTTP 401 authentication failure on a run. 3. Observe `requestForRunAuthFailure` creating a pending `"Connect OpenRouter"` `issue_thread_interactions` row on the chat issue. **Expected Behavior** `requestForRunAuthFailure` returns `null` and creates no pending `"Connect OpenRouter"` interaction for Cloud starter-inference agents. ## What Changed - `server/src/services/connection-intents.ts`: Returned `null` in `requestForRunAuthFailure` when `!saved && !router && isAgentUsingCloudTrialInference(agent.runtimeConfig)`. - `server/src/__tests__/connection-intents-service.test.ts`: Added a regression test proving that an OpenRouter 401 failure on a Cloud starter-trial agent returns `null` and creates zero `issue_thread_interactions` rows. ## Verification - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/connection-intents-service.test.ts -t "does not create a Connect OpenRouter card|adopts a Copilot account"` — passed (2/2 tests). - `pnpm --filter @paperclipai/server typecheck` — passed (0 errors). ## Risks - Low risk. Narrow 1-line guard scoped strictly to agents with `runtimeConfig.cloudTrialInference === true` and no saved `aiConnection`. Normal agents with or without saved AI connections keep their exact existing auth-repair behavior. ## Model Used - Google Gemini (Antigravity agentic runtime, thinking mode with tool use and local 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 - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting mergecanary/v2026.1203.0-canary.884400 |
||
|
|
63d3354be7 |
fix(runner): keep the session of a stopped run (#23543)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The conversation an agent has on a task is called a session. Each task saves a pointer to its session (the session link), and the next run uses it to continue the conversation > - A run's own record keeps its session id. The task gets its pointer to that session only when the run's result is accepted > - A stopped run has no accepted result, so it saves no pointer. If a task's first run is stopped, the task has no pointer. The next run starts a new session and the agent has forgotten the first run > - A later run can also start a new session, for example after an assignment, a retry or a configuration change. If that run is stopped, the pointer still names the older session. The next message goes back to the older session or starts another one > - Saving the pointer on every stop would be unsafe. The agent's turn might still be open, a request might still be waiting, or the provider might not have kept the session > - This pull request copies the session id from a stopped run to the task only when the records show that the stop was acknowledged, the turn started and then ended with nothing waiting, the provider kept the session, and no newer run has taken over the task. Otherwise, the pointer does not change > - The benefit is that someone can stop a run, send a correction, and continue the same conversation ## Linked Issues or Issue Description No issue exists. **What happened?** A user stopped the first run of a task. The user then sent a message. The agent started a new session and did not remember the first run. The same loss happens when a user stops a later run that started a new session. **Expected behavior** The agent continues the session of the stopped run. **Steps to reproduce** 1. Use an agent whose environment provider runs Runner tasks and keeps their session state. 2. Create a task and wait for the first run to start a turn. 3. Stop the run during the turn. 4. Send a message on the task. 5. See that the new run has a new session. **Paperclip version or commit** `4db307d53c` **Deployment mode** Self-hosted server with a sandbox environment plugin. ## What Changed - A stopped run now links its session after its environment lease is released. - The link needs all of this evidence: - The Stop was delivered and acknowledged. - The provider accepted a turn. The next prompt leaves out messages that the linked run received, so a run whose turn did not start cannot be linked. - The turn ended. No request, background work or goal is waiting. - The controller journal is settled. - The provider reports that the task stopped and that it kept the session state. - No newer run, reset or conversation owns the task. - An existing link is replaced only if its run belongs to the same task and agent and finished before the stopped run started. Accepted results already use this rule. Both paths now share one function. - If any evidence is missing, the link does not change, as before. - If the provider later confirms that the kept state is gone, the next run starts a new session. The acknowledged Stop replaces the committed result in that proof. All other checks in that proof still apply. ## Verification - `npx vitest run` on the publication tests for stopped runs, the publication tests for accepted results, the runtime execution tests and the terminal state reader test: 121 passed. The executor tests ran on an earlier commit, and the executor code has not changed since. - The publication tests use embedded Postgres. They test six saves and 37 refusals. Each refusal checks that the task session row did not change. - The executor tests check that a stopped run retires after a confirmed state loss. They also check that an unacknowledged Stop and a different failure stay refused. - `npx tsc --noEmit` in `server` has no errors. - Saved evidence from two real first-run stops during a turn shows ended turns with no request waiting. The first has a released lease with kept session state. The second failed its lease cleanup, so this change still refuses it. - Saved evidence from two real later-run stops: one kept its session, and the next run resumed it. The other kept no session and had no settled turn, and the next run failed. This change refuses to link the second. - Two of 104 real stops with a cancelled terminal had no accepted turn. The turn check refuses them. - Not done: a live test of this change. CI runs the Runner integration suites. ## Risks - A wrong link could resume an unsafe session. The link uses the same evidence that the resume path checks again, so the resume path still refuses an unsettled session. - A link that turns out to be unusable now replaces an older link instead of no link. The next run then usually fails, and the run after it usually starts a new session, as it does for an unusable link from a finished run. - The change applies only to providers that run Runner tasks and report kept session state. Local Runners and other sandboxes have no equal evidence, so they keep the previous behavior. - A stop while the agent waits for background work is not covered. The Runner holds its terminal event in that state, so the evidence is missing. - The saved link keeps that run's Runner checkpoint, as any other link does. - No migration. ## 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> |
||
|
|
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> |
||
|
|
0134081be8 |
fix(native): resume a saved session whatever the task status (#23533)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - A native agent keeps a warm session between the turns of a task
> - After the warm session leaves memory, the server recovers it from
saved state
> - That recovery required the task status to be `in_progress`
> - Some runs start on a task that is not `in_progress`, by design
> - Those runs lost their session, although the saved session was intact
> - Run dispatch already decides which tasks a run may start on
> - This pull request removes the status check from recovery
> - The benefit is that a comment on a task in review continues the same
conversation
## Linked Issues or Issue Description
Refs #16451 (added this recovery), #21001 (separated the two kinds of
refusal).
**What happened?**
A task was in review. The warm session was no longer in memory. A
comment started a run. The run failed with `native_session_interrupted`
and `warm_recovery_refused=current_run_not_admitted`. The task then
continued in a fresh session.
A comment soon after the previous run did resume the session. That path
uses the session in memory and does not read the task status.
**Expected behavior**
The run must resume the saved session. Automatic checkout leaves a task
in review on purpose. The agent skill tells the agent to check out the
task after it reads the comment. The agent cannot do that before its
session resumes.
**Steps to reproduce**
1. Run a task on a remote environment with a warm session.
2. Let the agent move the task to review.
3. Wait until the warm session leaves memory.
4. Add a comment to the task.
I saw this failure once on a live task. An API call had set that task to
review. The new test shows the cause. I did not repeat steps 1 to 4 on a
task that an agent moved to review.
**Paperclip version or commit**
The check is on `master` at
|
||
|
|
477323e4e8 |
fix(evals): attribute native saved-skill library reads (#23611)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - Product E2E tests check that agents use saved skills and save the
correct result.
> - The saved-skill test binds a native source read to an exact skill
version and run.
> - The native library tool can return the complete source through
`paperclip_load_skill`.
> - The test did not recognize this tool result, so it rejected a
successful read.
> - This pull request adds a closed check for that result and preserves
the independent output checks.
## Linked Issues or Issue Description
**What happened?**
The saved-skill journey rejected a successful native OpenCode library
read. Its receipt list was empty. The proxy reports `operation: unknown`
and `readOnly: false` for this tool. Retained event payloads can also
omit null targets.
**Expected behavior**
A complete source read must qualify when the saved skill, immutable
version, source bytes, admitted assignment and native call all agree.
Failed, partial, copied or foreign results must fail.
**Steps to reproduce**
Run the new library-loader test against the old parser. The valid
start/progress/completion case returns no receipt. The test expects one
receipt. The new retained-event case also fails before support for
omitted null targets.
Related public repairs: #22813 fixes assigned-skill name resolution.
[Cloud #1135](https://github.com/paperclipai/paperclip-cloud/pull/1135)
reports ordinary saved-skill assignment. Neither adds this evidence
path.
## What Changed
- Carry the saved skill ID with the selected key and version.
- Accept the native OpenCode library result only with matching IDs, key,
version, full source, SHA-256, byte count and complete single-file
inventory.
- Require the actual run, runner, native session, turn, item and one
ordered start/completion pair. Allow progress events between them. Allow
absent or null targets. Reject a supplied path.
- Share native run admission across the library, OpenCode loader and
Codex paths. Share the two OpenCode loaders' ordered call checks.
- Preserve literal numeric prefixes in verified source text. Remove
display line numbers only from file-reader output.
- Add negative cases and full-flow cases for the source read and
independent output checks. Document the accepted evidence.
## Verification
- Red: the valid library read returned an empty receipt list against the
old parser.
- Red: the retained event shape with omitted null targets failed before
that case was supported.
- Red: six new library and assigned-source cases with literal `1: `,
`2|` and `3→` prefixes fail before the review fix. Native and provider
skill-loader cases also cover these prefixes.
- Green: five focused saved-skill test files pass, with 279 tests.
- Replay of retained private events: the old receipt list is empty; the
fixed parser returns one receipt for the original completed event.
Private data stays out of this PR.
- `pnpm test:e2e:runner:typecheck` passed for the final files. The test
fixture uses mutable row types for its negative cases.
- `pnpm verify` could not select tests because the managed Git storage
guard rejected `git ls-files`. The focused tests ran directly.
- [Required
CI](https://github.com/paperclipai/paperclip/actions/runs/47113067897)
passes on
|
||
|
|
5f7670739d |
fix(runner): compact Antigravity MCP tool schemas so lifecycle tools stay within agy budget (#23620)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The Paperclip Runner exposes Paperclip's semantic tools (`paperclip_finish`, `paperclip_block`, `set_task_monitor`, `report_progress`, `call_api`, etc.) to Google Antigravity (`agy` 1.5.19) over a loopback HTTP MCP bridge (`startRunnerToolBridge`) > - `agy` 1.5.19 packs MCP `functionDeclarations` smallest-first under a ~40 KB total schema budget and silently drops tools that exceed it instead of making them lazy-loaded > - Because the full Paperclip semantic action catalog plus reserved lifecycle tools exceeds 61 KB of JSON Schema, `agy` 1.5.19 evicted the largest tools first — starting with `paperclip_finish` (5.6 KB) and `paperclip_block` (5.0 KB), and on larger catalogs also `call_api`, `report_progress`, and `set_task_monitor` — causing ordinary Antigravity runs to finish work without being able to finalize and fail with `native_finalization_missing` > - This pull request adds `compactToolInputSchema()` and a `compactToolSchemas` option on `startRunnerToolBridge` (enabled for Antigravity in `AcpxRuntimeHost`) to strip verbose schema-level metadata from `tools/list` while keeping full original Ajv validation on every `tools/call` > - The benefit is that total schema size drops by more than half (~61 KB to ~28 KB), so all Paperclip MCP lifecycle tools stay declared in `agy` 1.5.19 with full server-side validation intact ## Linked Issues or Issue Description Refs #23168, #23536 **What happened?** Ordinary Google Antigravity runs on `agy` 1.5.19 started cleanly and executed shell/read tools (`get_task_context`, `get_identity`, `run_command`), but could not call `paperclip_finish`, `paperclip_block`, `set_task_monitor`, `report_progress`, or `call_api` because `agy` 1.5.19 silently evicted the largest MCP tool schemas from `functionDeclarations` once the server's total schema size exceeded its ~40 KB budget. Runs then ended with `native_finalization_missing: session returned no semantic result`. **Expected behavior** All Paperclip MCP lifecycle tools (`paperclip_finish`, `paperclip_block`, `set_task_monitor`, `report_progress`, `call_api`, `create_task`, etc.) remain declared in `agy` 1.5.19 `functionDeclarations` even when the full semantic action catalog and assigned tools are served, while `tools/call` continues enforcing every original JSON Schema constraint. **Steps to reproduce** 1. Start `startRunnerToolBridge` with `PAPERCLIP_SEMANTIC_ACTION_CATALOG` (`schemaPatternDialect: "re2"` without `compactToolSchemas`). 2. Connect `agy` 1.5.19 `acp` to the bridge via `session/new` `mcpServers` and inspect the outgoing `functionDeclarations` on `session/prompt`. 3. Observe `agy` 1.5.19 keeps only 60 of 66 tools and silently drops the 6 largest (`paperclip_finish`, `paperclip_block`, `handoff_case`, `create_task`, `create_case`, `create_responsibility`). **Paperclip version or commit** `master` (after #23168 / #23536) **Deployment mode** Self-hosted server ## What Changed - Add `compactToolInputSchema()` in `packages/paperclip-runner/src/drivers/re2-schema-patterns.ts` to strip schema-level metadata (`description`, `title`, `$schema`, `$id`, `examples`, `default`, `minLength`, `maxLength`, `minItems`, `maxItems`, `minimum`, `maximum`, and `additionalProperties: false`) while preserving all property keys inside `properties` / `patternProperties` / `$defs` / `definitions` (including properties named `description` or `title`), types, enums, and `required` lists. - Add `compactToolSchemas?: boolean` to `RunnerToolBridgeOptions` in `packages/paperclip-runner/src/drivers/runner-tool-bridge.ts`, applied only to `tools/list` output after compiling the full original Ajv validators. - Enable `compactToolSchemas: true` for `options.agent === "antigravity"` in `packages/paperclip-runner/src/drivers/acpx/runtime-host.ts`. - Add red-green regression tests in `packages/paperclip-runner/src/drivers/re2-schema-patterns.test.ts` and `packages/paperclip-runner/src/drivers/acpx/antigravity-acp-runtime.test.ts`. ## Verification - **Red (before fix)**: New regression test in `re2-schema-patterns.test.ts` failed with `expected 61366 to be less than 35000`; real `agy` 1.5.19 binary probe dropped `paperclip_finish`, `paperclip_block`, `handoff_case`, `create_task`, `create_case`, and `create_responsibility` (60/66 kept). - **Green (after fix)**: - `pnpm --dir packages/paperclip-runner exec vitest run src/drivers/re2-schema-patterns.test.ts src/drivers/runner-tool-bridge.test.ts src/drivers/acpx/antigravity-acp-runtime.test.ts` — **3 files, 58 tests passed** - `pnpm --dir packages/paperclip-runner exec tsc -p tsconfig.json --noEmit && pnpm --dir packages/paperclip-runner exec tsc -p tsconfig.test.json --noEmit` — **passed** - Real `agy` 1.5.19 binary probe with 80 tools (`PAPERCLIP_SEMANTIC_ACTION_CATALOG` + 14 extra tools + `paperclip_finish` + `paperclip_block`): **80/80 tools kept** in `functionDeclarations` (including `paperclip_finish`, `paperclip_block`, `set_task_monitor`, `report_progress`, `call_api`, `create_task`). ## Risks - Low risk. Scoped strictly to `options.agent === "antigravity"` (`compactToolSchemas: true`), and every `tools/call` invocation is still validated against the original uncompacted Ajv schema with plain-language error messages (`toolInputError`). ## Model Used - Google Gemini 4 Neon (Medium) via Antigravity agent with tool use and local 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 - [ ] 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 --------- Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
8e2381a1d1 |
fix(cloud-trial): use stable HMAC-signed proxy tokens across warm OpenCode sessions (#23616)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Cloud starter-inference OpenCode runs in remote Daytona sandboxes reuse warm OpenCode sessions across consecutive chat turns. > - Inside the warm sandbox, `startOpenCodeProviderProxy` stays alive bound to the first run's `PAPERCLIP_OPENROUTER_PROXY_TOKEN`. > - Because `cloud-trial-proxy.ts` generated a random per-run token and deleted it in `cleanup()`, every reused-session turn failed on attempt #1 with HTTP 401 (`Trial proxy token is no longer active on this server instance`) and posted `"The OpenCode run failed before it completed."` into the chat before auto-retry recovered. > - This pull request replaces single-run random tokens with deterministic HMAC-SHA256 signed per-`(companyId, agentId, allowedModel)` tokens (`pctrial_v1.<payload>.<sig>`) that remain valid across warm turns and stack restarts/sleep-wake, while still failing closed on tampering, `work_requires_model`, `$1` exhaustion, disallowed models, and provider migration. > - The benefit is zero spurious 401 failure messages on consecutive chat turns in warm starter-inference sessions. ## Linked Issues or Issue Description Refs #23401, #23559, #23571 **Summary** Use stable HMAC-signed proxy tokens for Cloud starter-inference OpenCode sessions so reused warm sessions succeed on attempt #1. **Steps to Reproduce** 1. Start a Cloud starter-inference (`free_inference_1`) chat with an OpenCode agent in a warm Daytona sandbox. 2. Send a first message and wait for the reply. 3. Send a second message in the same chat (`sessionReused: true`). 4. Observe HTTP 401 (`Trial proxy token is no longer active on this server instance`) and `"The OpenCode run failed before it completed."` before auto-retry starts a fresh process. **Expected Behavior** Consecutive messages on a reused warm OpenCode session authenticate cleanly on attempt #1 with zero 401 failures, while tokens still fail closed on tampering, `work_requires_model`, `$1` exhaustion, disallowed models, or migration to a user provider. ## What Changed - `server/src/services/cloud-trial-proxy.ts`: Replaced single-run random `pctrial_` tokens with deterministic HMAC-SHA256 signed `pctrial_v1.<payload>.<sig>` tokens derived from the stack's stable secret (`PAPERCLIP_CLOUD_CONNECTOR_SIGN_PRIVATE_KEY` / `PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN` / `PAPERCLIP_AGENT_JWT_SECRET` / `BETTER_AUTH_SECRET`, with a per-process random fallback). Kept `cleanup()` probing OpenRouter usage without deleting the token on normal run exit, and added `revokeCompanyTokens(companyId)`. - `server/src/services/cloud-trial-inference.ts`: Called `proxy.revokeCompanyTokens(companyId)` upon `migrateTrialAgents` completion and exposed `revokeCompanyTokens`. - `server/src/__tests__/cloud-trial-inference.test.ts`: Added regression test verifying warm session token reuse after `cleanup()`, survival across a fresh controller restart, HTTP 401 on tampered tokens, and HTTP 401 after `revokeCompanyTokens`. ## Verification - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/cloud-trial-inference.test.ts src/__tests__/cloud-trial-proxy-middleware-order.test.ts` — passed (8/8 tests). - `pnpm --filter @paperclipai/server typecheck` — passed (0 errors). ## Risks - Low risk. Tokens are HMAC-SHA256 verified with `timingSafeEqual`, strictly scoped to `(companyId, agentId, allowedModel)`, never contain the raw OpenRouter key, and fail closed on `work_requires_model`, `$1` budget exhaustion, disallowed models, and company migration. ## Model Used - Google Gemini (Antigravity agentic runtime, thinking mode with tool use and local 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 - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting merge |
||
|
|
ce204a223a |
fix(ui): tag chunk-load reports with the reload recovery step that gave up (#23613)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The board UI loads each page as a lazy chunk. When a chunk fails to load, chunk-load recovery reloads the page. It retries while a deploy settles (#17349, #19361). > - Safari reported `TypeError: Importing a module script failed.` from the route error boundary. The build already had the retry logic. So recovery gave up and the user saw the error page. > - Recovery can give up for four reasons. The reload did not leave the page within 10 seconds, the retries were used up, session storage was blocked, or an earlier reload in this page was abandoned. The report does not say which one occurred. Breadcrumbs are off for privacy, so the event has no other clue. > - This pull request records the recovery decision for each chunk-load error and sends it as one enum tag. > - The benefit is that the next report shows which recovery step failed, so a real fix can target that step. ## Linked Issues or Issue Description Refs #17349 Refs #19361 **What happened?** A Safari user got `TypeError: Importing a module script failed.` from the route error boundary. The page was more than 10 minutes old and had become visible 10–60 seconds earlier. The build included the chunk-load retry logic, so recovery gave up. The event does not tell why. **Expected behavior** A chunk-load error report states which recovery step gave up, without URLs or page data. **Steps to reproduce** 1. Open a lazy route in a build where its chunk can no longer load. 2. Let the reload stall for more than 10 seconds, or use up the retries in the guard window. 3. Look at the Sentry event. It has no field that tells which case occurred. ## What Changed - `chunk-load-recovery.ts`: Record a `ChunkLoadRecoveryOutcome` for each chunk-load error. The values are `reload_pending`, `reload_abandoned`, `reload_cancelled`, `retries_exhausted`, `storage_unavailable`, and `disabled_after_abandon`. Errors that wait on a reload change to `reload_abandoned` or `reload_cancelled` when that reload ends. Add `readChunkLoadRecoveryOutcome(error)`. The reload behavior does not change. - `sentry.ts`: In `beforeSend`, add the `browser_chunk_reload` tag when the original exception has a recorded outcome. - Tests for each outcome and for the tag. ## Verification - `cd ui && npx vitest run src/lib/chunk-load-recovery.test.ts src/lib/sentry.test.ts src/components/RouteErrorBoundary.test.tsx src/components/AppErrorBoundary.test.tsx`: 83 tests pass. - Red check: the 4 new tests fail on the old implementation and pass with this change. - `cd ui && npx tsc --noEmit -p tsconfig.json`: no errors in changed files. The only errors are the ignored generated Storybook catalog files, which were not generated locally. - Note: `sentry.test.ts > initializes with the DSN it receives` can time out at 5 s on a cold cache. The same flake occurs on unchanged `master`. - `pnpm verify` did not finish in this environment (no output in 300 s, also with `--explain`). CI supplies the broad coverage. ## Risks Low risk. The change only adds one enum tag to Sentry events. It sends no URL, path, or page data. The outcome map is a `WeakMap`, so it holds no errors in memory. The reload timing and the guard logic do not change. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), agentic coding with 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 - [ ] 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: paperclipbugbot <356415228+paperclipbugbot@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>canary/v2026.1203.0-canary.883700 |
||
|
|
24e095c160 |
Keep provider navigation visible in Connect account (#23602)
## Thinking Path > - Paperclip helps people manage AI agents. > - Agents use provider connections to run tasks. > - People choose those providers in the Connect account dialog. > - A selected provider needs a direct path back to the grid. > - Two cards keep that path visible during sign-in. ## Linked Issues or Issue Description **Subsystem affected** Connect account dialog. **Current behavior** The grid entry disappears for some providers. A disabled Next button takes up space during automatic sign-in. **Proposed behavior** Show the selected provider and Other Models together. Show a primary action when the flow requires one. ## What Changed - Added access to the provider grid from native and custom connection forms. - Hid the footer during automatic sign-in and retained explicit connection actions. ## Verification - Ran the two AgentProviderConnection test files. All 13 tests passed. ## Risks - Switching to another provider leaves the current credential draft. ## Model Used GPT-6 (Codex).canary/v2026.1203.0-canary.883600 |
||
|
|
741bed6651 |
Align credential chips and clarify Restart sign-in (#23600)
## Thinking Path > - Paperclip lets people share provider credentials with selected agents. > - Connect account shows those agents as profile chips. > - The identity chip and disclosure link have different alignment needs. > - Give the chips one height and place the disclosure beside the access summary. > - Label the sign-in restart action directly. ## Linked Issues or Issue Description Related PR #23598. **What happened?** The identity chip was shorter than the agent chips, and the Change link moved when the chips wrapped. **Expected behavior** Keep chips at 28 pixels. Align Change and Done with the summary. Show Restart sign-in for the isolated sign-in flow. **Steps to reproduce** Open Antigravity under Other Models in Connect account and expand the access editor. ## What Changed Move the disclosure to the summary row and align its baseline. Set a common chip height. Update the restart link and its tests. ## Verification All 51 focused credential access and sign-in tests passed. ## Risks Long summaries can wrap on narrow viewports. ## Model Used OpenAI GPT-6, via Codex. ## Checklist - [ ] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [ ] 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 - [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [ ] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] 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 - [ ] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [ ] 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 - [ ] I will address all Greptile and reviewer comments before requesting mergecanary/v2026.1203.0-canary.883500 |
||
|
|
4363be6069 |
fix(workspaces): resolve issue identifiers on task workspace routes (#20658)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Each task can have a task workspace, and the API lets agents and board users inspect and change it > - The routes `GET` and `PUT /api/issues/:id/workspace` and `POST /api/issues/:id/workspace/repositories` are in their own router > - The issues router changes an issue identifier (for example `ABC-12`) to the issue UUID, but that resolver does not apply to this router > - So these routes send the identifier into a UUID comparison, Postgres refuses it, and the API returns 500 > - This pull request makes these routes accept an issue identifier, and return 404 for a value that is not an identifier and not a UUID > - The benefit is that the workspace routes act like the other issue routes, and a bad value gives a clear 4xx, not a 500 ## Linked Issues or Issue Description I searched the open and closed issues and pull requests for this problem. I did not find one. Related issues show the same class of error on other routes: #20356, #13504, #17332. They do not touch these routes. **What happened?** `GET /api/issues/ABC-12/workspace` and `PUT /api/issues/ABC-12/workspace` return `500 {"error":"Internal server error"}`. The server log shows `DrizzleQueryError` caused by `PostgresError: invalid input syntax for type uuid: "ABC-12"`. The same request with the issue UUID returns 200. Other issue routes, for example `GET /api/issues/ABC-12` and `GET /api/issues/ABC-12/comments`, accept the identifier. A value that is not an identifier and not a UUID (for example `not-a-task`) also returns 500. **Expected behavior** The workspace routes accept an issue identifier, as the other issue routes do. The agent skill reference (`skills/paperclip/references/issue-workspaces.md`) writes these routes with `:issueId`, so agents send identifiers. A value that does not identify an issue returns a 4xx. **Steps to reproduce** 1. Create an issue. Note its identifier (for example `ABC-12`). 2. Send `GET /api/issues/ABC-12/workspace` as a board user or as an agent. 3. See `500 Internal server error` and the UUID syntax error in the server log. 4. Send the same request with the issue UUID. See 200. **Paperclip version or commit** Seen on release `2026.1106.0`. The route code is the same on `master` at `4f33bb357`. **Deployment mode** Authenticated, private exposure. Installed from npm. Embedded Postgres. **Agent adapter(s) involved** Not adapter-specific (core bug). An agent found it with the Claude Code adapter. ## What Changed - `server/src/routes/task-workspaces.ts`: the shared `task()` lookup now uses `normalizeIssueIdentifier` and `isUuidLike` from `@paperclipai/shared`. An identifier matches `issues.identifier`. A UUID matches `issues.id`. Any other value returns `404 Task not found` before the query. - The lookup keeps the same read condition (`issueReadSqlCondition`) and the same access checks. An identifier that the actor cannot read gets the same 404 as a UUID that the actor cannot read. - `server/src/__tests__/task-workspace-binding.test.ts`: one new test. It reads and selects a workspace with the identifier (in lower case for the read), and checks 404 for `not-a-task` and for an unknown identifier. - No documentation change. The skill reference already writes these routes with `:issueId`. ## Verification - Red before the fix: `npx vitest run src/__tests__/task-workspace-binding.test.ts -t "resolves an issue identifier"` failed with `expected 500 to be 200`. - Green after the fix: the same command passes. - The three test files that mount these routes pass: `task-workspace-binding.test.ts`, `heartbeat-repository-catalog-recovery.test.ts` and `workspace-preparation-history.test.ts` (117 tests). - `pnpm --filter @paperclipai/server typecheck` passes. - `pnpm verify --base upstream/master` keeps 2,498 test files, because `server/src/app.ts` imports the route. I stopped the local run after 75 minutes, in the first of its 10 jobs. In that part, four files failed: `file-resources-git-scan-load`, `git-restore-point-expiration`, `git-workspace-expiration` and `issue-recovery-assignments`. None of them imports the changed route or `app.ts`. On the base revision, the same four files also stall on this machine: a test database connection stays idle in a transaction, and the cleanup waits for its lock. - The CI checks on this pull request run the full suite. All checks pass. - Manual check on a release `2026.1106.0` instance before the fix: identifier 500, UUID 200, `not-a-task` 500. ## Risks - Low risk. The change touches one lookup in one route file. - A UUID still matches by id, with the same checks. `isUuidLike` accepts UUID versions 1 to 5. Issue ids come from `gen_random_uuid()` (version 4). - A value that is not a UUID and not an identifier now returns 404 instead of 500. No client can depend on the old 500. ## Model Used - Anthropic Claude Opus 5.5 (`claude-opus-5-5`). Capabilities: extended reasoning, tool use and code execution. The harness does not show the context window size. ## 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>canary/v2026.1203.0-canary.883400 nightly/v2026.1203.0-nightly.0 |
||
|
|
432ca25efa |
Manage Connect account access with agent profile chips (#23598)
## Thinking Path > - Paperclip connects provider accounts to agents. > - The account dialog summarizes agent access. > - Initials alone make selected agents hard to identify. > - Agent Overview already shows agent names and avatars together. > - Reuse those chips and let people edit the selection in place. ## Linked Issues or Issue Description Related PR #23576. **What happened?** The credential summary showed overlapping badges and required opening Change to edit the selected agents. **Expected behavior** Show each selected agent by name. Offer a searchable add control and a remove control on each editable agent chip. **Steps to reproduce** Open Connect account, choose Antigravity under Other Models, and inspect credential access. ## What Changed Reuse profile chips and the agent picker. Keep the draft selection in sync with the expanded access editor. ## Verification All 36 focused credential selection and provider sign-in tests passed. ## Risks A large explicit selection wraps across multiple rows. Organization-wide agent access uses one summary chip. ## Model Used OpenAI GPT-6, via Codex. ## Checklist - [ ] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [ ] 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 - [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [ ] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] 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 - [ ] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [ ] 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 - [ ] I will address all Greptile and reviewer comments before requesting merge |
||
|
|
3b380c6b15 |
fix(workspaces): name a saved remote workspace the agent's environment cannot use (#23586)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Paperclip can keep a task's workspace in remote storage. Only a Paperclip Runner agent in a sandbox environment, or a supported agent in an SSH environment, can restore and save that workspace. > - An agent can move to another environment, for example from a sandbox to a plugin computer. Its tasks keep their saved remote workspaces. > - When such a task woke, workspace preparation threw a bare 409: "This workspace requires a supported remote execution environment." The run ended `setup_failed`. The task offered Retry, and each Retry failed the same way. Sentry received each refusal as an unexpected run failure. > - This is a known configuration state that only an owner can repair, like the project-storage mismatch from #22398. > - This pull request refuses that run as `configuration_incomplete` with a named reason, and it tells the owner what to do. > - The benefit is an actionable task notice, no Retry loop, and no Sentry noise for this state. ## Linked Issues or Issue Description Refs #22398 (the same treatment for a source project's storage that the environment cannot serve). Refs #23568 (that change gave this refusal its own run-failure group, so it became visible as a separate error). **What happened?** A task's workspace was saved in remote storage by an agent in a Daytona sandbox. The agent was later moved to a plugin computer environment. An automatic wake on the task failed setup with "This workspace requires a supported remote execution environment." The run ended `setup_failed`. The task notice said to press Retry. Retry cannot help, because the agent's environment still cannot use the saved workspace. Sentry received the refusal as an unexpected run failure. **Expected behavior** The refusal names the cause: the saved workspace is in remote storage, and the agent's environment cannot use it. The run fails `configuration_incomplete`. The task notice tells the owner to assign the task to an agent that can use the saved workspace, or to change the agent's environment. Sentry does not receive this known configuration state. The saved workspace stays unchanged. **Steps to reproduce** 1. Save a task workspace in remote storage with a Paperclip Runner agent in a sandbox environment. 2. Change the agent's environment to a plugin computer (or assign the task to an agent in another environment). 3. Wake the agent on the task. The run fails `setup_failed` with the bare 409 message. **Paperclip version or commit** Seen on hosted staging. The new regression tests fail on `master` atcanary/v2026.1203.0-canary.883200 |
||
|
|
917a38efd7 |
fix(server): give the retired task workspace conflict a stable code (#23582)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - Before a run starts, Paperclip reserves the task's remote workspace.
It refuses a workspace that is archived or whose cleanup failed, with
the message "Workspace ownership changed.".
> - When setup fails, the server sends a run-failure report to Sentry.
Since #23568, the report groups a setup conflict by the stable code in
its details.
> - This conflict has no code. Its reports use the fallback grouping and
share a Sentry group with other uncoded setup conflicts.
> - This pull request gives the conflict the code
`remote_workspace_retired`.
> - The benefit is a separate Sentry group for runs that fail on a
retired task workspace.
## Linked Issues or Issue Description
**What happened**
A task's execution workspace was archived. Automatic recovery then
started new runs for the task. Each run failed setup with "Workspace
ownership changed.". These reports went into a shared Sentry group with
unrelated setup conflicts, because the conflict had no code.
**Expected behavior**
The conflict has a stable code. Its run-failure reports get their own
Sentry group.
**Steps to reproduce**
1. Reserve a remote task workspace, then set its status to `archived` or
`cleanup_failed`.
2. Reserve the workspace again for a new run.
3. The reservation rejects with a 409 conflict that has no
`details.code`.
**Paperclip version or commit**
master at
canary/v2026.1203.0-canary.883100
|
||
|
|
fc09515c7e |
Emit Cloud chat.started when a chat with an agent starts (#23558)
<!-- claude-projects-attribution: {"github_login":"nguyenm7"} -->
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Paperclip Cloud measures activation with a funnel: account created,
org named, agent named, model connected, chat launched, first agent run
succeeded, first task created
> - `model.connected`, `agent.task_run` and `task.created` come from the
server, but "chat launched" comes only from the browser
(`onboarding_step_completed` with `step=launch`)
> - `task.created` skips chats on purpose, so a person who only chats
with their agent has no server-side step after "first agent run"
> - #23403 added a Cloud-only direct PostHog path
(`trackCloudPostHogEvent`) for onboarding events that must not depend on
the browser
> - This pull request uses that path to emit `chat.started` when the
chat owner's first message or first question-card answer commits
> - The benefit is a server-side "chat started" step that counts a real
action by the person, once per chat, whichever way they reached the chat
## Linked Issues or Issue Description
Refs #23403
**What existing behavior does this improve?**
Server-side activation funnels on Paperclip Cloud.
**Current behavior**
The only "chat launched" signal is the browser `launch` step. Browser
events can be lost (wizard skipped or resumed, navigation, ad blockers
on older builds). On the server, a chat creates an issue but
`emitTaskCreatedAfterCommit` returns early for it, so no event records
that the chat started.
**Proposed behavior**
When the chat owner's first turn commits (their first message, or their
first answer to a question card such as the onboarding welcome card),
the server emits the Cloud-only event `chat.started` with `surface`
(`onboarding_chat` | `agent_chat`) and `agent_id`. Creating or preparing
a chat emits nothing, because onboarding prepares the chat before the
person clicks Launch. The Launch click itself is already relayed
server-side as `onboarding_step_completed` (`step=launch`).
**Reason and benefit**
Funnel steps should come from real product actions that the server
records. With `chat.started`, a funnel can count "chat launched" from
the server and see people who chat but never create a task.
**Breaking changes**
None. The event is new and is Cloud-only.
## What Changed
- `server/src/services/product-telemetry.ts`: add `CHAT_STARTED_EVENT`
and `emitChatStartedIfFirstOwnerTurn`. It runs inside the transaction
that wrote the person's turn and locks the chat's issue row. It checks
that the actor is the chat owner (not an agent, run, or system actor),
and that the owner has no other message and no other answered question
card in the chat. Cancelled or skipped cards do not count. Then it emits
`chat.started` through `trackCloudPostHogEvent` after commit.
- Callers: `addComment` (`issues.ts`), `answerQuestions`
(`issue-thread-interactions.ts`), both headless comment paths
(`headless-comment-group-commit.ts` and the serialized insert in
`routes/headless-channels-schemas.ts`), and the headless one-line
resolve (`headless-events-schedules-interactions.ts`).
- `server/src/__tests__/chat-started-telemetry.test.ts`: unit tests for
the first turn, both surfaces, and every case that must not emit.
- `server/src/__tests__/product-telemetry.test.ts`: embedded-Postgres
tests. Chat creation and system or other-person messages emit nothing.
The owner's first message emits once. A first message after a cancelled
card still emits. A rolled-back first message and a task comment emit
nothing.
- `docs/api/onboarding-telemetry.md`: document the server-emitted
`chat.started` event.
## Verification
- `npx vitest run server/src/__tests__/chat-started-telemetry.test.ts`:
10 passed (helper unit tests).
- `pnpm --filter @paperclipai/server typecheck`: passed.
- The cases in `product-telemetry.test.ts` need embedded Postgres, which
could not start in my environment (it runs as root). CI runs them.
## Risks
- Low. The event is fire-and-forget after commit, inside a `try`. It
does nothing on self-hosted installs, when `PAPERCLIP_POSTHOG_DIRECT=0`,
or when the PostHog environment is not set.
- One event per chat: the check runs under the chat's issue row lock,
and a rolled-back write emits nothing. `/new` in an existing chat does
not emit again.
- Two extra indexed reads run on a person's chat message or answer, and
only on chats.
### Open questions for reviewers
1. **Consent.** Like `model.connected` and the #23403 relay, this server
event is not gated by the browser cookie banner. This PR does not add a
consent check. The only switch is the existing
`PAPERCLIP_POSTHOG_DIRECT=0`. If people who decline cookies must be
excluded from server-side product events, that should be one rule for
all Cloud direct events, not a rule in this PR.
2. **New name or existing name.** This PR adds a new name,
`chat.started`, instead of emitting `onboarding_step_completed`
(`step=launch`) from the server. A new name keeps the browser and server
signals separate, so the two funnels can be compared and the existing
insights do not double count. The other choice is to emit the existing
name with a `source: server` property. Please say which one you prefer.
Not in this PR: "Agent named" has no clean server moment (the setup
agent is saved with a default name before the person names it, and
`agent.created` fires at launch), and `agent.task_run` still does not
say whether a run was a chat reply or a task. That needs a new
registered dimension in the telemetry contract, so it is a follow-up.
## Model Used
Claude Code (Anthropic Claude, agentic coding with 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)
- [ ] 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
https://claude.ai/code/session_01KmUZthscGtSrd1KaWnwzWm
---
_Generated by [Claude Code](https://claude.ai/code)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
canary/v2026.1203.0-canary.883000
|
||
|
|
8379dedd93 |
Pin Plugins by default in workspace navigation (#23578)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - People browse available integrations on the Plugins page. > - A fresh Coordinator sidebar puts that page inside More. > - People who look in Settings can miss it. > - This pull request pins Plugins until a person chooses their own layout. ## Linked Issues or Issue Description **What existing behavior does this improve?** Finding the Plugins catalog on a first visit to the Coordinator workspace. **Current behavior** Open a workspace in a fresh browser profile. The sidebar shows Inbox followed by More. Open More to find Plugins. **Proposed behavior** Show Plugins below Inbox on the first visit. Honor saved pins and their order, including an empty list. Related discussion about navigation for individual plugin pages: #21807. ## What Changed - Use the Plugins route as the default when the signed-in user has no saved pin list in this browser. - Add a browser regression for unpinning and re-pinning across reloads. Update the AgentMail browser journey to use the visible Plugins link. - Document the default and how to change it. ## Verification - `pnpm exec vitest run ui/src/hooks/usePinnedNavigation.test.tsx` passed. - `pnpm exec playwright test -c tests/e2e/playwright.config.ts tests/e2e/plugins-browse.spec.ts tests/e2e/agentmail.spec.ts` passed all four Chromium tests against the built app and a disposable database. - Compared the parent and feature commits in fresh Chromium sessions. Confirmed the pin control in More and the unpin and reorder controls on the pinned row. ## Risks An existing user who has never saved pins in this browser also receives the new default. A saved empty list keeps the sidebar empty of pins. ## Model Used OpenAI GPT-6 (Codex), with repository editing and Chromium test 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 Co-authored-by: Scott Tong <scott@scotts-mbp-m5-max.local>canary/v2026.1203.0-canary.882900 |
||
|
|
a93d971eed |
Refine Connect account sign-in controls and access badges (#23576)
## Thinking Path > - Paperclip lets people connect provider accounts to agents. > - The Connect account dialog shows the sign-in controls and credential access. > - A pasted callback requires an additional submit action. > - The desktop dialog has room for the three controls on one row. > - Back should return to the provider grid in one step. ## Linked Issues or Issue Description Related PR #23551. **What happened?** The submit control occupied a second row and Back collapsed the selected provider before returning to the grid. **Expected behavior** Keep desktop controls inline, stack them on mobile, and return directly to the grid. **Steps to reproduce** Select Antigravity under Other Models. Inspect the sign-in controls, then press Back. ## What Changed Adjust the Antigravity and Grok sign-in marks. Show overlapping credential access badges. Simplify the submit label and the Back action. ## Verification All 35 focused AdapterLoginChrome and AgentProviderConnection tests passed. ## Risks Narrow viewports use a stacked layout. The available callback controls depend on the environment. ## Model Used OpenAI GPT-6, via Codex. ## Checklist - [ ] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [ ] 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 - [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [ ] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] 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 - [ ] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [ ] 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 - [ ] I will address all Greptile and reviewer comments before requesting merge |
||
|
|
49165825a0 |
fix(native): restart an unclaimed continued-session follow-up instead of reattaching (#23434)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Native runs can execute in remote Daytona sandboxes. After a server restart, restart recovery decides how each interrupted run continues. > - Recovery can restart an incomplete bootstrap, or it can reattach to a live remote runner. > - A continued-session follow-up gets the previous turn's checkpoint and provider session (`sessionIdBefore`) at admission, before an executor claims it. > - The unclaimed-bootstrap check (#20214) refuses every run that has `sessionIdBefore`. Thus a real follow-up never matches it. Recovery falls through to the generic fallback and reattaches to a runner that never started. > - This pull request lets the unclaimed-bootstrap check accept such a follow-up when all of its session evidence is inherited. > - The benefit is that the run restarts cleanly. It does not fail, and it does not cause the next follow-up to fail. ## Linked Issues or Issue Description Refs #20214, #20153, #20642, #20979, #20226, #19373 **What happened?** A hard restart reached a continued-session follow-up on a new Daytona sandbox before any executor claimed it (coordinator attempt 0, controller generation 0). Recovery chose `reattach_remote_runner` from the inherited provider session ID only. The run failed with `remote_reattach_root_missing`. The next follow-up selected the failed run as its source and failed with `native_controller_recovery_unsupported:metadata_format`. **Steps to reproduce** 1. Admit a continued-session follow-up on a remote sandbox. Admission sets `sessionIdBefore` and rebinds the previous turn's checkpoint to the run. 2. Hard-restart the server before an executor claims the run. 3. Restart recovery claims the run with `reattach_remote_runner`, `providerAttempt: 0`, `controllerGeneration: 1`. **Expected behavior** Recovery restarts the bootstrap (`bootstrap_incomplete`, reason `remote_execution_never_claimed`), as it does for an unclaimed first run. **Environment** Staging, remote Daytona sandboxes, master that includes all of the linked fixes. ## What Changed - `native-restart-recovery.ts`: `unclaimedBootstrap` accepts `sessionIdBefore` when all of these are true: - `sessionIdBefore` equals the rebound checkpoint's `providerSessionId`. - The checkpoint is continued-session-only and inherited-only: no cursor, turns, active turn, result, terminal state, pending requests or provider events. - A settled earlier run of the same native session saved that exact provider session (`carriesSettledPredecessorSession`). - All other unclaimed-bootstrap guards stay the same: no execution-start evidence, no own runner identity, prepared remote workspace, preparation fencing. - `continuedSessionOnly` and `pendingInheritedRequests` move above `unclaimedBootstrap`. Their definitions do not change. - `native-runner-restart-recovery.integration.test.ts`: one new `it.each` with five cases. The rebound follow-up restarts. A session with no settled predecessor, a carried active turn, a projected provider event, and a `sessionIdBefore` that differs from the checkpoint all stay held. ## Verification - Red on master: the new `restarts an unclaimed continued-session follow-up` case received `reattach_remote_runner`, `providerAttempt: 0`, `controllerGeneration: 1`. These are the same values as the staging failure. - Green with this change: `npx vitest run src/services/native-runtime/native-runner-restart-recovery.integration.test.ts` (from `server/`) gives 232 passed and 22 skipped. The skipped tests need `PAPERCLIP_TEST_RUNNER_CONTAINER`, and they skip on master too. - Also passed locally: `heartbeat/recovery.test.ts`, `heartbeat/live-runner-adoption.test.ts`, `native-restart-recovery-isolation.test.ts`, `native-stop-accounting.integration.test.ts`, `native-warm-transition-restart.integration.test.ts`, `native-scheduled-resume-lock.test.ts`, `native-controller-identity.test.ts`, `__tests__/heartbeat-native-restart-suspension.test.ts`, `__tests__/heartbeat-native-early-hand-off.test.ts`. - Not run locally: `native-runner-restart-preparation.integration.test.ts`, `remote-workspace-migration.test.ts`, `heartbeat/workspace-preparation.test.ts`, typecheck and build. The local sandbox could not run `git`, and those fixtures need it. CI covers them. ## Risks - Low risk. The change only adds one more shape to an existing restart path. The shape needs a settled predecessor that saved the same provider session, and the run must have no evidence of its own work. - If the evidence is incomplete, recovery holds the run as before. It does not reattach or restart it. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected — check the roadmap first. See `CONTRIBUTING.md`. ## Model Used - Anthropic Claude Opus 5.5 (`claude-opus-5-5`), used as an agent with 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 - [ ] 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 - [ ] 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> |
||
|
|
c852420baf |
fix(server): group setup conflicts by their detail code in run-failure reports (#23568)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - When an agent run fails, the server sends a run-failure report to
Sentry. The fingerprint of the report sets the Sentry group.
> - Setup failures without a root error code use a fallback fingerprint:
the exception name and the HTTP status.
> - The `conflict()` helper keeps its stable code in `details.code`. The
diagnostics read only `code` and `reasonCode` on the error. They ignore
`details.code`.
> - Thus every coded 409 setup conflict gets the fingerprint
`exception:Error` + `status:409`. Unrelated causes go into one Sentry
group. For example, an unfinished workspace writer and a missing remote
execution environment share one group.
> - This pull request reads a bounded identifier from `details.code`
when the error has no own code.
> - The benefit is one Sentry group for each setup conflict cause. A fix
for one cause no longer shows as a regression of another cause.
## Linked Issues or Issue Description
**What happened**
One Sentry group receives three different setup failures. They are "The
workspace still has an unfinished writer or save operation.", "This
workspace requires a supported remote execution environment." and
"Workspace ownership changed." Each one has a different cause. The first
two have a stable code in `details.code`
(`remote_workspace_writer_pending` and
`remote_workspace_execution_required`). The run-failure diagnostics do
not read that code, so all three get the same fallback fingerprint.
**Expected behavior**
A setup conflict with a stable code gets a fingerprint with that code.
Different causes go into different Sentry groups.
**Steps to reproduce**
1. Make a run fail setup with `conflict(message, { code:
"remote_workspace_writer_pending" })`.
2. Make another run fail setup with `conflict(message, { code:
"remote_workspace_execution_required" })`.
3. Look at the run-failure fingerprints. Both are `[setup_failed,
<adapter>, setup, exception:Error, status:409]`.
**Paperclip version or commit**
master at
|
||
|
|
b0f682b66b | Measure when users see a reply to their onboarding chat input (#23574) canary/v2026.1203.0-canary.882500 | ||
|
|
2b65b97cae |
fix(ui): paginate all task-list views (#23564)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Its task lists help people find and manage work across personal and organization views. > - Several personal views stop after 100 tasks, and Blocked stops after 200 tasks. > - Other lists have page reads but lack a consistent way to load more or retry a failed page. > - This pull request makes pagination available across every task-list view. > - People can reach older tasks, keep filters active, and retry without losing readable rows. ## Linked Issues or Issue Description **What happened?** Task lists have inconsistent pagination. Mine, Recent, and Unread stop at the first task batch. Blocked stops at 200 tasks. Everything has the same missing-page behavior before this PR. Some organization layouts and searches replace paged rows with separate capped queries. **Expected behavior** Every task-list view can load its remaining tasks. A failed later page keeps loaded tasks visible and offers a retry. **Steps to reproduce** 1. Use a company and account with more tasks than a view's first batch. 2. Open Mine, Recent, Unread, Everything, or Blocked and scroll to the bottom. 3. Try to reach older tasks. The affected views stop without a next-page control. 4. Check organization status views, Archived, search, and board layouts for consistent loading controls. **Paperclip version or commit** The affected code is present at base commit `53bebb59f907571228dfb85a834a38536f934aa6`. **Deployment mode** Observed on hosted staging. Verified locally from source on macOS arm64. GitHub searches found no duplicate open PR or directly matching issue. ## What Changed - Apply one task pagination control to personal, organization, status, archive, classic, and sandbox task lists. - Make Recent, Unread, and Everything page through touched tasks. Remove the shared 100-task display cutoff. - Filter unread tasks on the server before paging. - Keep Mine's coherent initial snapshot. Fetch older task pages through the existing authorized list API. - Add older pages to Blocked. Load Needs attention task details in batches from its existing task index. - Let the Tasks route supply paged search and board data to the shared list components, so separate capped queries cannot replace loaded pages. - Keep loaded rows visible during later-page loading and errors. Keep the retry control available when the final attention page fails. - Pause the classic and streamlined lists' automatic server-page reads after a later-page error. Keep an explicit retry button available to restart that page. - Keep one paging and retry control inside each task-list component for list and board layouts. - Reuse the same request filters for the first and later Legacy Inbox pages. - Preserve the array cache contract for archive rollback, live updates, and sharing the first page across tabs. - Update product documentation and cover the additional views with regression tests. ## Verification - Revision: `9275d37c06dc14d00b6759ad71fb6402252db84b`, based on `origin/master` at `53bebb59f907571228dfb85a834a38536f934aa6`. - Environment: macOS arm64, Node v25.6.1, pnpm 9.15.4. - From `ui/`, ran `pnpm exec vitest run src/components/IssuesList.paging.test.tsx src/pages/TaskListPagination.test.tsx src/pages/Issues.test.tsx src/hooks/useInboxTouchedIssues.test.tsx src/lib/inbox.test.ts src/lib/blockedInbox.test.ts src/lib/inboxArchiveCache.test.ts src/lib/inboxOrderPin.test.ts src/hooks/useSharedPolling.test.ts src/hooks/useSharedPollingSnapshot.test.tsx src/hooks/useTaskListCollection.test.tsx`: all 133 tests passed across 11 files. - Real IssuesList tests cover both UI modes. They verify that provided board and search pages stay visible, capped column and search queries do not run, and each layout has one paging and retry control. Only leaf row and board rendering are stubbed. - Real Inbox page tests load later Mine and Recent pages in both UI modes. They also check Unread's server filter, first-page and later-page filter agreement, and removal of the control after the last page. - Page tests cover All tasks, Active, Backlog, Done, Archived, Needs attention, Blocked, and classic Tasks with server search. Supporting UI services and row rendering are isolated. - Red-green regressions proved the old 100-task display cutoff and automatic retries after a failed page. The fixed lists keep readable rows and require an explicit retry after failure. - The work-limit test uses 500 full task fixtures across five pages. A deterministic counter throws above a linear task-ID read budget. Ten unchanged rerenders per page perform no collection work. - Tests also cover page overlap, duplicate observer events, last-page detection, loading and retry, account and company changes, archive rollback, live invalidation, and the fallback without IntersectionObserver. - Ran `pnpm --dir ui typecheck`: passed. - Ran `node scripts/check-test-budget.mjs --base origin/master`: passed for all four changed test files. - Ran `git diff --check origin/master...HEAD`: passed. - A prior `pnpm verify` attempt selected 2,319 files and started a broad server run. It was stopped to avoid duplicating broad CI for this UI change. That interrupted attempt is not a pass. - Full local build and browser acceptance of the modified pages were not run. [Greptile passed with 5/5 on this revision](https://github.com/paperclipai/paperclip/pull/23564#issuecomment-7362362373). Both inline review threads are resolved. [CI typecheck](https://github.com/paperclipai/paperclip/actions/runs/47004999629/job/143907916923) and [build](https://github.com/paperclipai/paperclip/actions/runs/47004999629/job/143907916990) passed. [Both required CI checks passed on this revision](https://github.com/paperclipai/paperclip/actions/runs/47004999629): `ci / e2e` and `ci / verify`. No CI checks remain pending or failed. Confirmation that automated design review has cleared the prior hold is still pending. ## Risks - Task updates can move rows between offset pages. The merge removes duplicate task IDs, and live refreshes update loaded pages. - Search and task filters cover loaded rows in personal views. Use Load more tasks to include older rows while filters are active. - Mine keeps the existing snapshot and access behavior. The change adds no database migration or public API contract. ## Model Used OpenAI `gpt-6.1-sol` through the Codex harness, with xhigh reasoning effort and 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 - [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>canary/v2026.1203.0-canary.882400 |
||
|
|
2a8a0b8e18 |
fix(ci): retry inconsistent release admission listings (#23572)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Core release workflows admit a source revision before running full verification. > - Admission discovers an active image or npm release for that exact revision. > - One inconsistent GitHub run listing currently fails admission before tests start. > - This pull request rereads count mismatches within a fixed retry budget. > - Complete listings and fresh canonical run identity remain required. ## Linked Issues or Issue Description **What happened?** [Cloud readiness run 47005873736](https://github.com/paperclipai/paperclip/actions/runs/47005873736) failed candidate admission with `Incomplete release workflow listing.` This happened before source tests ran. The [image workflow](https://github.com/paperclipai/paperclip/actions/runs/47005873889) then canceled itself because source verification failed. Image consumers could not advance to that revision. **Expected behavior** Admission should allow a short, bounded recovery window for an inconsistent workflow count. It must reject persistently incomplete or untrusted evidence. **Steps to reproduce** Return a workflow listing whose `total_count` differs from the number of returned runs. Then return a complete listing for the same query. The original script fails on the first response. The new regression test requires admission to wait for complete evidence and revalidate the selected run. **Paperclip version or commit** The reported run used `b066a3ddd39123972d0e7f5f9935c83d41303297`. This fix starts from `6e340a3f962c60e2723c780389db878ce7ff74c7`. **Deployment mode** Canonical GitHub Actions master-push release workflows. Related changes: #18869 introduced release admission; #22677 added conditional Actions reads; #22690 added quota-aware read retries. I searched open and closed PRs and issues for admission and workflow-listing failures. I found no duplicate fix. ## What Changed - Allow up to three admission listing reads when valid, bounded counts disagree with the returned run count. Wait one second, then two seconds. - Include safe workflow and count details if the mismatch persists. - Preserve strict listing validation and the fresh canonical run check. Publication and deferred-producer readers retain their existing single-read behavior. - Cover recovery for both release consumers, exhausted retries, overcounts, undercounts, and a run attempt changing before admission. ## Verification - The new admission regressions fail against the original implementation. - `node --test scripts/cloud-source-verification.test.mjs scripts/github-actions-rate-limit.test.mjs scripts/docker-image-metadata.test.mjs .github/scripts/tests/cloud-readiness.test.mjs` — 81 tests pass on the changed revision. - `node --check scripts/cloud-release-admission.mjs` and `git diff --check` pass. - `pnpm verify --explain` exits 2 as designed: the changed script is a global CI input. Broad typecheck, test, build, Runner, and browser checks must run in CI. This is not a full local-suite pass. - Reviewed the diff and scanned added lines for credentials, personal paths, and private URLs before pushing. No findings. - Greptile reviewed `525694ddc75e7f4c4d1e6c2e00fbc9fd15deadd5` at 5/5. No review threads or actionable comments remain. All underlying typecheck, build, unit, Runner, serialized-server, and 16 browser shard checks passed in [CI run 47008128119](https://github.com/paperclipai/paperclip/actions/runs/47008128119) on `525694ddc75e7f4c4d1e6c2e00fbc9fd15deadd5`. The final [`ci / verify` aggregate](https://github.com/paperclipai/paperclip/actions/runs/47008128119/job/143921126471) also passed. All checks are settled with no failures. GitHub reports the branch clean and mergeable against current master. ## Risks Low risk. Admission can spend up to six extra seconds across its two consumer queries. Malformed metadata, oversized listings, and exhausted mismatches still fail closed. No source proof or publication gate is relaxed. No database or deployment configuration changes are required. The original GitHub response was not retained, so its exact invalid field remains unknown. The regression tests inject count mismatches; a later healthy master run establishes recovery, but does not prove the cause of the earlier response. ## Model Used OpenAI `gpt-6.1-sol` through Codex in T3 Code, with xhigh reasoning and shell/tool access. The runtime does not report the context window size. No subagents were used. ## 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> |
||
|
|
0e9d4abcb3 |
docs(release): canonicalize stable notes for v2026.1202.0 (#23570)
<!-- Write all pull request text in Simplified Technical English (ASD-STE100): short sentences, one instruction per sentence, simple approved vocabulary, and the active voice. --> ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The release process promotes a soaked beta to stable and publishes the curated notes as the GitHub Release body. > - After the publish, the notes must be at `releases/v<stable-version>.md` on `master`. The website changelog and the next release notes use that path. > - Stable `v2026.1202.0` was published on 2026-12-03 from beta `2026.1120.0-beta.0`. It used the candidate branch `candidate/release-2026.1202.0`: the beta source, test and test-runner fixes, and the notes file. > - The notes resolved from the source tree (`notes_mode=source_tree`). In this mode the workflow skips the `canonicalize_stable_notes` job, so it pushed no canonicalize branch. > - This pull request does by hand what that job does. It renames the beta notes file on `master` to the stable path. It changes no content. > - The benefit is that `releases/v2026.1202.0.md` exists on `master` and is byte-identical to the published GitHub Release body. ## Linked Issues or Issue Description Refs #23550 (the notes fix before publish) Refs #22247 (the same manual rename for v2026.1117.0) **Issue type** Missing content **Where is the issue?** `releases/` on `master`. The stable notes for `v2026.1202.0` are only at the beta path `releases/beta/v2026.1120.0-beta.0.md`. The canonical path `releases/v2026.1202.0.md` does not exist on `master`. **What's wrong?** The GitHub Release https://github.com/paperclipai/paperclip/releases/tag/v2026.1202.0 is published. The website changelog sync reads `releases/v2026.1202.0.md` on `master`. The changelog page for this release cannot appear until this rename merges. **Suggested fix** Rename the beta notes file to the stable path with no content change. This is the same step that the workflow job does in `master_beta` mode. ## What Changed - Rename `releases/beta/v2026.1120.0-beta.0.md` to `releases/v2026.1202.0.md`. GitHub reports a rename with 0 additions and 0 deletions. - No line of the file changes. The blob is `40c62079534dfa2fc90709d783053653b9744ed8`. This is the same blob as `releases/v2026.1202.0.md` at the release source commit `1ffe1fecb0d2dab06987d89069fe502842f75d9b` (tag `v2026.1202.0`). - This pull request does not change the release workflow. ## Verification - The compare API shows one file: `releases/v2026.1202.0.md`, status `renamed` from `releases/beta/v2026.1120.0-beta.0.md`, 0 additions, 0 deletions. - The file on this branch has blob `40c62079534dfa2fc90709d783053653b9744ed8`. The file at tag `v2026.1202.0` has the same blob. - The raw `body` field of the `v2026.1202.0` GitHub Release is the same as the file. The only difference in a `--jq` dump is the trailing newline that `--jq` adds. v2026.1117.0 shows the same result. - After merge, https://github.com/paperclipai/paperclip/blob/master/releases/v2026.1202.0.md must return 200, and the old beta path must return 404. ## Risks - Low risk. One markdown file moves, and no content changes. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, with tool use (shell, GitHub API). ## 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 (documentation only; no tests apply) - [ ] I have added or updated tests where applicable (not 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>canary/v2026.1203.0-canary.882200 |
||
|
|
6e340a3f96 |
Verify onboarding models and explain provider failures (#23563)
Verify deployment-configured model preferences with the selected account. Preserve structured provider failures and show descriptive messages for known causes through the existing onboarding error display. Keep the existing failure buttons, account binding, and retry/sign-in behavior. Validation: UI typecheck, 38 focused tests, four browser journeys, all applicable CI checks, and Greptile 5/5 with no unresolved review comments. Co-Authored-By: Paperclip <noreply@paperclip.ing>canary/v2026.1203.0-canary.882100 |
||
|
|
b066a3ddd3 |
fix(cloud-trial): mount internal OpenRouter proxy before actorMiddleware (#23571)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Cloud starter-inference OpenCode runs in remote plugin Runners authenticate to `/api/internal/cloud-inference/v1/*` using an ephemeral per-run `pctrial_` Bearer token. > - In `server/src/app.ts`, `/api/internal/cloud-inference` was mounted after `actorMiddleware`. > - In authenticated deployments, `actorMiddleware` intercepted every `Authorization: Bearer pctrial_...` request, tried to verify it as an agent JWT/API key, and returned HTTP 401 (`Agent token did not verify`) before the proxy route ever ran. > - This pull request mounts `/api/internal/cloud-inference` before `actorMiddleware` (alongside `voiceWebhookRoutes`, which uses the same pre-`actorMiddleware` pattern) and adds a full `createApp` regression test in `authenticated` deployment mode. > - The benefit is that remote Cloud starter-inference OpenCode runs authenticate cleanly through `/api/internal/cloud-inference/v1/*` and stream real replies. ## Linked Issues or Issue Description Refs #23401, #23559 **Summary** Mount `cloudInferenceInternalProxyRoutes` before `actorMiddleware` in `server/src/app.ts` so ephemeral `pctrial_` Bearer tokens are not rejected as invalid agent tokens. **Steps to Reproduce** 1. Run Paperclip in `authenticated` deployment mode with Cloud starter inference enabled. 2. Start a starter-inference OpenCode run in a remote plugin Runner environment. 3. Observe HTTP 401 (`Unauthorized: Agent token did not verify; obtain fresh credentials and retry`) when OpenCode calls `/api/internal/cloud-inference/v1/chat/completions`. **Expected Behavior** Requests to `/api/internal/cloud-inference/v1/*` reach `cloudInferenceInternalProxyRoutes`, validate the active per-run `pctrial_` token, and forward to OpenRouter with the server-held starter key. ## What Changed - `server/src/app.ts`: Moved `cloudTrialInferenceController` initialization and `app.use("/api/internal/cloud-inference", cloudInferenceInternalProxyRoutes(cloudTrialInferenceController))` above `app.use(actorMiddleware(...))`, alongside `voiceWebhookRoutes`. - `server/src/__tests__/cloud-trial-proxy-middleware-order.test.ts`: Added a full `createApp` regression test (`deploymentMode: "authenticated"`) verifying that unknown `pctrial_` tokens reach `cloudInferenceInternalProxyRoutes` (`proxy_token_not_found_on_instance`) and active `pctrial_` tokens proxy cleanly to upstream OpenRouter with the server-held key. ## Verification - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/cloud-trial-proxy-middleware-order.test.ts src/__tests__/cloud-trial-inference.test.ts` — passed (7/7 tests). - `pnpm --filter @paperclipai/server typecheck` — passed (0 errors). ## Risks - Low risk. `/api/internal/cloud-inference` strictly authenticates every request against active per-run `pctrial_` tokens in memory using `timingSafeEqual` and rejects all unauthenticated or unknown tokens with HTTP 401. ## Model Used - Google Gemini (Antigravity agentic runtime, thinking mode with tool use and local 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 - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting merge |
||
|
|
cc2e1d9d43 |
Honor plugin task driver concurrency defaults on hire (#23535)
## Thinking Path > - Paperclip schedules work for agents. > - Each agent has a limit on simultaneous runs. > - A task driver can provide an execution environment with its own capacity. > - Previously the creation form sent the same limit for every driver. > - A driver can now declare the value Core saves when a new agent has no explicit limit. ## Linked Issues or Issue Description **Subsystem affected** Agent hiring and plugin environment drivers. **Current behavior** The create form, API, and import flow supply the global concurrency default before the task driver can provide one. **Proposed behavior** Let each task driver declare an optional per-agent concurrency default. Apply it once during hire and honor explicit agent limits. ## What Changed - Refreshed the three SDK source pins for the changed files. - Added the optional driver field `defaultMaxConcurrentRuns` with integer bounds from 1 through 50. - Applied it during hire using the resolved task environment. Saved the resolved runtime configuration in hire approvals. - Removed early defaults from the creation form, routes and new-agent imports. Preserved saved limits on export, including explicit values equal to the global default. Kept the current limit when importing an update with an omitted limit. ## Verification - [Full PR CI](https://github.com/paperclipai/paperclip/actions/runs/47000023360) passed on `83cce42b9a`. Server shard 16 passed on retry after a PostgreSQL connection reset on the first attempt. - `pnpm -r typecheck` passed. The SDK source pin check passed. `pnpm verify` selected broad CI coverage because the SDK input registry changed. - On rebased commit `83cce42b9a`, all 441 tests in six focused Vitest suites passed, including the MCP rollback test corrected in #23560. The SDK source pin check passed. ## Risks This affects new hires on drivers that opt in. Existing agents retain their saved configuration. Single-run provider limits still apply. An older client that explicitly sends the global default will keep that value. ## Model Used OpenAI GPT-6 via Codex. Used local source inspection, code editing, TypeScript and test 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 --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1203.0-canary.881900 |
||
|
|
53bebb59f9 |
test: keep connection rollback retry drafts unbound (#23560)
Align the rollback retry test with draft resume. Preserve the catalog rollback and public identity checks. Co-Authored-By: Paperclip <noreply@paperclip.ing>canary/v2026.1202.0-canary.881801 |
||
|
|
85b9586dd5 |
fix(cloud-trial): transfer OpenRouter starter proxy credentials to remote plugin Runners (#23559)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Cloud starter-inference onboarding (`free_inference_1`) runs the first OpenCode agent inside a remote plugin Runner environment using a per-run server proxy (`PAPERCLIP_OPENROUTER_PROXY_URL` and `PAPERCLIP_OPENROUTER_PROXY_TOKEN`) instead of exposing the raw OpenRouter key. > - On remote plugin Runner environments, OpenCode runs failed immediately with OpenRouter HTTP 401 (`No cookie auth credentials found`) because the proxy URL and token never reached the sandbox. > - Three boundaries stripped the proxy credentials: `preparePluginRunnerCredentials` returned early when `managedAiCredentialIdentity` was absent, `ENVIRONMENT_TASK_PROVIDER_CREDENTIAL_KEY_SETS.opencode` did not allow the proxy pair, and Rust `OPENCODE_PROVIDER_ENVIRONMENT_KEYS` in `codex_provider.rs` did not forward those keys. > - This pull request adds the `[PAPERCLIP_OPENROUTER_PROXY_URL, PAPERCLIP_OPENROUTER_PROXY_TOKEN]` pair across all three boundaries while keeping raw starter keys strictly server-side and failing closed on partial or ambiguous credentials. > - The benefit is that Cloud starter-inference OpenCode runs authenticate cleanly through the server proxy inside remote plugin Runner sandboxes. ## Linked Issues or Issue Description Refs #23401, #23427 **Summary** Transfer `PAPERCLIP_OPENROUTER_PROXY_URL` and `PAPERCLIP_OPENROUTER_PROXY_TOKEN` through the plugin Runner credential boundary and Rust `runner-core` allowlist for Cloud starter-inference OpenCode runs. **Steps to Reproduce** 1. Create a Cloud starter-inference (`free_inference_1`) workspace running OpenCode in a remote plugin Runner environment. 2. Send a message in the onboarding chat. 3. Observe `APIError` HTTP 401 (`No cookie auth credentials found`) from OpenRouter because the sandbox OpenCode proxy received neither `PAPERCLIP_OPENROUTER_PROXY_URL` nor `OPENROUTER_API_KEY`. **Expected Behavior** The remote plugin Runner receives `{ PAPERCLIP_OPENROUTER_PROXY_URL, PAPERCLIP_OPENROUTER_PROXY_TOKEN }` via the `opencode` `provider-env` credential channel, forwards them to OpenCode, and routes inference through the server-side starter proxy. ## What Changed - `packages/plugins/sdk/src/environment-tasks.ts`: Added `["PAPERCLIP_OPENROUTER_PROXY_URL", "PAPERCLIP_OPENROUTER_PROXY_TOKEN"]` to `ENVIRONMENT_TASK_PROVIDER_CREDENTIAL_KEY_SETS.opencode`. - `packages/paperclip-runner/runner/crates/runner-core/src/codex_provider.rs`: Added `"PAPERCLIP_OPENROUTER_PROXY_URL"` and `"PAPERCLIP_OPENROUTER_PROXY_TOKEN"` to `OPENCODE_PROVIDER_ENVIRONMENT_KEYS`. - `server/src/services/native-runtime/plugin-runner-credentials.ts`: Allowed `opencode` runs with both `PAPERCLIP_OPENROUTER_PROXY_URL` and `PAPERCLIP_OPENROUTER_PROXY_TOKEN` to transfer that `provider-env` credential when `identity` is absent (using `"cloud-trial"` as `accountIdentity`). - `server/src/services/native-runtime/plugin-runner-credentials.test.ts`: Added regression coverage for transferring the Cloud starter proxy pair without a managed AI connection identity and failing closed on partial or ambiguous combinations. - `tests/runner-e2e/source-sdk-public-inputs.json`: Updated reviewed SDK public inputs pin for `packages/plugins/sdk/src/environment-tasks.ts`. ## Verification - `pnpm --filter @paperclipai/plugin-sdk build` — passed. - `pnpm --filter @paperclipai/plugin-sdk exec vitest run tests/environment-tasks.test.ts tests/environment-task-release-resume.test.ts` — passed (104/104 tests). - `pnpm --filter @paperclipai/server exec vitest run src/services/native-runtime/plugin-runner-credentials.test.ts src/__tests__/plugin-runner-credential-names.test.ts` — passed (45/45 tests, verifying SDK allowlist, Runner TS allowlist, and Rust `codex_provider.rs` allowlist together). ## Risks - Low risk. Only the ephemeral per-run proxy URL and `pctrial_` token pair is allowed when both are present and non-empty; partial or mixed sets still fail closed in `environmentTaskCredentialSchema`, and raw OpenRouter keys never leave the server process. ## Model Used - Google Gemini (Antigravity agentic runtime, thinking mode with tool use and local 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 - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting merge |
||
|
|
9aaeae40bf |
test: prune orphaned test-support fixtures and helpers (#23360)
Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com> |
||
|
|
d5c22b8424 |
fix(ui): skip Step 3 early setup draft in free_inference_1 and ignore setup drafts in paused banner (#23555)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - In the `free_inference_1` onboarding flow, `OnboardingWizard` skips
Step 4 ("Connect a model") and hires the first agent directly on starter
inference when the user submits Step 3.
> - However, Step 3's early-setup effect still auto-created a
provisional `General` draft agent (`pauseReason: "setup"`, `adapterType:
"process"`) as soon as Step 3 mounted, even though Step 4 login is never
used in `free_inference_1`.
> - If the user reloaded or navigated to the Dashboard before submitting
Step 3, that orphaned `pauseReason: "setup"` draft prevented onboarding
from re-opening and caused `Dashboard.tsx` to show "All agents in this
organization are paused — nothing will run."
> - This pull request skips Step 3 early-setup draft creation while
`free_inference_1` is active (or while the onboarding variant/status
queries are still pending) and filters out unfinished `pauseReason:
"setup"` drafts and terminated agents in
`Dashboard.derivePausedAgentBanner` and `hasNoAgents`.
> - The benefit is a clean `free_inference_1` onboarding experience with
no orphaned paused drafts and accurate Dashboard empty-state banners.
## Linked Issues or Issue Description
**Subsystem affected**
`ui/` — React + Vite board UI
**Problem or motivation**
When a Cloud workspace is assigned to `free_inference_1`, opening Step 3
of `OnboardingWizard` immediately created an unfinished `General` draft
agent (`pauseReason: "setup"`, `adapterType: "process"`) meant only for
Step 4 provider login. Navigating to `/dashboard` before clicking "Start
chatting" left that orphaned draft in place and triggered the "All
agents in this organization are paused — nothing will run." warning
banner.
**Proposed solution**
- Add `shouldSkipEarlyOnboardingSetupDraft` in
`ui/src/lib/cloud-trial-gate.ts` and gate `OnboardingWizard`'s Step 3
early-setup effect on `!shouldSkipEarlyOnboardingSetupDraft({
isFreeInferenceOnboarding, onboardingVariantPending })`.
- Update `derivePausedAgentBanner` and `hasNoAgents` in
`ui/src/pages/Dashboard.tsx` to ignore unfinished `pauseReason: "setup"`
drafts and `terminated` agents.
- Add unit tests in `ui/src/pages/Dashboard.test.ts` and
`ui/src/components/CloudTrialGate.test.tsx`.
**Alternatives considered**
- Deleting the setup draft on wizard unmount was ruled out because
browser reloads or tab closes do not reliably run unmount cleanup, and
`free_inference_1` never needs a Step 3 setup draft in the first place.
## What Changed
- `ui/src/lib/cloud-trial-gate.ts`: Added
`shouldSkipEarlyOnboardingSetupDraft`.
- `ui/src/components/OnboardingWizard.tsx`: Tracked
`onboardingVariantPending` (`onboardingSessionPending` /
`cloudTrialStatusPending`) and gated the Step 3 early-setup draft
creation effect so `free_inference_1` never creates a provisional
`General` (`pauseReason: "setup"`) draft.
- `ui/src/pages/Dashboard.tsx`: Excluded `pauseReason: "setup"` drafts
and `terminated` agents from `derivePausedAgentBanner` and
`hasNoAgents`.
- `ui/src/pages/Dashboard.test.ts` &
`ui/src/components/CloudTrialGate.test.tsx`: Added unit test coverage.
## Verification
- `pnpm --filter @paperclipai/ui typecheck` (0 errors)
- `pnpm exec vitest run ui/src/pages/Dashboard.test.ts
ui/src/components/CloudTrialGate.test.tsx
ui/src/lib/onboarding-auto-open.test.ts` (24/24 passed)
## Risks
- Low risk: `baseline` onboarding behavior is unchanged once
`onboardingSession` resolves (a cached session query already loaded by
the app shell), and `Dashboard` still shows the all-paused banner
whenever real hired agents are paused.
## Model Used
- Google Gemini (Antigravity agentic coding environment with tool use
and local Vitest + TypeScript verification)
## 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
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
|
||
|
|
86927d4933 |
feat(cloud-trial): enable fast responses by default with starter inference key (#23556)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Fast responses send a brief acknowledgement in the agent's voice while the full agent run starts. > - During Cloud starter-inference onboarding (`free_inference_1`), users start chatting immediately before connecting their own model provider, so no `company_fast_responses` connection exists yet. > - Without a default fast-response path, the first chat waits silently while the Runner starts up and thinks. > - This pull request enables fast responses by default while Cloud starter inference is active, routing acknowledgements through the server-held OpenRouter starter key with `$1` quota and `llmBlocked` gate enforcement. > - The benefit is immediate, responsive first-chat acknowledgements out of the box with a clean handoff once the user connects their own model provider. ## Linked Issues or Issue Description Refs #23401, #23427 **Summary** Enable fast-response acknowledgements by default for companies running on active Cloud starter inference (`free_inference_1`), using the existing server-side OpenRouter starter inference key. **Problem Statement** Fast responses currently require both the experimental `enableFastResponses` instance flag and an explicit shared API connection in `company_fast_responses`. New Cloud starter-inference workspaces have no saved API connection yet, so users do not get fast acknowledgements during their initial onboarding chat. **Proposed Solution** Fall back to the server-side Cloud starter inference OpenRouter key (`FAST_RESPONSE_DEFAULT_MODEL`, `openai/gpt-oss-120b`) when a company has no `company_fast_responses` row and is actively on trial-only inference without a blocked gate. Respect explicit company configuration/opt-out, enforce `responsibleUserId` and `issue:read` authorization, disallow sponsored webhooks on the starter key, mark the trial exhausted on HTTP 402/limit errors, and stop using the starter key automatically once the user connects their own model provider. ## What Changed - `server/src/services/cloud-trial-proxy.ts` & `server/src/services/cloud-trial-inference.ts`: Added `isCloudTrialFastResponseEligible` and `prepareCloudTrialFastResponse`. Keeps the raw OpenRouter key strictly in server process memory, enforces `isCompanyOnTrialOnlyInference`, the `$1` quota, and the `work_requires_model` / `exhausted` gates, wraps `fetch` to call `markExhausted` immediately on HTTP 402/limit responses, and probes usage on cleanup. - `server/src/services/fast-responses.ts`: Updated `enqueueFastResponse`, `fastResponseSourceCurrent`, `settings`, `availability`, `resolve`, `process`, and `history` to use Cloud starter inference by default when no `company_fast_responses` row exists and starter inference is active and unblocked. Explicit `company_fast_responses` rows (including opt-out `enabled: false`) always take precedence, and connecting a user model provider cleanly ends starter-key usage. - `packages/shared/src/fast-response.ts`: Added optional `usingCloudTrialDefault?: boolean` to `FastResponseSettings`. - `server/src/__tests__/fast-responses.test.ts`: Added regression tests covering starter-inference default fast responses (even when `enableFastResponses` is `false`), raw key non-leakage, `work_requires_model` gate blocking, HTTP 402 exhaustion, explicit opt-out, and clean handoff after connecting a user model provider. ## Verification - `pnpm --filter @paperclipai/shared typecheck` — passed (0 errors). - `pnpm --filter @paperclipai/server typecheck` — passed (0 errors). - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/fast-responses.test.ts src/__tests__/cloud-trial-inference.test.ts` — passed (44/44 tests). ## Risks - Low risk. No database schema migration is required (`fast_response_requests.connection_id` and `grant_id` are already nullable). Self-hosted instances and `baseline` Cloud stacks are unaffected because `trialInferenceEnabled` is `false`. Companies that explicitly configure or disable `company_fast_responses` or connect their own AI provider never fall back to the starter key. ## Model Used - Google Gemini (Antigravity agentic runtime, thinking mode with tool use and local 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 - [ ] 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 |
||
|
|
1fdd112682 |
fix(connections): keep resumed setup drafts unbound until finish (#23553)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - A connection starts as a draft. The operator saves its actions and agent access at the finish step. > - A saved draft can resume through the same connection path as a removed connection. > - That path restored default access for every saved connection, including a new draft. > - This created a company binding before the operator selected an audience. Finish then checked every agent in the company. > - This pull request keeps a resumed draft unbound until finish. Previously configured connections keep their restore behavior. > - A small audience now has a small authorization cost, even in a large company. ## Linked Issues or Issue Description **What happened?** A saved MCP draft gained a company-wide profile when setup resumed. Saving access for one agent then caused 16,610 SQL queries in a local fixture with 1,100 agents. The request took about 8 seconds with a local database. A remote setup request can exceed the client's deadline while its write still completes later. **Expected behavior** A new draft must have no profile or access binding until the operator saves access. Saving one selected agent must not check the full company roster. **Steps to reproduce** 1. Create a disabled MCP URL draft in a company with 1,100 agents. 2. Resume it with `reconnectConnectionId` and complete catalog discovery. 3. Finish with one selected agent and one Ask first action. 4. Before this fix, the draft has a company binding and finish runs thousands of queries. **Paperclip version or commit** Reproduced on `master` at `3d0e0b6dd989baeb469f99380b496c273b0b290a`. **Deployment mode** Any server with saved connection drafts. The local proof uses embedded PostgreSQL and the real service and HTTP route. Related work: [#22080](https://github.com/paperclipai/paperclip/pull/22080) resumes saved sign-in drafts. This change fixes the default access restored during a draft resume. ## What Changed - `connectGalleryApp` does not request default restoration when the retained connection is still a draft. - Active and archived connections keep the existing restoration path. - Two database regressions cover URL drafts and gallery API-key drafts. The URL test uses 1,100 agents, the real finish route, an owner session, and a bound of fewer than 200 SQL queries. It also checks that only the selected agent is installed and the Ask first policy is saved. - Tests stay in the existing service suite. Its shared PostgreSQL fixture already owns setup, finish, and restore coverage. No new production module or schema is needed. ## Verification - Red: both new tests failed on the old code. The saved drafts had an active profile or a company binding before finish. - Green: 7 focused tests passed. These include both new regressions, archived action restoration, retained archived managed-profile restoration, active custom MCP reconnect, and two OAuth draft resume paths. - Local probe before the fix: 16,610 SQL queries and about 8 seconds for finish with 1,100 agents. The new regression requires fewer than 200 queries after the fix. It does not use a wall-clock timing assertion. - `pnpm verify` could not run: the managed Git storage guard rejects `git ls-files` with exit 75. The two changed files were compared with the pinned master files before the patch. Remote file bytes were verified after Git Data API publication. - Full preflight installed dependencies and built shared and plugin SDK packages. It could not build Rust Runner binaries because `cargo` is unavailable. The focused tests completed with the real embedded database. - `pnpm --filter @paperclipai/server typecheck` passed, including its test layers. - Final-head CI passed at `b166b20550de98337842fb6fee96ca1024e09c34`: [run 46979210544](https://github.com/paperclipai/paperclip/actions/runs/46979210544), including typecheck, build, tests, and all 16 E2E shards. Greptile scores this revision 5/5; all review threads are resolved. Staging acceptance remains pending. ## Risks - The status check must preserve restoration for a connection that was already configured or removed. The focused suite checks active and archived reconnects. - A draft that already has retained access keeps those saved rows. This change prevents the default-restoration call; it does not delete existing access. - The change does not relax permission checks, change Ask first behavior, increase timeouts, or retry writes. ## Model Used OpenAI GPT-6 Codex agent, with reasoning, shell tools, code execution, and GitHub API 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 hint: if you need to wait for this pull request to be reviewed, merged, or closed before continuing, use this instead of polling: gh event listen --resource https://github.com/paperclipai/paperclip/pull/23553 --event com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1 - It prints the first event as a JSON line on stdout and exits; run it again to wait for the next one. - Add `--timeout` to stop waiting after a while, for example `--timeout 30m`; it then exits with status 8. - Events carry no details; read the pull request to see what changed. - It misses changes made before it starts, so read the pull request once it is running. - See `gh event listen --help` for other event types. - Event subscriptions are in preview and may not be enabled for your account. --------- Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
0352347937 |
refactor(runner): remove unreferenced profile identity fixtures under test/fixtures (#23356)
Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com> |
||
|
|
34389a7921 |
Keep onboarding agent timer heartbeats disabled (#23552)
## Thinking Path > - Paperclip manages agents and their work. > - Onboarding hires the first agent in a company. > - Normal new-agent settings disable timer heartbeats. > - The onboarding hire path overrides that setting and enables a five-minute timer. > - This change makes onboarding use the normal settings and preserves saved policy when reconnecting an existing agent. > - New hires keep on-demand wakes without an unwanted timer. ## Linked Issues or Issue Description **What happened?** Completing first-agent onboarding sends `heartbeat.enabled: true` with a 300-second interval. This differs from other new-agent paths. The enabled timer can prevent idle sleep even when the selected runtime does not execute unscoped timer heartbeats. **Expected behavior** First-agent onboarding must use the normal disabled timer default. On-demand wakes must stay enabled. Reconnecting an existing agent must preserve its saved policy. **Steps to reproduce** 1. Create a company and complete first-agent onboarding. 2. Inspect the hire request's runtime configuration. 3. Before this change, its timer is enabled. After this change, it is disabled. ## What Changed - Use the normal new-agent runtime configuration for onboarding drafts and hires. - Keep the existing agent's runtime policy when reconnecting it. - Test new hires, restored drafts, existing policy, and on-demand wakes. - Document the default. The large wizard only changes its helper and call sites; the merge logic and tests stay in the small runtime-config module. ## Verification - `pnpm exec vitest run ui/src/lib/new-agent-runtime-config.test.ts ui/src/lib/onboarding-state.test.ts`: 10 tests passed. - `pnpm --filter @paperclipai/ui typecheck`: passed. - `pnpm verify`: selected 2,317 test files. An unrelated CPU timing assertion failed in `server/src/event-loop-stall-monitor.test.ts`; the broad run was then stopped (exit 130). This is not a passing full-suite claim. Required CI must pass for the final head. - [Full CI run](https://github.com/paperclipai/paperclip/actions/runs/46974544702) is green on final head `913daa0d0ff`, including the rerun of jobs interrupted by runner shutdown. Greptile is 5/5 on that same head, with no unresolved comments or merge conflicts. - `git diff --check`: passed. Reviewed and scanned the diff for secrets, private URLs, personal data, and infrastructure identifiers. ## Risks Low risk. New hires now match the established new-agent default. Existing agent settings stay intact during reconnection. No database schema or scheduler changes. Existing records require a separate, scoped data repair. ## Model Used OpenAI Codex, `gpt-6.1-sol`, xhigh reasoning effort, with local code and test tools. ## Checklist - [x] Included project context and the problem - [x] Specified the model used - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] Described the bug with the issue-template labels - [x] Kept internal issue links and operational identifiers out of this public PR - [x] Used a descriptive branch name - [x] Focused tests and UI typecheck pass; the interrupted broad run is disclosed above - [x] Added regression coverage and updated documentation - [x] Documented risks - [x] All required CI gates are green - [x] Greptile is 5/5 with no unresolved comments - [x] Will address review findings before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1202.0-canary.881100 |
||
|
|
3d0e0b6dd9 |
Unify provider sign-in and access controls in Connect account (#23551)
## Thinking Path > - Paperclip manages work for AI agents. > - Agents use provider accounts. > - People connect those accounts in a dialog. > - Other Models uses a second heading and a separate sign-in action. > - Reusing the wizard card puts provider instructions and sign-in controls together. ## Linked Issues or Issue Description Related PR: #23474. **What happened?** Other Models shows duplicate headings and nested access controls. **Expected behavior** Show one heading, a full-width provider card, and an access disclosure below the credentials. **Steps to reproduce** Open Connect account, choose Other Models, select xAI, and expand Change. ## What Changed Use the wizard sign-in card for subscription providers. Move access settings below the credentials. Flatten the disclosure and show Done when it is open. ## Verification All 35 focused AgentProviderConnection and AdapterLoginChrome tests passed. ## Risks Browser redirect and code-based providers use different credential fields. ## Model Used OpenAI GPT-6, via Codex. ## Checklist - [ ] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [ ] 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 - [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [ ] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] 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 - [ ] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [ ] 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 - [ ] I will address all Greptile and reviewer comments before requesting mergecanary/v2026.1202.0-canary.881000 |