mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-26 10:07:24 +01:00
82c3144dee05e667a8bfb9efc48f03d95097d2c5
8566
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
82c3144dee |
fix(antigravity): leave out patterns RE2 cannot compile and guard every served tool
A guard test now runs every Paperclip tool schema the swarm route serves through an RE2 compatibility check. It found a second pattern the Antigravity CLI would refuse: create_project's repository URL uses a lookahead. A pattern with no RE2 form (lookaround, backreference, lone surrogate) is left out of the copy served to the CLI; the Runner still validates calls against the original schema. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0f2d40e464 |
fix(antigravity): serve the swarm CLI RE2-portable tool schemas
Live /swarm (run c49211c7, after the session.open fix) opened the pinned
CLI, which then refused its whole toolbox before any prompt:
"tool mcp_paperclip_list_document_revisions advertises an invalid
parameter schema". The CLI checks schemas with RE2, and the task document
key pattern uses ECMAScript \uXXXX escapes, which RE2 does not accept.
- The tool bridge can serve a client RE2-portable patterns (\x{...});
the swarm route turns it on. Calls are still validated against the
original schemas, so accepted inputs do not change.
- The CLI reports such failures as "agent executor error" text and ends
the turn normally; the swarm turn now fails in plain words instead of
completing with no result (which the server retried as an interruption).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
fc81774086 |
fix(antigravity): decide the swarm under the task lock the /swarm save takes
Swarm selection read the newest recorded request, attempts and Retry before locking the task row, so a newer /swarm committing while selection waited for the lock could still let the older, replaced request start. Every decision input is now read on the transaction that holds the task row lock (the same lock the comment-and-record save takes) and records the selection. Runs with no recorded request still skip the lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8dab083135 |
fix(antigravity): a newer /swarm replaces an older one; document the swarm comment
- In a wake carrying several user comments, the newest recorded /swarm runs as the swarm with only its own text. An older recorded /swarm is replaced: it counts as handled and never runs, as a swarm or as ordinary work. Ordinary comments are re-queued for an ordinary run. Re-queued requests keep their swarm marker. - docs/api/issues.md documents `nativeCommand: "swarm"` on the comments endpoint: who may send it and each refusal, which saves no comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
83d933743f |
fix(antigravity): keep merged comments queued and a stopped swarm stopped
Review follow-ups: - A swarm run sends only its recorded /swarm request, so it now counts as delivering only that comment. Other user comments merged into its wake (older or newer) are saved as their own waiting request and a following ordinary run delivers them. - A Retry counts for a swarm only when it started that run and was made after the last attempt and the latest Stop. A click joined to a swarm that was still running no longer restarts it after the user stops it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a11d23a7e9 |
style(runner): rustfmt the sidecar rejection tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3cbfa500f4 |
Merge origin/master into feat/antigravity-swarm-command
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * origin/master: refactor(plugin-sdk): remove archivedState from the resume result (#22443) refactor(runner): let the provider decide whether a released Runner relaunches (#22442) fix(connections): drop MCP wording and the MCP guide link from Google Workspace setup (#22793) fix(ui): defer the Connectors announcement until a return visit (#22790) fix(connections): show only the privacy policy link in the Google Workspace picker (#22795) Add count, newest-first and lean run reads to customer-success inspection (#22781) fix(connections): keep a finished setup checklist on screen when the app refreshes queries (#22715) perf(ci): Phase 2 PR CI under 4 minutes (dynamic workers, fast E2E boot, typecheck overlap, test-budget gate) (#22729) fix(plan-mode): open the plan review card when a Plan-mode run settles without one (#22732) |
||
|
|
1b3fcb46ff |
fix(antigravity): a startup retry after a never-opened candidate session starts fresh
After a candidate session.open failed, each same-run startup retry met the first launch's provider state in the run-scoped runner root (lifecycle closed, no identity, no turn) and runnerd refused it: "ACPX candidate cannot adopt a prior durable runner activation". Every attempt and every follow-up run ended that way instead of reporting the real cause. Before a local same-run bootstrap, the server now retires that root only when it provably never opened a provider session (this run's identity, no provider identity, no turn, no pending events, requests or calls, provider exit confirmed, no live runner process). Any root that opened a session is kept and the runner's candidate gate still refuses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4f26416e1c |
fix(antigravity): the CLI's own state directory is not a swarm escape
A real swarm whose coordinator loads the swarm_pane skill writes its plan with write_file to <gemini-dir>/antigravity-cli/brain/<session>/ .system_generated/swarm/plan.json, inside the private state directory Paperclip gives the CLI. The outside-change guard treated that as a write outside the task folder and stopped the swarm (3 of 7 recorded turns). The guard now exempts exactly this run's --gemini-dir, resolved through symlinks and `..`, for file tools and shell writes alike. A sibling of it, a `..` escape, a symlink out of it and the real ~/.gemini still stop the swarm; the fake CLI covers the plan turn and each negative. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3d4cf276fa |
fix(runner): a sidecar session.open refusal keeps its code and reason
The live /swarm failure was undiagnosable: the Runner composed "classification=unclassified" and dropped the sidecar's code and message, so nothing in run events, logs or state said why. - The Runner classifies the typed /swarm refusals (antigravity_swarm_*), candidate_admission_invalid and sidecar_request_invalid instead of "unclassified". - A rejected command keeps the sidecar's own code, and its redacted, bounded message when no typed provider cause was sent, as `sidecarRejection` on the failed command result (run error). The rejection text stays closed; provider text still travels only in providerFailure. - The server settles a typed /swarm refusal at session.open as antigravity_swarm_unavailable (waits for the user, no same-run retry) and a request-contract or grant refusal as a startup rejection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1a97dfe821 |
fix(antigravity): a granted /swarm session.open reaches the swarm route
Live /swarm runs failed 5-7 s after start with provider_session_open_rejected (classification=unclassified). Driving the built sidecar exactly as runnerd does (cleared environment, candidate grant, provider mode "swarm") returned the sidecar's own refusal: "mode is supported only for Cursor". The open-params parser predates the provider mode adapter registry and accepted a mode only for Cursor, so every swarm session.open was refused before the swarm route ran. The in-process probe called AcpxRuntimeHost.open directly and never met this parser. The parser now asks the adapter registry (resolveAcpxProviderMode), which already admits exactly Cursor's modes and Antigravity's "swarm". Its own contract refusals carry ACPX_SIDECAR_REQUEST_INVALID, and the typed /swarm refusals and the candidate admission refusal keep their codes across the sidecar boundary instead of collapsing to acpx_sidecar_command_failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
53b9d7440d |
fix(antigravity): a refused /swarm waits for the user instead of retrying
Live proof found a refused swarm (after the automatic attempt cap) failing as adapter_failed, so transient retry and continuation recovery started a new run every minute or two, each refusing again. A swarm refusal now settles with its own non-retryable code, antigravity_swarm_unavailable, which bounded retry, continuation recovery and the issue-comment policy all leave for the user (send /swarm again, or Retry). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3ca9b6d471 |
refactor(plugin-sdk): remove archivedState from the resume result (#22443)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Native Runner sessions can run in a remote environment task that a plugin provider owns > - A provider can relaunch a parked Runner as the next run, and it reports the result to Core > - The resume result could carry `archivedState`, so Core could check that the park was a settled cut > - #22442 makes the provider the authority on the park, and Core stops reading `archivedState` > - This pull request removes the field from the SDK result schema > - The benefit is a smaller provider contract with no unused fields ## Linked Issues or Issue Description Refs #22442 **What existing behavior does this improve?** The environment task resume result contract in the plugin SDK. **Subsystem affected** `packages/plugins/sdk` (environment tasks), and the tests in `server/src/services/native-runtime` that build resume results. **Current behavior** After #22442, a resumed relaunch result can carry an optional `archivedState`. Core accepts it and does not read it. **Proposed behavior** The resume result has no `archivedState` field. The strict schema refuses it. **Reason and benefit** The field has no reader. Removing it keeps the contract to the fields that Core uses. **Breaking changes** A provider that still sends `archivedState` on a resume result fails the schema check, and the relaunch fails. Deploy this with or after the provider change that stops sending the field. **Additional context** Stacked on #22442. ## What Changed - SDK: removed `archivedState` from the `resume` result schema, and simplified the relaunch check in `parseEnvironmentTaskResult`. - SDK test: a relaunch result with `archivedState` now fails; one without it passes. - `plugin-runner-task.test.ts`: removed the field from the fixtures, and removed the test that checked Core ignores it. - `plugin-runner-release-resume.integration.test.ts`: the fixture provider no longer returns the field. - `doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md`: removed the note about the field. ## Verification - `pnpm run typecheck` in `server` (builds all dependent packages): pass. - `pnpm vitest run src/services/native-runtime/plugin-runner-task.test.ts` in `server`: 116 passed. - `pnpm vitest run tests/environment-task-release-resume.test.ts` in `packages/plugins/sdk`: 48 passed. - I did not run the embedded-Postgres integration suite locally. CI runs it. ## Risks - A provider that still sends the field makes the relaunch fail. Deploy this with or after the provider change that stops sending it. It can ship in the same deploy as #22442. - Low risk otherwise: the change removes an unused optional field. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), through Claude Code with tool use (shell, file edit, code search). Extended thinking on. ## 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 - [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: Paperclip <noreply@paperclip.ing> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0b2acfb956 |
refactor(runner): let the provider decide whether a released Runner relaunches (#22442)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Native Runner sessions can run in a remote environment task that a plugin provider owns > - After a turn, the provider can park the Runner, and the next run can relaunch it from the saved state > - Core kept its own local record of each released Runner, and the provider kept its park record too > - Core lost its copy when the local session directory was not durable. Then Core restored from a checkpoint although a park existed, and the turn was slower > - This pull request makes the provider the only authority on the park. Core resumes the source from its durable checkpoint, and the provider answers "resumed" or "unavailable" > - The benefit is fewer missed relaunches, and less code in Core ## Linked Issues or Issue Description **What existing behavior does this improve?** The relaunch of a parked Runner for the next run of a native session. **Subsystem affected** Native runtime: `server/src/services/native-runtime`, the Runner control plane in `packages/paperclip-runner`, and the environment task SDK. **Current behavior** Core writes a released-Runner record (source identity, task id and scope digest) to the local session directory when a release completes. Core relaunches a parked Runner only when that record exists. Core also checks the archived Runner state on the provider's relaunch reply. When the local directory is gone (for example, after the server process restarts on a new host), Core restores from a checkpoint into a fresh task, although the provider still has the park. **Proposed behavior** Core resumes the source identity from its durable controller checkpoint on the lease's current task. The provider decides from its own park record. When no park of that source exists, the provider answers `unavailable`, and Core starts a fresh task from the saved session, as it does today for other unavailable answers. **Reason and benefit** One record for one fact. Core no longer needs local state to relaunch, so more runs relaunch. The change removes about 160 lines. **Breaking changes** A provider must answer `unavailable` when it has no park for the requested source. A provider that answers with an error instead makes the resume fail. The `archivedState` field on a resumed relaunch result becomes optional. Providers can continue to send it; Core does not read it. **Additional context** Reattach to a live Runner process in the same server is not changed. A relaunch after a restart still requires the process configuration to match, because the relaunch reuses the parked launch. A changed configuration starts a fresh task. ## What Changed - Removed the local released-Runner record: its writer, its readers, the scope digest, and the resume and retire callbacks that cleared it. - Derived the relaunch source from the durable Runner identity. Kept the check that the task is the lease's current task. - After a restart, Core takes the released source from the durable identity for every provider that releases tasks: one that relaunches the parked Runner, and one that hands it over. - Added a test that a checkpoint saved with the old released-Runner record still loads. - When a restart recovery resumes a released source and the provider answers `unavailable` with the task stopped and its state saved, Core now starts a fresh task from the saved session, as it does for a relaunch. The fallback finishes the old task's startup context before it inspects the replacement task. An executor test covers this path. - Updated the SDK source pin in `tests/runner-e2e/source-sdk-public-inputs.json`. - Stopped the check of the archived state on the relaunch reply. Removed `isSettledReleasedRunnerCut` and the resume `settled` hook. - SDK: a resumed relaunch result no longer requires `archivedState`. - Updated `doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md` and the tests. ## Verification - `pnpm run typecheck` in `server` (builds all dependent packages): pass. - `pnpm vitest run src/services/native-runtime/plugin-runner-task.test.ts src/services/native-runtime/remote-warm-session-recovery.test.ts` in `server`: 147 passed. - `pnpm vitest run src/services/native-runtime/native-session-executor.test.ts -t "releases settled|accepts only the attached|released|relaunch|warm|unavailable|recover"` in `server`: 594 passed. - `runnerd-codex-transport.test.ts` in `packages/paperclip-runner`: 337 passed. - SDK release and resume tests in `packages/plugins/sdk`: 48 passed. - `runnerd-codex-transport-release-resume.test.ts -t relaunched` in `packages/paperclip-runner`: 3 passed. `pnpm run typecheck` in `packages/paperclip-runner`: pass. - `tests/runner-e2e/source-sdk-public-inputs.test.mjs`: 13 passed. - `plugin-runner-release-resume.integration.test.ts -t "completes claude runs through a retained adopted process"`: pass. I did not run the rest of the two embedded-Postgres integration suites locally. CI runs them. ## Risks - A provider that does not answer `unavailable` for a missing park makes the resume fail. Deploy the provider change first, or in the same deploy before this Core version takes traffic. This PR and #22443 are one stack and can ship in one deploy. - A server restart now relies on the existing unavailable-reuse fallback to start a fresh task. Tests cover this path. - Medium risk overall: the change is in the warm-session path. The cold path is not changed. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), through Claude Code with tool use (shell, file edit, code search). Extended thinking on. ## 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: Paperclip <noreply@paperclip.ing> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8b616b949d |
fix(connections): drop MCP wording and the MCP guide link from Google Workspace setup (#22793)
<!-- 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 > - Agents use Google Workspace through the built-in Google Workspace connection > - Since #22634, Gmail, Drive, Docs, Sheets, Slides, and Calendar run on Paperclip's own REST tools, not on Google's hosted MCP servers > - The connect screen still showed "Secure MCP sign-in" and a "Review requirements" link to Google's MCP servers guide > - This text is wrong for this connection, it is internal jargon, and Google's OAuth reviewers read this screen > - This pull request removes the MCP wording and the MCP guide link from Google Workspace setup and from its audit details > - The benefit is that users and reviewers see only true, plain text for this connection ## Linked Issues or Issue Description Refs #22634 **What happened?** On a Cloud workspace, the Google Workspace connect page showed the subtitle "Secure MCP sign-in" while the sign-in opened and after it failed to open. The setup page also showed a "Review requirements" link to `developers.google.com/workspace/guides/configure-mcp-servers`. On a self-hosted instance, the "How to set up a Google OAuth client" link went to the same MCP servers guide. Audit details for a Google REST call showed "Transport: mcp_remote" and "MCP method: tools/call". **What did you expect to happen?** The connect page says "Secure sign-in". The Paperclip-managed method on Cloud has no requirements link, because the user has no requirements to review. On a self-hosted instance, the customer-owned client method links to Google's OAuth client guide. Audit details for a Google REST call do not show MCP terms. **Steps to reproduce** 1. Turn on the Google Workspace connector in **Settings → Experimental**. 2. Open **Apps** and choose **Google Workspace**. 3. Start the sign-in, then close or block the sign-in window. 4. Before this change: the header shows "Secure MCP sign-in", and the setup step shows "Review requirements" with a link to Google's MCP servers guide. ## What Changed - `ui/src/features/connections/ConnectionSetupFlow.tsx`: `OAuthConnectStateScreen` shows "Secure sign-in" for a curated app. A server that the user pasted as an MCP server keeps "Secure MCP sign-in". This is generic: there is no Google-specific code. - `packages/shared/src/app-definitions/google-workspace.json`: remove the top-level `docsUrl` (the MCP servers guide). The Paperclip-managed method now has no "Review requirements" link. The customer-owned method's `consoleLinks.docs` is now Google's OAuth client guide (`create-credentials#oauth-client-id`). The "Review requirements" link and the self-hosted "How to set up a Google OAuth client" link both use it. Its guidance text names the Gmail, Drive, Docs, Sheets, Slides, and Calendar APIs instead of "the Google Workspace MCP APIs". This file is a reviewed definition: `scripts/ingest-app-definitions.mjs` copies it as-is, so a regeneration keeps the fix. - `server/src/services/tool-gateway.ts`: an audit record for a Google Workspace REST call no longer has `mcpMethod`. - `ui/src/pages/tools/AuditTab.tsx`: audit details show the connection type label ("Remote HTTP") as "Type" instead of the raw `mcp_remote` value. This uses the same label as the connection's "Connection details". - `doc/connections/GOOGLE-WORKSPACE.md`: the self-hosted section links Google's OAuth client guide. - `tests/runner-e2e/source-sdk-public-inputs.json`: refreshed pinned inputs. ## Verification - Red first, then green: - `packages/shared/src/google-workspace-setup-links.test.ts`: no Google Workspace method links the MCP servers guide, the managed method has no requirements link, the customer method links the OAuth client guide, and method text has no "MCP". It failed 4/4 before the fix. - `ui/src/features/connections/OAuthConnectStateScreen.google.test.tsx`: in the preparing, opening, and "couldn't open the sign-in window" states, the Google Workspace screen shows "Secure sign-in", no "MCP", and no link to `configure-mcp-servers`. A pasted server keeps "Secure MCP sign-in". It failed 3/4 before the fix. - `server/src/__tests__/google-workspace-rest-transport.test.ts`: the Gmail REST audit record has no `mcpMethod`. It failed without the server change. - `npx vitest run` for shared app definition tests (67 passed), `ui/src/pages/tools` and `ui/src/pages/apps/app-detail` (121 passed), and the server REST transport file (53 passed). - `tsc --noEmit` for `server` and `ui`: no new errors. - `pnpm verify` exits 2 because a doc under `doc/connections` is a global CI input. Required CI supplies the broad coverage. ## Risks - Low risk. Text and link changes only, plus one optional audit field. - Other curated OAuth apps now show "Secure sign-in" instead of "Secure MCP sign-in" on the sign-in state screen. The new text is true for every curated app. - Audit details for all connectors show "Type: Remote HTTP" instead of "Transport: mcp_remote". - Saved Google Workspace connections still show `https://workspacemcp.googleapis.com/mcp/v1` as the address in "Connection details". It is the stored connection identity. This pull request does not change stored data. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), Claude Code 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 - [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> |
||
|
|
d01d3c40ad |
fix(ui): defer the Connectors announcement until a return visit (#22790)
## Thinking Path > - People use Paperclip to manage AI agents at work. > - New users now meet their agent in chat after setup. > - The Connectors card previously checked for an open onboarding task. > - Chat-first onboarding creates no such task, so the card could appear three seconds into a first visit. > - This change holds that promotion until the person returns after 30 minutes of inactivity. ## Linked Issues or Issue Description Refs: #19514, #22077 **What happened?** On master at `11cfe0910d`, a new user could see the Connectors card in their first agent chat. **Expected behavior** The card stays hidden through the first visit and can appear when the user returns after a 30-minute gap in activity. **Steps to reproduce** With the Connectors announcement active, finish chat-first onboarding in a fresh browser profile and wait for the announcement delay. ## What Changed - Track the first visible board visit per account in browser storage. Local input and visits in other tabs extend the first session. After the first qualifying return, the browser remembers eligibility and stops tracking input. - Apply this rule to the published Connectors announcement ID. The existing checks for dismissal, open dialogs, and legacy onboarding tasks still apply. - Exercise the onboarding chat, reload, idle return, account isolation, and activity in another tab. ## Verification - Before the fix, the Vitest regression displayed `2026-09-14-connectors` on the first visit. - The announcement and workspace identity Vitest suites passed locally (28 tests). The UI typecheck passed. - Chromium passed all four tests in `announcement-first-session.spec.ts` and `announcement-placement.spec.ts` against a local test server. - A second red-green regression covers dismissal in another browser while the first tab sits idle. The return triggers a fresh check and keeps the card hidden until it succeeds. - At `8fab1932fa`, GitHub reported 73 successful checks and three skipped checks. [CI run](https://github.com/paperclipai/paperclip/actions/runs/45449353624) ## Risks A new browser profile or cleared site data starts the visit history again. Storage failures keep the Connectors card hidden. Existing users start accumulating visit history when they first use this version. ## Model Used OpenAI Codex, GPT-6.2 Astra (`gpt-6.2-astra`), with shell, Vitest, and Playwright. ## 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> Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
6385c171fa |
fix(connections): show only the privacy policy link in the Google Workspace picker (#22795)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The built-in Google Workspace connection lets agents use Gmail, Drive (with Docs, Sheets and Slides) and Calendar > - Before Google consent, the user chooses services in the "Connect Google Workspace" picker > - On Nov 17, #21998 added two text sections to this picker: "What agents can do" and "How your data is used" > - On Nov 24, the owner decided that this screen must show only the privacy policy link and no other explanatory text > - This pull request removes the two sections and keeps the privacy policy link directly under the service rows > - The benefit is a short picker that matches the owner decision, for new setup and reconnect, in the Apps flow and the task-hosted flow ## Linked Issues or Issue Description Refs #22634 **What happened?** The "Connect Google Workspace" picker shows a "What agents can do" section and a "How your data is used" section with bullet sentences. The text changes with the selected services. The owner does not want this text on the screen. **What did you expect to happen?** The picker shows the title, the three service rows (each with its access select and switch), the privacy policy link, and Cancel / Continue. It shows no other explanatory text for any selection. **Steps to reproduce** 1. Open Apps and start a Google Workspace connection, or reconnect an existing one. 2. Look at the service picker with all services on, with read only, and with one service on. 3. See the two text sections above the footer. ## What Changed - `ui/src/features/connections/GoogleWorkspaceServices.tsx`: remove the `DataUseDisclosure` block. The privacy policy link ("Read our privacy policy, including how we meet Google's Limited Use requirements", `https://paperclip.ing/privacy`, new tab) now sits directly under the service rows for every selection, including no selection. The "Select at least one service to continue." status stays. The screen-reader description "Choose the Google services to connect." stays. The URL constant `GOOGLE_WORKSPACE_PRIVACY_POLICY_URL` moves into this file. - `ui/src/features/connections/googleWorkspaceDisclosure.ts`: deleted. Nothing else used the copy builder. - `ui/src/features/connections/GoogleWorkspaceServices.test.tsx` (new; the earlier suite was removed in #22729): for all services read & write, all read only, one service, and no service, the dialog has no section headings, no lists and none of the removed sentences. The link has its text, href and new-tab target. The dialog keeps its accessible description. Continue stays disabled with no service and submits the chosen services. - `ui/storybook/stories/connection-setup/google-workspace-services.stories.tsx`: the `ProductionPickerReadOnly` play test now checks that the removed text is absent and the link is present. - Docs: `doc/memory/google-connector-memory.md` gets a dated Nov 24 decision row with the risk. `doc/plans/2026-11-17-google-workspace-production-checklist.md` no longer claims a disclosure in the picker. `doc/plans/2026-11-17-google-workspace-code-fixes.md` item 1 records the removal. The dialog now contains, from top to bottom: the Google Workspace logo and the title "Connect Google Workspace"; Gmail, Drive ("Docs, Sheets, and Slides") and Calendar rows, each with a "Read only / Read & write" select and a switch; the privacy policy link; the empty-selection status (only with no service on); Cancel and Continue in one footer row. ## Verification - Red first: the new test ran against the old picker and 4 of 5 tests failed (removed text present; link absent with no selection). After the change all 5 pass. - `cd ui && npx vitest run src/features/connections src/pages/apps/AppDetail.test.tsx src/pages/apps/AppsConnect.test.tsx`: 8 files, 55 tests pass. - `cd ui && node ../scripts/run-tsc.mjs -b`: no errors. - `node scripts/check-token-gates.mjs`: all gates clean. `node scripts/check-test-budget.mjs --files ui/src/features/connections/GoogleWorkspaceServices.test.tsx`: pass. `node scripts/storybook-catalog.mjs`: pass. - `pnpm verify` exits 2 (a global CI input changed: `doc/memory/google-connector-memory.md`). Required CI supplies the broad coverage. - Headless Playwright against Storybook dev, `ProductionPicker` at 1280x900 (dark and light) and `ProductionPickerMobile` at 375x812: the dialog text is only the title, the rows, the link, and Cancel / Continue. No horizontal scroll at 375 px. The link sits under the last row with the normal dialog gap, and the footer follows it. - Before: see the screenshots in #21998. After: the same dialog without the two text sections. ## Risks - Policy risk: Google's user data policy may expect a disclosure inside the product, before consent, that says what data the app uses and how. A privacy policy link alone may not satisfy a Google reviewer. This is a recorded owner decision. If a reviewer asks, restore a short statement above the link. The memory doc and the production checklist record this risk. - Low code risk. The change is UI-only. Selection, requested scopes, OAuth and saved state do not change. > 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 - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, in Claude Code with tool use (shell, file edits, headless browser). ## 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: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4daeab5c76 |
Add count, newest-first and lean run reads to customer-success inspection (#22781)
<!-- 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
> - Paperclip Cloud can inspect a tenant stack read-only through the
customer-success inspection API
> - That API can only list rows in id order. It has no totals, and each
run row holds large JSON columns
> - A customer-success agent must page every run of a stack to find the
latest run or the failed-run total
> - That is too slow and too large for a refresh across many stacks
> - This pull request adds a `count` operation, a creation-time `order`
for lists, and a lean `summary` view for runs
> - The benefit is one small read per metric, with the same read-only,
company-scoped rules
## Linked Issues or Issue Description
**Subsystem affected**
Server: the customer-success inspection API (`/api/customer-success/v1`)
and its shared query contract.
**Problem or motivation**
Customer-success inspection reads cannot answer summary questions. To
get the latest run, the run count or the failed-run count, a reader must
page through every run. Each run row can be hundreds of KB, because it
holds the result, usage, context snapshot and runner profile.
**Proposed solution**
Add read-only summary reads to the inspection contract: a `count` that
groups by status, a newest-first or oldest-first `order` for `list`, and
a `summary` view of runs without the large JSON columns.
**Alternatives considered**
Paging all runs with a smaller page size. That still reads every large
row. A new aggregated endpoint outside the reader catalog. That would
skip the existing catalog, permit and transaction rules.
## What Changed
- `packages/shared/src/customer-success.ts`: add the `count` operation,
`order` (`newest`/`oldest`, `list` only), `view` (`summary`, `runs`
list/get only), `InspectionCount`, and `inspectionReadPath()`. The
parser rejects these fields where they do not apply.
- `server/src/services/customer-success-inspection.ts`: `count` returns
`{total, byStatus}` (grouped by the reader's `status` column, or
`byStatus: null`). `order` sorts by `createdAt`, then id. `view:
"summary"` selects the `RUN_SUMMARY_COLUMNS` allowlist and adds
`durationMs`. All reads stay in the same read-only, repeatable-read
transaction and keep the existing run redaction.
- `server/src/routes/customer-success.ts`: serve the same handler on
`/read` and the new `/read-v2`. `/read` refuses queries that use the new
features. A tenant without `/read-v2` answers 404, so Cloud fails closed
with `tenant_inspection_version_unsupported`.
- `server/src/__tests__/customer-success.test.ts`: tests for counts,
company scope, newest-first paging, the summary allowlist and duration,
parser bounds, and the path split.
- `server/src/__tests__/customer-success-cloud.test.ts`: the registry
double now has the batch reads (`getStacks`, `getAccounts`) that the
current Cloud broker uses. The test also runs a count and a newest-first
summary read end to end.
- `server/src/__tests__/openapi-routes.test.ts`: list `/read-v2` with
the other inspection protocol routes.
- `doc/CUSTOMER-SUCCESS-INSPECTION.md`: document the summary reads and
the path split.
## Verification
- `cd server && pnpm exec vitest run
src/__tests__/customer-success.test.ts
src/__tests__/openapi-routes.test.ts
src/__tests__/customer-success-run-liveness.test.ts`: 78 tests pass.
- Red check: the new count/order/summary test fails against the previous
service (`Unsupported inspection operation`).
- Coordinated qualification with a local build of the Cloud broker
branch: `PAPERCLIP_INSPECTION_CLOUD_DIST=… pnpm exec vitest run
src/__tests__/customer-success-cloud.test.ts` passes, including the
count and newest-first summary reads over `/read-v2`.
## Risks
- Low risk. The new features are read-only and use the existing catalog,
company boundary, permit check and read-only transaction.
- The summary view is an allowlist. A new run column stays out of the
summary until someone adds it.
- Mixed versions are safe in both orders. An older Cloud never sends the
new fields. A newer Cloud sends them only to `/read-v2`, and an older
tenant answers 404 there.
- No migration.
## Model Used
- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use
(shell, file edits) and extended thinking.
## 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
canary/v2026.1124.0-canary.852300
|
||
|
|
11cfe0910d |
fix(connections): keep a finished setup checklist on screen when the app refreshes queries (#22715)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - "Set it up with your agent" screens give the person's own agent a
setup checklist to fill in, shown live on the page (#22626, AWS role
setup first)
> - Testing it end to end on staging, the agent's updates appeared
within 0.3–0.6 seconds and the page showed "Your agent set up AWS" with
the role ARN, then a few seconds later replaced it with a blank new
checklist
> - When the live connection reconnects or the tab becomes visible
again, the app refreshes every query on screen. The checklist's handoff
query refetched, found no checklist in storage (a finished one is
removed so it is never reused), and created a new one
> - This pull request makes a refetch keep the checklist the page
already has; only Start again, or a finished checklist from an earlier
visit, makes a new one
> - The benefit is that a finished setup stays on screen with its
summary until the person moves on
## Linked Issues or Issue Description
Refs #22626 (the setup checklist this fixes).
**Subsystem affected**
Connections (agent-guided setup), UI.
**Problem or motivation**
On paperclip.staging, after the agent finished, the AWS setup step
showed "Your agent set up AWS" and the role ARN to paste, then about 7
seconds later went back to "Paste the prompt into your agent" with a
new, empty checklist. The page's network log showed a second `POST
/api/companies/{companyId}/agent-setup-progress`. The person loses the
role ARN they were about to copy.
**Proposed solution**
The handoff query's fetch returns the handoff already in the cache
unless the page asked to replace it (`renew`). Creating a checklist
stays a deliberate action.
**Alternatives considered**
- Excluding the handoff key from the live reconcile
(`LIVE_EVENT_FREE_QUERY_KEYS`): covers that one caller but not any other
broad invalidation. Guarding the fetch covers them all.
- Keeping a finished checklist in storage: it would then be reused by a
later visit, which #22626 deliberately avoids (a finished checklist
takes no more updates).
## What Changed
- `ui/src/components/AgentSetupProgress.tsx`: the handoff query's
`queryFn` returns the cached handoff unless `renew` set a one-shot
`replacing` flag.
- `ui/src/components/AgentSetupProgress.test.tsx`: regression test. A
checklist finishes, then every active query is invalidated (as the live
reconcile does); the checklist is created once and "Your agent set up
AWS" with the role ARN stays.
## Verification
- New test fails on master (`create` called twice) and passes with the
fix (red/green).
- `AgentSetupProgress.test.tsx` and `AwsRoleSetup.test.tsx`: 26 passed.
UI typecheck clean.
- Staging reproduction (before this fix), paperclip.staging on
|
||
|
|
0731cd3afc |
perf(ci): Phase 2 PR CI under 4 minutes (dynamic workers, fast E2E boot, typecheck overlap, test-budget gate) (#22729)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Pull-request CI checks run on every commit before maintainers can merge code > - PR #22679 cut PR CI from 15–30+ minutes down toward 4.5–5.5 minutes on 4-core runners > - Remaining wall-clock bottlenecks sit in unsharded `workspaces-b`, serial typecheck preparation, E2E server/UI startup, fixed Vitest worker caps, and remaining soak and duplicated UI tests > - This pull request adds Phase 2 optimizations across server soak triage, typecheck DAG overlap, E2E fast boot and shard balance, dynamic CPU-aware workers, pure-Node workspace link preflight, UI pruning, and permanent test-budget enforcement > - The benefit is ordinary feature PRs finish in ~3.1–3.8 minutes on 4-core runners and scale automatically to ~2.0–3.0 minutes on 8-core runners while keeping core invariants and nightly coverage intact ## Linked Issues or Issue Description Refs #22679 **Problem Statement** After #22679 landed, several PR lanes still took 4.5–6 minutes on 4-core runners (`general-workspaces-b` ran unsharded, `Typecheck + Release Registry` waited on a serial server build before starting UI and test-program checks, E2E shards paid full `cli onboard` + minified UI build overhead, and Vitest worker counts did not scale with runner CPU count). **Proposed Solution** Split `general-workspaces-b` across two duration-balanced shards, overlap typecheck preparation tasks behind a shared runner-vendor node, replace E2E `onboard` with a direct template-PG boot + unminified inline UI build, scale Vitest/Playwright/Typecheck workers dynamically by CPU and RAM, replace `tsx` in workspace-link preflight with pure Node, prune redundant mocked UI tests and additional real-clock server soak suites (still run on `master`, `release-verify`, `cloud-readiness`, and `PAPERCLIP_CI_FULL=1`), and add a permanent test-budget policy check. **Expected Benefit** Brings ordinary PR CI wall-clock down to ~3.1–3.8 minutes on 4-core runners (and ~2.0–3.0 minutes on 8-core runners) with automated guardrails against future test-time regressions. ## What Changed - **Server soak triage & permanent test-budget guardrail (`scripts/ci/nightly-only-suites.json`, `rules/test-budget.mdc`, `.greptile/files.json`, `scripts/check-test-budget.mjs`, `scripts/check-test-budget.test.mjs`, `.github/workflows/pr-trusted.yml`):** Expanded the PR-excluded soak/heavy-integration manifest to 568 genuine heavy suites (preserving 100% of company isolation, authz, checkout, approval, budget, activity-log, security, telemetry, and serialized suites on every PR) and wired `node scripts/check-test-budget.mjs` into the `policy` job. - **Typecheck DAG overlap & CPU/RAM scaling (`scripts/ci-typecheck-lane.mjs`, `scripts/typecheck-test-programs.mjs`, `scripts/__tests__/ci-typecheck-lane.test.mjs`, `scripts/typecheck-test-programs.test.mjs`):** Moved `build server without type checks` and `check server runtime assets` out of serial `prepare` into parallel DAG nodes behind `prepare runner vendor`, added `computeResourceProfile` scaling across 2/4/8-core runners, and added missing UI/Runner consumer routing inputs (`packages/paperclip-runner/` for `@paperclipai/ui`, `packages/adapter-utils/` for Runner test programs). - **E2E fast boot, dynamic workers & 8-shard rebalance (`tests/e2e/start-e2e-server.ts`, `tests/e2e/playwright.config.ts`, `scripts/e2e-shard.mjs`, `scripts/e2e-shard-durations.json`, `.github/workflows/pr-trusted.yml`, `.github/workflows/release-verify.yml`):** Added direct throwaway template-PG boot (`fsync=off`), unminified inline Vite fallback build, dynamic parallel workers (`min(4, floor(cpus/2))`), empirical `1.5x` parallel speedup weighting across 8 shards, targeted trims to slowest E2E specs, and hashed workspace `package.json` manifests into the `e2e-ui-dist-v2` cache key. - **Dynamic Vitest workers, 2-shard `workspaces-b`, and pure-Node preflight (`scripts/ci/vitest-workers.mjs`, `scripts/ci/workspaces-b-shard.mjs`, `scripts/ensure-workspace-package-links.mjs`, `scripts/ci-dependency-cache.mjs`, `packages/db/src/test-embedded-postgres.ts`, `.github/ci-task-matrix.json`, `.github/actions/setup-ci-dependencies/action.yml`, `package.json`):** Scaled Vitest workers dynamically (`4→7` general, `3→5` serialized) with `max_connections=300` before PostgreSQL start, split `general-workspaces-b` into 2 duration-weighted shards (backward-compatible unsharded for release workflows), replaced `tsx` workspace-link preflight with pure Node (~29× faster), and parallelized `ci-dependency-cache.mjs` child queries. - **UI Vitest worker scaling, fake timers & E2E-duplicated suite pruning (`ui/vitest.config.ts`, 4 `maps/` files, and UI test suites):** Scaled UI `maxWorkers` dynamically, converted real-clock sleeps in kept suites to fake timers, removed 34 E2E-duplicated mocked jsdom suites, and updated corresponding `maps/` prose references. ## Verification - `node --test .github/scripts/tests/ci-plan.test.mjs .github/scripts/tests/ci-dependency-cache.test.mjs .github/scripts/tests/pr-dependency-cache.test.mjs scripts/__tests__/run-vitest-stable-shard.test.mjs scripts/__tests__/run-vitest-stable-pr-mode.test.mjs scripts/__tests__/ci-typecheck-lane.test.mjs scripts/typecheck-test-programs.test.mjs scripts/__tests__/e2e-shard.test.mjs scripts/check-test-budget.test.mjs scripts/ci/test-selection-pr-timings.test.mjs`: **160/160 PASS** - `node scripts/check-test-budget.mjs`: **PASS** (`568` nightly suites validated) - `node scripts/check-maps.mjs`: **PASS** (`35 areas, 192 capability IDs`) - `pnpm --filter @paperclipai/ui typecheck` & `pnpm --filter @paperclipai/db typecheck`: **PASS** - Live CI verification runs on the new `pr-trusted.yml@master` (from #22679) with `profile-ci` enabled to export the full job/step/file waterfall to Honeycomb `paperclip-ci`. ## Risks - Medium CI scope: touches workflow matrix partitioning, E2E startup, and test runners; does not change production app runtime behavior. - All PR-demoted soak suites continue to execute on `master`, `release-verify`, `cloud-readiness`, local `pnpm test:run`, and `PAPERCLIP_CI_FULL=1`. - All new `policy` and `setup-ci-dependencies` commands keep file-existence guards so reruns of older PR branches continue to work. ## Model Used - Google Gemini (Antigravity swarm orchestrating specialized worker agents with shell, file editing, and test execution tools) and Anthropic Claude Opus (verification and optimization sub-agents). ## 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.1124.0-canary.852100 |
||
|
|
ba292200a6 |
fix(antigravity): declare the swarm turn contract in the ACPX sidecar schema
The swarm mode, the model envelope the swarm route reads and its bounded swarmRequest field are now declared under protocol/ and generated into TypeScript, so the pack contractDigest covers them and an older pack that reads the request from task.prompt is not reused. Provider profile commandDigests are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d67d4d0ed5 |
chore(runner-e2e): resync the public SDK input registry
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
7c41441f75 |
fix(antigravity): carry the /swarm request in its own field and refuse what a swarm cannot run
The verified request now travels as provider.swarmRequest and the model envelope's swarmRequest; the swarm route sends exactly /swarm <request> and never reads the rendered task prompt, so a merged wake's agent comment or the task description cannot reach the auto-approved coordinator. Empty and over-long /swarm requests are refused in the composer, the comments route and run selection instead of running as ordinary work. A swarm run never takes queued messages, so Interrupt stops it and delivers the message. Retry after Stop or past the automatic cap counts only when the user asked for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
28aa32e7d7 |
fix(plan-mode): open the plan review card when a Plan-mode run settles without one (#22732)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Plan mode makes an agent write a plan document. The user then
approves the plan or requests changes on a review card. After approval,
the agent does the work on the same task.
> - For Codex and Claude, the agent session reports the plan as a
provider event. Paperclip opens the review card from that event.
> - Google Antigravity and other ACPX agents have no such event. They
write the plan with a tool, and they must open the review card with
another tool.
> - When the agent does not open the card, the run settles as "waiting
for a response" and the task shows no action. This happened in a live
run: the Antigravity process was stopped during a Plan-mode run, and the
automatic continuation wrote a new plan revision but did not open the
card.
> - This pull request makes the server open the review card when a
Plan-mode run settles with a plan revision that has no review card. It
does this for every harness.
> - The benefit is that a Plan-mode task always shows the user the next
action, also after a crash or restart.
## Linked Issues or Issue Description
Refs #22727
**What happened?**
A Google Antigravity agent ran a task in Plan mode. The agent process
was stopped during the run. Paperclip continued the run automatically.
The new run wrote a new plan revision and finished with "waiting for
plan review". It did not open the Approve / Request changes card. The
task stayed in progress with no action for the user.
**Expected behavior**
When a Plan-mode run settles with a new plan revision, the user sees
exactly one review card for that revision. Retries, restarts and
duplicate settles do not add more cards. A Plan-mode run that produces
no plan does not leave the task waiting with no action.
**Steps to reproduce**
1. Assign a task to an Antigravity agent in Plan mode.
2. Stop the agent process while the run is in progress.
3. Let Paperclip continue the run automatically.
4. See that the continuation writes the plan but no review card opens.
**Paperclip version or commit**
master at
|
||
|
|
6823ec5c5a |
fix(antigravity): a swarm's only instruction is the user's recorded request
Run selection loads the request comment by primary key in the same query that verifies its author, task and company, and sets the swarm task prompt to its own text (the /swarm prefix stripped by the shared rule). No queued messages, wake attachments or handoff text join a swarm turn, and the CLI route sends only '/swarm <task.prompt>', refusing anything that is not a fresh task envelope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2a4707bb0b |
chore(runner-e2e): resync the public SDK input registry
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
8ee39389fb |
fix(antigravity): a task reassigned to another agent runs ordinary work, not a pending swarm refusal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4095ad1f8b |
fix(antigravity): one stored fact per swarm selection; bounded automatic attempts
Run selection records the verified swarm request on the run it selects, in one transaction that locks the task, so a swarm that succeeded on any selection path is never run again. Automatic wakes attempt a request at most three times and refuse plainly after a Stop; a fresh /swarm or Retry still runs it. A second concurrent selection for the same request is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
045af9ed08 |
fix(antigravity): a run that re-creates a swarm request is that swarm, never ordinary work
Retries and recoveries inherit the request through the retry link (run column or context, bounded chain on the same task). Any other wake on the task runs it while the user's latest message is a swarm request no successful swarm run fulfilled. Found live: a failed swarm was re-run by recovery on the ordinary route and the agent delegated the work to child tasks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1e29e068cd | Merge origin/master into feat/antigravity-swarm-command | ||
|
|
7d26bdaa42 |
feat(antigravity): verified Antigravity CLI route for native swarm (inert) (#22731)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Google Antigravity agents run through the Paperclip Runner's ACP driver, on the registry ACP server 1.5.2 > - Google's native `/swarm` (a coordinator that starts helpers and a verifier) exists only in the Antigravity CLI (`agy acp` 1.5.15), which #22728 pinned and provisions > - The CLI is a signed binary, so the registry server's owned admission patch cannot exist there. Paperclip needs another way to verify the session before a billable swarm starts, and a governed way to run, stop and finish it > - This pull request adds that CLI route to the Runner: a verified ACP client, the checks it does in place of the patch receipt, process setup, failure classification and a deterministic fake CLI for tests. Nothing selects the route yet, so this PR does not change behavior > - The benefit is that the next PR only has to add trusted `/swarm` detection and an experimental flag ## Linked Issues or Issue Description Refs #22728, #22701, #22727 **Subsystem affected** Paperclip Runner, ACP driver, Google Antigravity. **Problem or motivation** A user who writes `/swarm <request>` to a Google Antigravity agent should get a real native swarm in the task's workspace. The registry ACP server does not offer `/swarm`. The Antigravity CLI does, but its permission prompts for helpers never reach an ACP client, its model selector groups models into a family plus a thinking level, a turn can end while helpers still run, and some provider refusals arrive as ordinary text that ends the turn "successfully". **Proposed solution** Run a trusted swarm turn on the pinned CLI through a small driver-owned ACP client that verifies every setting it depends on, confines helpers to the task workspace through the CLI's `auto` mode, waits for helpers, checks the workspace after the turn, and reports typed failures in plain language. ## What Changed - `antigravity-swarm-guard.ts`: the checks that replace the registry server's admission receipt. The driver verifies and records: - agent identity and version from `initialize` equal the pinned CLI (`Antigravity ACP Server` 1.5.15), and the CLI accepts `systemPrompt.append`; - the `session/new` request uses the task workspace as `cwd`, carries Paperclip's instructions, and passes exactly one MCP server: the runner-owned Paperclip bridge; - session mode reads back as `auto` after `session/set_mode`; - model family plus thinking level read back as the agent's configured model after `session/set_model` (for example `gemini-3.8-flash` + `low` for `gemini-3.8-flash-low`); - none of those change later in the session; a helper started with workspace `share` or `branch` stops the swarm. Any difference fails closed with a typed error and a plain message. A sign-in without `auto` mode is reported as "swarm not available". - `antigravity-swarm-runtime.ts`: an `AcpxRuntimePort` for the CLI route. - One fresh session per run. It never calls `session/load`, so Retry after a lost process starts a fresh swarm in the same workspace. - Prompts with `/swarm <task>` (the route is reached only through the trusted mode). At most one swarm per run. - Does not settle on the first `end_turn` while helpers may still run: when helpers were started and the coordinator did not wait on the board afterwards, it sends one bounded "wait for the helpers" follow-up (20 min default; timeout is a typed failure). - Lists the task folder before and after the turn (asynchronous, bounded on every visited entry, stopped with the turn, skipping `.git`, `node_modules`, `.venv`, `__pycache__`) and shows the real changes. It never infers required files from what helpers or the coordinator say (helpers can misreport). Done still requires the hand-in through Paperclip's finish tool, which the server's completion contract enforces. - Stops the swarm when a visible tool call would change a path outside the task folder (`antigravity-swarm-paths.ts`): file-tool locations and path arguments, and shell write targets (redirects, `tee`, `cp`/`mv`/`ln` destinations, `rm`, `mkdir`, `touch`, `sed -i`, `dd of=`), resolved relative to the task folder with `..`, `~`, `$HOME` and symlinks of existing parents. This is a best-effort **detector, not a boundary**: it turns visible, unambiguous outside writes into a clear failure, uses a quote-aware lexer, and yields no finding for anything ambiguous (command substitution, heredocs, `eval`, `cd`, interpreters, unknown variables), so it never stops a correct swarm on a guess. It does not prove confinement. - Stop is installed before the first await of a turn and re-checked before every prompt; a Stop during admission retires the CLI at once. A test injects Stop at each await point (launch, initialize, session/new, set_mode, set_model, workspace listing, helper wait). - A saved conversation from the other Antigravity route (swarm ↔ ordinary turn) is refused as `ANTIGRAVITY_SAVED_STATE_INCOMPATIBLE`, the existing typed refusal that makes the server open a fresh conversation instead of showing Retry. So an ordinary follow-up after a swarm, a later second `/swarm`, and Retry after a killed swarm all start a fresh session. - Approves only Paperclip's own tool server at a permission prompt; every other prompt is outside the task folder in `auto` mode, so it is refused and shown as "Blocked: …". Helper actions that the CLI timed out are shown as blocked. - Stop sends `session/cancel`, then retires the CLI's process group and confirms no helper process survives. - Usage is the coordinator's reported total, recorded as soon as each prompt result arrives (also for failed or stopped turns), labelled as including the helpers and not itemised. - A settings change outside a turn becomes a typed failure that fails admission or the next turn and retires the CLI process group; no handler error can escape into the event loop. - Refusals that arrive as text (402 credits, 429 quota, sign-in) become typed provider failures. - `antigravity-swarm-presentation.ts`: turns the coordinator's `swarm` / `read_board` / `post_message` calls into steps such as "Started helper writer-a: Write a.txt …", "Checked on the helpers", and drops terminal-only hints. No raw ids. - `antigravity-swarm-route.ts` and small hooks in `runtime-host.ts`, `acpx-runtime-adapter.ts` and `provider-mode.ts`: the `antigravity` provider mode accepts only `swarm`; for that mode the host installs the pinned CLI (`resolveAntigravityCliLaunch` with `--gemini-dir <run credential home>/antigravity-cli`, the stable endpoint `https://cloudcode-pa.googleapis.com`, `--disable-telemetry`, self-update off), skips the registry credential staging, and refuses API-key connections and unpinned platforms with a plain message. - `test-fixtures/antigravity-cli/fake-agy-acp.mjs`: a deterministic fake `agy acp` that replays the spike's message shapes (success, live helpers at `end_turn`, hang, blocked, misreport, workspace escape, cancel with a real helper process, process death, 402 and 429 refusals as text, identity/mode/model mismatches). ### Host policy inputs on the swarm route | Input the registry route honours | Swarm route | |---|---| | Read-only (Plan mode) task policy | Refused before the CLI starts: "Swarm is not available while planning" | | Saved session / `restoringSession` (resume) | Refused as saved-state-incompatible: the server opens a fresh conversation; a swarm never reloads | | Runner-owned Paperclip tool bridge | Enforced: the only MCP server, verified in `session/new` | | Other assigned tool servers (stdio MCP bindings) | Refused with a plain message, never silently dropped | | Delegation tools | (follow-up PR) removed from the bridge catalog for a swarm turn | | Workspace root (`cwd`), `assertWorkspaceHeld` | Enforced: `cwd` is the task workspace, re-asserted at spawn; helpers must use `inherit` | | Additional directories | Not passed (none are granted) | | Credential/env scoping | Private `--gemini-dir`; registry credentials and API keys removed from the launch environment; macOS HOME is the OS user's home for the keychain sign-in | | Provider-lifetime fence, process group | Enforced: verified command lease with the lifetime fence; Stop and close retire the whole group | | Permission mode | Replaced by the verified `auto` session mode; other prompts are refused and shown as blocked | | Model and thinking level | Enforced and read back (`session/set_model`), checked for later changes | | Abort signal | Honoured during admission and turns | ## Verification - `pnpm --filter @paperclipai/paperclip-runner exec vitest run src/drivers/acpx/antigravity-swarm-guard.test.ts src/drivers/acpx/antigravity-swarm-presentation.test.ts src/drivers/acpx/antigravity-swarm-runtime.test.ts src/drivers/acpx/antigravity-swarm-route.test.ts`: 36 passed. Each file was red first (module missing); the route-selection tests were also shown red with the hooks reverted (2 failed) and green with them. - `pnpm --filter @paperclipai/paperclip-runner exec vitest run src/drivers/acpx/`: 117 files, 2017 passed, 9 skipped. - `tsc -p tsconfig.json` and `tsc -p tsconfig.test.json` for the runner package: no errors in the changed files. - `pnpm verify` asked for broader coverage (the fixture is a broad input); required CI supplies it. - Live, no product code: against the real CLI 1.5.15 with the owner's existing sign-in, `session/new` accepted the Paperclip bridge as an HTTP MCP server with a bearer header (it called `initialize` and `tools/list`), and `session/set_model gemini-3.8-flash-low` read back as `gemini-3.8-flash` + `low`. One prompt returned `⚠ RESOURCE_EXHAUSTED (code 429)` as text with `end_turn`; that shape is now a test case. - Not run live: a full swarm through Paperclip. That proof belongs to the follow-up PR, which turns the route on. ## Risks - Inert: no server code sets the `swarm` mode yet, so no turn reaches this route. - When enabled: helpers act under Antigravity's `auto` mode. What confines them is the CLI's own policy: file-tool writes outside the workspace are blocked (60 s timeout, seen in the spike), and its shell sandbox allows the workspace **plus temp directories**. Helper tool calls never reach an ACP client, so Paperclip cannot see or block a helper's shell command, and helper approvals are not possible. - **Paperclip does not confine the CLI process tree on a local computer.** Paperclip's local process sandbox (`adapter-utils/local-process-sandbox.ts`) is used only by the classic Claude and Codex local adapters, not by Runner ACP harnesses, so it does not apply here on macOS or Linux. The outside-path check covers only the coordinator's visible calls. This is why the feature stays experimental, off by default, local only, and why the activity log says helper actions are auto-approved. - On macOS the CLI reads its Google sign-in from the login keychain through the real HOME, so this route uses the sign-in of the CLI on the computer, not Paperclip's stored Google connection. All CLI state stays in the private `--gemini-dir`. - Google's consumer terms have a clause about third-party tools that access the service. A legal read is pending. This PR does not claim compliance. - Usage under-reports nothing that Google reports, but it cannot be split per helper. > 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 - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, with tool use (shell, file edit) in 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 - [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 (docs and the qualification ledger come with the follow-up PR that enables the route) - [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>canary/v2026.1124.0-canary.851900 nightly/v2026.1124.0-nightly.0 |
||
|
|
81c246104d |
fix(antigravity): swarm review fixes
- remove the real delegating operations (bare operation ids) from a swarm turn's bridge catalog - write the swarm request record in the comment's transaction; verify author, actor, task and company - keep a swarm request out of another run's first turn; keep its marker through wake coalescing - carry every swarm refusal to the user as a typed provider failure - keep a pending /swarm request across a reload; refuse /swarm in the new-task composer and with per-message model choices - fix the runner-e2e swarm case types Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
26bddb09f1 |
test(server): the swarm provider mode is set only for a trusted Antigravity swarm run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2c5225b6c9 |
docs(antigravity): say plainly that Paperclip does not sandbox swarm helpers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
be0a981b66 |
Merge branch 'feat/antigravity-cli-swarm-driver' into feat/antigravity-swarm-command
* feat/antigravity-cli-swarm-driver: fix(antigravity): quote-aware outside-write detector that never stops on ambiguous commands |
||
|
|
9e2f0c5d4a |
fix(antigravity): quote-aware outside-write detector that never stops on ambiguous commands
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
fbeeb9d249 |
test(runner-e2e): attended Antigravity swarm cells; docs and qualification ledger
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
417c695a9a |
feat(antigravity): refuse /swarm in Plan mode; route tests for the trusted request
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c83f18280c | Merge branch 'feat/antigravity-cli-swarm-driver' into feat/antigravity-swarm-command | ||
|
|
6af963c6b3 |
fix(antigravity): Stop at any await, outside-path detection, typed route change on resume
- install Stop before the first await of a turn and re-check it before every prompt; a Stop during admission retires the CLI - detect visible changes outside the task folder: file-tool paths, shell write targets, .., ~, $HOME and symlinks - a saved conversation from the other Antigravity route is refused as saved-state-incompatible, so the server opens a fresh one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
083403c65f |
feat(ui): /swarm in the task composer sends a structured swarm request
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c2b64e5223 |
Merge branch 'feat/antigravity-cli-swarm-driver' into feat/antigravity-swarm-command
* feat/antigravity-cli-swarm-driver: fix(antigravity): stop a swarm on a visible edit outside the task folder; stable record identity fix(antigravity): refuse unsupported host policy, own protocol failures, keep usage, async workspace listing |
||
|
|
540b8decbb |
fix(antigravity): stop a swarm on a visible edit outside the task folder; stable record identity
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
b004539d5e |
fix(antigravity): refuse unsupported host policy, own protocol failures, keep usage, async workspace listing
- refuse a swarm in a read-only (planning) run, on a resumed session, or with extra tool servers, before the CLI starts - a settings change outside a turn becomes a typed failure and stops the CLI process group instead of escaping the event loop - record billable usage when each prompt result arrives, whatever the outcome - stop inferring required files from helper briefs; record the task folder's actual changes - list the task folder asynchronously, bounded on every visited entry and stopped with the turn Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
74d289db05 |
wip(antigravity): trusted /swarm request, flag and run selection
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
55267905fc |
feat(antigravity): verified CLI swarm route, inert until selected
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a8d7c1b379 |
Merge remote-tracking branch 'origin/master' into feat/antigravity-cli-swarm-driver
* origin/master: feat(antigravity): /plan selects Plan mode and keeps Antigravity read-only while planning (#22727) |
||
|
|
67fde37fe9 |
wip(antigravity): swarm guard, presentation and fake CLI fixture
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
18aa2b353d |
feat(antigravity): /plan selects Plan mode and keeps Antigravity read-only while planning (#22727)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Plan mode lets a person ask an agent for a plan, review it as the task's Plan document, and accept it before any work starts > - People who use Google Antigravity agents type `/plan <request>`, as they do in other agent tools. Paperclip sent that text to the agent, and #22701 correctly neutralised it, so nothing happened > - An Antigravity run in Plan mode was also not read-only: the agent could still edit files and run commands while it "planned" > - This pull request makes a leading `/plan` in the composer select Plan mode, and keeps an Antigravity Plan-mode run read-only at its permission prompt > - The benefit is that `/plan` with an Antigravity agent gives the normal Paperclip plan flow (Plan document, accept, then execution on the same task), and planning cannot change the workspace ## Linked Issues or Issue Description Refs #22701 **What happened?** A person wrote `/plan add greeting.txt` to a Google Antigravity agent. The agent did not plan. In Plan mode the Antigravity agent could still edit files and run commands. **What did you expect?** `/plan <request>` starts Plan mode. The agent researches and proposes a plan in the task's Plan document. It does not change files until the person accepts the plan. **Steps to reproduce** 1. Assign a task to a Google Antigravity agent. 2. Write `/plan Add a file greeting.txt containing hello`. 3. See that the task stays in Auto mode, and that the agent creates the file. ## What Changed - Task composer: a leading `/plan` in a comment or in a new task selects Plan mode and sends the rest of the message without the command. `/plan` alone only switches the mode. The slash menu offers "Plan". A `/plan` anywhere else in the message (quoted, pasted, fenced, mid-sentence) stays ordinary text and does not change the mode. This is the typed form of the existing Plan mode control, so it works the same for every agent. - Antigravity runner (`antigravity-plan-mode.ts`, wired in `acpx-runtime-adapter.ts` and `runtime-host.ts`): when Paperclip runs an Antigravity task in Plan mode (the existing read-only task policy), the permission prompt fails closed. It allows only (a) the 1.5.2 server's built-in research tools (file read, search, directory listing, page read), named by the exact `Run <tool>?` prompt title, when the reported kind also matches that tool, and (b) the tools the runner's own Paperclip bridge registered for this run, on the runner-owned server named `paperclip`. The provider's reported kind alone never grants a read, and no other MCP server is trusted, runner-owned or not. It refuses file edits, terminal commands and everything else. Paperclip's server applies its Plan-mode rules to its own tools, and the agent writes the Plan document through them. - Composer command parsing moved to `ui/src/components/task-chat/composer-commands.ts`. `/goal` and `/plan` both use the shared rule. Both submit paths use one `/plan` decision: a bare `/plan` sends (in Plan mode) only when an attachment can be sent without text; otherwise it only selects Plan mode. A composer without Plan mode (the dashboard chat starter) keeps `/plan` as text. - Follow-up, not in this PR: the Kimi read-only gate (`kimiReadOnlyPermissionAllowed`) trusts every runner-owned MCP server by title prefix. It should get the same binding to the Paperclip bridge's registered tools. - No change to the #22701 guard. Every `/plan`, `/logout` and `/usage` that would reach the Antigravity server is still neutralised. - No change to the Antigravity admission patch, profile or closure digests. No shared contract change. ### Why not the native `/plan` of Antigravity 1.5.2 I checked the pinned 1.5.2 server and SDK sources and ran it live: - The server has no plan session mode (only `default`, `auto_edit`, `yolo`) and no plan config option. Its only route is the `/plan` text command, which it turns into an SDK slash-command object. - Live on 1.5.2 (Google sign-in, `gemini-3.8-flash-low`), a task with `Please /plan this ...` reached the model as `Please/BuiltinSlashCommandName.PLAN this ...`. The SDK sent the enum's string form instead of `plan`, so the harness did not enter planning mode. Over 61 native steps (about 5 minutes) the agent wrote no plan artifact, ran terminal commands, and searched the file system for that unknown name. I stopped the run. - A working native path needs a change inside the runtime (for example in the owned admission patch), which re-pins the closures for every platform and needs re-qualification. This PR does not do that. Paperclip's own Plan mode gives the user-visible result now, with no re-pin. ### Source of trust for slash commands (reused by `/swarm`) - `parseLeadingUserCommand(text, allowlist)` in `packages/shared/src/leading-user-command.ts` is the one rule. It returns `{ command, argument }` or `null`. - Trusted text: only what the signed-in user typed and submitted in the task composer. That is a comment body or the body of a new task. Conversations (chat) do not use it for `/plan`. - Never trusted: agent comments, chat or connector messages, API-posted text, issue text written by someone else, quoted or pasted parts, and every prompt Paperclip builds for an agent. These stay text, and the #22701 guard still neutralises any native command in them. - Inside trusted text, only a command at the very start counts: optional whitespace, `/name`, then whitespace or the end. The name is exact and lower-case and must be in the allowlist. Only `plan` is enabled. Whitespace follows the Antigravity server's Python rules (U+001C-U+001F count; U+FEFF does not). - A recognised command becomes a structured action (here: Plan mode). It never reaches an agent as command text. - Tests cover: leading whitespace and newlines, a command not at the start, quoted, fenced, forwarded and wrapped content, a neutralised command, case, `/planning`, `/plans`, paths and URLs, Python vs JavaScript whitespace, and the allowlist. ## Verification - `pnpm --filter @paperclipai/paperclip-runner exec vitest run src/drivers/acpx/antigravity-plan-mode.test.ts src/drivers/acpx/acpx-runtime-adapter.test.ts src/drivers/acpx/antigravity-native-commands.test.ts src/drivers/acpx/antigravity-admission.test.ts`: 250 passed. - `pnpm --filter @paperclipai/shared exec vitest run src/leading-user-command.test.ts`: 8 passed (red first: module missing). - `pnpm --filter @paperclipai/ui exec vitest run src/components/task-chat/TaskChatComposer.test.tsx src/components/MarkdownEditor.autocomplete.test.tsx`: all passed (TaskChatComposer 155). - Red before the fix: the adapter test showed an Antigravity Plan-mode run approved a file write and a terminal command (`allow_once`), and the four composer `/plan` tests failed. The negative test (a `/plan` inside the message stays text) passed before and after. - Runner and UI typecheck pass (`tsc --noEmit`; the UI's only errors are the existing ungenerated Storybook catalog files). - `pnpm verify` returned exit 2 (runner files outside the local test graph), so required CI supplies the broad coverage. - Live, on THIS branch: a local instance running this branch, Google sign-in, `gemini-3.8-flash-low`, driven in the browser through the task composer: 1. `/plan Create a file named plan-proof.txt containing the single line OK` in a new task: the task was created in Plan mode with the command removed. Plan run 3 min 34 s, terminal state **succeeded** (the agent handed in through `paperclip_finish`; run result accepted, waiting for plan approval). The Plan document and a Confirm / Request changes card appeared. One `ls -la` was refused by the read-only gate. No file was written. 2. Request changes ("Name the file plan-proof-2.txt instead."): revision run 28 s, succeeded. Plan document revision 2 named the new file; a new Confirm / Request changes card appeared. Still no file. 3. Confirm: execution run 55 s, succeeded; task Done; `plan-proof-2.txt` contains exactly `OK` plus a newline. 4. Normal task whose text contains a pasted `"we usually /plan things like this first"`: created in standard mode, text unchanged; run 68 s, succeeded, Done; `negative-proof.txt` = `NEG`; no refused tool call. 5. Dashboard "Start a chat" box: NOT run live. The box renders only with an experimental instance setting that is off on this instance, and I did not change instance settings. A unit test covers it (a composer without Plan mode keeps `/plan` as text). 6. Stop during a Plan-mode run: the run was cancelled about 1 s after Stop and did not revive (no new run for over 3 min); no file. Killing only the native Antigravity server process mid Plan-mode run: the run failed with a provider error, showed "Continuing automatically", and a continuation run started 36 s later and settled (succeeded, 3 min 17 s, response wake). No duplicate comments; the Plan document has one revision; no file written; the gate refused one shell command in each run. - Found live, NOT fixed here: in the recovered run of step 6 the model settled with "waiting for plan review" but did not open the Confirm card (in steps 1 and 2 it did). Paperclip creates that card automatically only from a harness's own plan proposal (Codex, Claude). For Antigravity it depends on the agent. Recommended follow-up: when a Plan-mode run settles with a new plan revision and no pending plan confirmation, the server opens the card itself. - To be clear: this is not Antigravity's native plan mode. Native plan mode on runtime 1.5.2 does not work (see above). This PR gives Paperclip's Plan mode, started by a trusted `/plan`, with the Antigravity run held read-only. ## Risks - Low to medium. Plan mode for Antigravity now refuses terminal commands, so the agent researches with its file read and search tools. A planner that relied on shell reads must use those tools instead. - Google Workspace accounts whose admin policy lets terminal commands run in a sandbox without a prompt skip the permission prompt for commands. That path cannot be blocked here. Personal Google accounts and API keys always prompt. - `/plan` as the first word of a message now selects Plan mode for every agent. To send the literal text, write `\/plan` or put other text first. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, with tool use (shell, file edit, browser automation not used), in 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 - [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: Claude Opus 5.5 <noreply@anthropic.com>canary/v2026.1124.0-canary.851800 |
||
|
|
b6f1b7b4af |
feat(antigravity): pin and provision the Antigravity CLI route (#22728)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - The Runner launches native agent harnesses, including Google
Antigravity, from pinned and verified distributions
> - Antigravity's native `/swarm` exists only in Google's Antigravity
CLI (`agy acp`), not in the registry ACP server 1.5.2 that Paperclip
pins today
> - Before a driver can use the CLI, Paperclip needs a pinned, verified
way to install it and to launch exactly those bytes
> - This pull request adds the CLI distribution pin, a setup command and
a launch resolver. It is the first step of a short series. Route
selection, `/swarm` detection and the driver follow in later pull
requests
> - The benefit is that the later driver work starts from a fixed,
digest-checked binary, and the existing Antigravity route does not
change
## Linked Issues or Issue Description
**Subsystem affected**
Runner native provider distributions (`packages/paperclip-runner`) and
the `paperclipai runtime setup` CLI command.
**Problem or motivation**
Google documents `/swarm` for the Antigravity App and the Antigravity
CLI only. The registry ACP server 1.5.2 does not offer it. To make
`/swarm` work, Paperclip must run `agy acp`. The CLI is a signed Go
binary with no patch point, so the owned admission patch cannot apply.
Integrity must come from pinned archive and executable digests. Google
publishes no redistribution licence for the CLI, and the bucket's object
immutability cannot be checked anonymously. So Paperclip must fetch the
CLI from Google at setup time and verify it against digests that are
pinned in the repository.
**Proposed solution**
A sibling declaration, `antigravity-cli-distributions.json`, pins 1.5.15
(build `1.5.15-5514532022517760`) for darwin-arm64, linux-x64 and
linux-arm64. `paperclipai runtime setup antigravity-cli` downloads,
verifies, extracts and installs it beside the existing runtime.
`resolveAntigravityCliLaunch()` returns the launch through the existing
sealed native store.
**Alternatives considered**
- Add the CLI to `antigravity-distributions.json`. That file feeds the
generated profiles, the Rust profile table, release attestations and the
provider pack. A sibling file leaves all of them unchanged.
- Bundle the binary in the provider pack or image. Not cleared: there is
no redistribution licence.
**Roadmap alignment**
This is experimental provider work behind later route selection. It
changes no qualified behavior.
## What Changed
- `packages/paperclip-runner/antigravity-cli-distributions.json`: the
new pin. For each platform it records the Google URL, archive format and
size, archive SHA-512 and SHA-256, the single tar member
(`antigravity`), the executable name (`agy`), the executable SHA-512,
and the closure entry (SHA-256 and size) that the sealed store uses. It
also pins the leading arguments (`acp`) and the environment
`AGY_CLI_DISABLE_AUTO_UPDATE=1`.
- `scripts/materialize-antigravity-cli-distribution.mjs`: reads only the
checked-in declaration and accepts only Google's versioned bucket path.
It enforces the pinned size while it streams the download, refuses
redirects, and checks SHA-512 and SHA-256. It reads a strict one-member
tar (a regular executable, no links, no extra members, zero padding
only) and checks the executable's SHA-256 and SHA-512. It publishes the
directory with an atomic rename. Every failure gives a plain message
that ends "Nothing was installed."
- `scripts/provision-antigravity-cli.mjs`: installs to
`~/.paperclip/runtimes/antigravity-cli/<target>/<closure>`. A re-run
verifies the installed copy in place with no download. A copy that no
longer verifies is retired and replaced from a fresh verified download.
- `scripts/materialize-antigravity-distribution.mjs`: exports its
existing owned-file helpers so the new route reuses them. There is no
behavior change.
- `src/drivers/acpx/antigravity-cli-installation.ts` and
`antigravity-cli-pins.ts`: `resolveAntigravityCliLaunch({ arguments?,
platform?, architecture?, home? })`, exported from the package. It
returns `version`, `build`, `target`, `commandDigest`, the exact
`arguments` (`acp` followed by the driver's), the frozen pinned
`environment`, `environmentFor(base)`, and a `VerifiedAcpxInstallation`
from `verifyNativeAcpxInstallation` (sealed store, per-launch executable
hash, `storeFamily: "antigravity-cli"`). Errors are
`AntigravityCliRuntimeError` with the codes
`ANTIGRAVITY_CLI_UNSUPPORTED_PLATFORM` and
`ANTIGRAVITY_CLI_RUNTIME_MISSING`. Both are permanent. The pins are
compiled in, and a test keeps them equal to the JSON.
- `cli/src/commands/runtime.ts`: adds `paperclipai runtime setup
antigravity-cli` through a small shared resolver and runner for vendored
provisioners.
- The bundle step builds `dist/cli/provision-antigravity-cli.{js,cjs}`
and copies the JSON pin to `dist/`. No binary goes into npm, the
provider pack or an image.
- Docs: a README section on the resolver, and a note in
`doc/plans/2026-11-22-antigravity-qualification.md`. The note says the
CLI route is experimental, is fetched at setup time, and why.
Pinned values (downloaded once from Google into an empty scratch
directory. Each archive matched Google's published manifest. The Linux
binaries were not run):
| Target | Archive URL (under
`https://storage.googleapis.com/antigravity-public/antigravity-cli/1.5.15-5514532022517760/`)
| Archive bytes | Archive SHA-512 | Executable bytes | Executable
SHA-256 |
|---|---|---|---|---|---|
| darwin-arm64 | `darwin-arm/cli_mac_arm64.tar.gz` | 86,166,538 |
`b03a841e…` | 229,617,904 | `8097b24d…` |
| linux-x64 | `linux-x64/cli_linux_x64.tar.gz` | 101,464,790 |
`af3f0be5…` | 273,879,752 | `7b004d26…` |
| linux-arm64 | `linux-arm/cli_linux_arm64.tar.gz` | 92,373,221 |
`d64ad759…` | 256,660,144 | `497580a7…` |
The darwin-arm64 executable matches the copy that was already verified
(Developer ID Application: Google LLC, team `EQHXZ8M8AV`). The full
digests are in the JSON.
## Verification
- Red then green: `node --test
packages/paperclip-runner/scripts/materialize-antigravity-cli-distribution.test.mjs`
(9 tests). It uses in-memory tar.gz fixtures and makes no network calls.
It covers the pins, a refused declaration, tar strictness, a verified
install with an idempotent re-run, a tampered archive, truncation, a
wrong-platform archive, an executable digest mismatch, the size
enforcement and redirect refusal of the download path, the repair of a
modified install, and an unsupported host.
- Red then green: `vitest run
src/drivers/acpx/antigravity-cli-installation.test.ts
src/drivers/acpx/antigravity-cli-pins.test.ts`. The resolver spawns a
fixture `agy` from the sealed store with `acp` plus the driver's
arguments and the pinned environment. It also covers a modified install,
a missing install that names the setup command, an unsupported platform,
and invalid arguments.
- Red then green: `cli` `vitest run src/__tests__/runtime-setup.test.ts
src/__tests__/runtime.test.ts`.
- Existing suites: `vitest run src/drivers/acpx/antigravity*
native-distribution-integrity* candidate-admission.antigravity-release
capability-profiles.antigravity-release` and `node --test
scripts/build-verified-provider-entrypoints.test.mjs` (includes the
registry-server materialize and patch tests),
`acpx-release-attestations`, `release-provider-pack`,
`antigravity-provider-pack-smoke`, `installed-package-pack`,
`candidate-provider-pack`. All pass. Under full parallel load, two
existing timing-sensitive tests (`probe-antigravity-metadata` SIGKILL
shutdown, `antigravity-acpx-runtime` model admission) failed once and
passed when run alone. This change does not touch those modules.
- Typecheck: `tsc --noEmit` for `packages/paperclip-runner` and `cli`.
- Real archives, local: materialize succeeded for all three real
archives against the real pins. The Linux binaries were extracted and
hashed only. The darwin build with a linux-x64 archive failed closed
with "Nothing was installed."
- End to end on macOS ARM64 with a scratch `HOME`: the bundled
`dist/cli/provision-antigravity-cli.cjs` downloaded from Google and
installed in 10.7 s. The re-run printed "Verified" with no download.
`resolveAntigravityCliLaunch({ arguments: ["--help"] })` ran the real
`agy acp --help` from the sealed store copy (exit 0, 1.4 s including
first store admission). `codesign --verify --strict` passes on the
installed copy.
- `pnpm verify` returned exit 2 (the README is a broad input). Required
CI supplies the broad coverage.
- Not run: the Linux binaries (no execution on this Mac), a Linux host
setup, and the full local suite.
## Risks
- Low risk. Nothing selects or launches the CLI route yet. The existing
registry-server pins, the admission patch, profile digests and
`acpx-profiles.json` are unchanged.
- The provider pack and the server's vendored Runner now also carry the
small provisioner script and the JSON pin (no binary), like the existing
Antigravity provisioner.
- Bucket immutability is not proven. If Google replaces an object at the
versioned path, setup fails closed on the digest. It does not install
different bytes.
- macOS code-signature team checks are not added. The repository has no
such hook, and the exact executable digest is a stronger pin.
> 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`) in Claude Code, with
tool use (shell, file edits) and extended reasoning.
## 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: Claude Opus 5.5 <noreply@anthropic.com>
canary/v2026.1124.0-canary.851700
|