mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 09:39:53 +01:00
1eae356c558464bd7b857f3c75edbcfb2b4068eb
8732
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1eae356c55 |
fix(analytics): remove PostHog consent banner and opt-out gating for private beta (#23333)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Paperclip Cloud sends browser product analytics and session replays to PostHog when enabled for a hosted stack (self-hosted installs never load posthog-js) > - Previously, an EU/UK/Swiss consent banner and Profile settings opt-out toggle gated browser analytics and dropped metrics when visitors did not opt in > - During private beta, we want to stop showing the consent banner and opt-out prompt anywhere while continuing to send metrics (compliance will be handled separately later) > - This pull request removes the consent banner, Profile opt-out toggle, and client-side consent gating across the UI and sets `consentRequired: false` on the server response > - The benefit is zero banner friction during private beta and uninterrupted PostHog product metrics, while keeping all replay/autocapture privacy masking and pre-load event queuing intact ## Linked Issues or Issue Description **What existing behavior does this improve?** Paperclip Cloud browser product analytics initialization (`ProductAnalyticsGate`, `ui/src/lib/analytics`, `ProfileSettings`, `cloud-posthog-browser.ts`). **Subsystem affected** Cross-cutting (multiple of the above) — `ui/` and `server/`. **Current behavior** In EU/EEA/UK/Swiss regions (or unknown time zones), `ProductAnalyticsGate` renders `AnalyticsConsentBanner` and blocks loading `posthog-js` until the visitor clicks Accept. `ProfileSettings` also renders a `ProductAnalyticsSetting` opt-out switch. **Proposed behavior** Remove `AnalyticsConsentBanner`, `ProductAnalyticsSetting`, and client-side consent gating so `ProductAnalyticsGate` loads PostHog unconditionally when `browserAnalytics` is enabled for a Cloud stack. Return `consentRequired: false` from `resolveBrowserAnalyticsConfig` so cached older UI bundles also stop prompting during rollout, and keep `opt_in_capturing()` when `has_opted_out_capturing()` is true so previously opted-out browsers resume sending metrics. **Reason and benefit** During private beta, the EU/UK consent banner adds friction and drops PostHog product metrics. Removing the banner and opt-out gating restores full metric delivery while keeping all replay/autocapture privacy masking and pre-load event queuing intact. **Breaking changes** None — `browserAnalytics.consentRequired` remains on the session payload (as `false`), self-hosted installs still receive `browserAnalytics: null`, and per-stack env controls (`PAPERCLIP_POSTHOG_BROWSER_ENABLED`, `PAPERCLIP_POSTHOG_REPLAY_ENABLED=0`) continue to work. ## What Changed - Deleted `ui/src/components/AnalyticsConsentBanner.tsx`, `ui/src/components/ProductAnalyticsSetting.tsx`, `ui/src/lib/analytics/consent.ts`, and their unit tests. - Simplified `ui/src/components/ProductAnalyticsGate.tsx` to start PostHog unconditionally after the page settles and render `null`. - Simplified `ui/src/lib/analytics/product-analytics.ts` to remove consent-state gating while keeping pre-load event queuing (`MAX_QUEUED_PRODUCT_EVENTS`) and automatic opt-in for browsers with a prior PostHog opt-out. - Removed `ProductAnalyticsSetting` from `ui/src/pages/ProfileSettings.tsx` and its mock in `ui/src/pages/mobile-collections-responsive.test.tsx`. - Updated `server/src/services/cloud-posthog-browser.ts` to always return `consentRequired: false`. - Updated `ui/src/components/ProductAnalyticsGate.test.tsx`, `ui/src/lib/analytics/onboarding-analytics.test.tsx`, `server/src/__tests__/cloud-posthog-browser.test.ts`, `server/src/__tests__/auth-routes.test.ts`, and `doc/cloud-browser-analytics.md`. ## Verification - `pnpm vitest run ui/src/components/ProductAnalyticsGate.test.tsx ui/src/lib/analytics/onboarding-analytics.test.tsx ui/src/lib/analytics/product-analytics.test.ts ui/src/pages/mobile-collections-responsive.test.tsx server/src/__tests__/cloud-posthog-browser.test.ts server/src/__tests__/auth-routes.test.ts` — all passed. - `pnpm --filter @paperclipai/ui typecheck` — passed. - `pnpm --filter @paperclipai/server typecheck` — passed. ## Risks - Low risk: self-hosted installs remain unaffected (`browserAnalytics` is still `null`). All replay/autocapture privacy masking and `/_ph` proxy allowlists remain unchanged. Per-stack opt-out (`PAPERCLIP_POSTHOG_BROWSER_ENABLED` / `PAPERCLIP_POSTHOG_REPLAY_ENABLED=0`) continues to work. ## Model Used - Google Gemini (Antigravity 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 - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
adc4501689 |
Add a desktop handoff to mobile Cloud onboarding (#23326)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Onboarding asks users to connect a model before they can finish setting up their agent. > - Cloud users can start setup on a phone, where provider sign-in and key entry can be difficult. > - They need a way to find the same workspace on a computer. > - This pull request adds a copyable link on the mobile model step and defers agent creation while the handoff is offered. > - A user can open the link on desktop or continue on the phone. ## Linked Issues or Issue Description **Subsystem affected** React onboarding UI and its Cloud health metadata. **Problem or motivation** On a phone, the Cloud model step does not explain how to find the same onboarding page on a computer. The fresh agent draft is local to that browser and can leave a provisional agent behind. **Proposed solution** Offer Continue on desktop and Keep going here at the start of the mobile model step. Copy the workspace's HTTPS `/onboarding` link. Ask users to sign in to the same account on desktop and explain that they may need to enter their choices again. **Alternatives considered** The original invite URL would carry an invite token. Copying the workspace's onboarding URL lets Cloud handle sign-in through its existing entry flow. **Roadmap alignment** This is a focused improvement to the existing onboarding wizard. It uses the current Cloud workspace entry flow and keeps model selection available on mobile. **Additional context** Refs #23315 for naming-step setup drafts. Related prior work: #3594 covered a native iOS-to-web handoff token and is closed. ## What Changed - Add the Cloud mobile handoff panel and clipboard fallback. - Prefer the canonical tenant HTTPS origin and build a clean `/onboarding` URL. Older tenants can use the current HTTPS tenant origin. - Defer the provisional agent in the naming and model steps while the mobile handoff is available. Desktop and self-hosted sessions keep the early-draft behavior from #23315. - Render the step indicators as round dots inside the step buttons so the mobile touch-height rule does not stretch them. - Add browser coverage for the Cloud and self-hosted paths and unit coverage for URL handling. ## Verification - Passed 52 focused Vitest tests for the onboarding route, stepper, handoff URL, and shared clipboard policy. - Passed UI typecheck, the test-budget guard, and `git diff --check`. - Passed 23 tests in desktop Chrome with four workers, including the affected CI browser shard and the upstream early-draft regression. The handoff scenarios cover the mobile dots, clipboard success and manual fallback, same-workspace desktop re-entry via simulated sign-in, continuing on mobile, and the self-hosted flow. - Manual reproduction: use a fresh Cloud test workspace and a 390 × 844 viewport. Enter an agent name and proceed to Connect a model. Open Continue on desktop and copy the link. Open it on desktop and sign in with the same account if needed. A real Cloud sign-in was outside the local fixture. ## Risks - Setup choices from the phone may need to be entered again on desktop. - Real Cloud sign-in and in-app mobile browsers still need a live tenant check. No database migration is needed. ## Model Used - OpenAI Codex with GPT-6.2 Sol (`gpt-6.2-sol`) for branch preparation and verification. Used the terminal and Chromium. The context window size is not available in the session. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [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 <1504818+scotttong@users.noreply.github.com>canary/v2026.1130.0-canary.873100 |
||
|
|
d71d039ad7 |
fix(ui): link routine projects by ID (#23332)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Routines assign repeated work to an agent and an optional project. > - A routine stores its project ID, but its detail page links to the project's name-derived URL key. > - A cached name can stop identifying that project after a rename. > - This pull request uses the project ID in that link. > - The link stays attached to the selected project when its name changes. ## Linked Issues or Issue Description **What happened?** The routine detail page prefers a project's name-derived URL key over its ID. A cached routine page can link to an old project name after a rename. If another project takes that name, the old link can resolve to the other project. Saved routine associations, filters, and scheduler joins already use project IDs. **Expected behavior** The project link should identify the routine's selected project by ID. **Steps to reproduce** 1. Open a routine attached to a project named Operations. 2. Rename the project while the routine page retains its cached project data. 3. Inspect the routine's project link. Before this change, it uses `/projects/operations`. After this change, it uses `/projects/<project-id>`. ## What Changed - Use the project ID for the project link on the routine detail page. - Add rendered-link regression tests for a rename, same-name projects, and an unassigned routine. ## Verification - Confirmed that the rename and same-name link tests fail before the fix. - All 24 focused tests pass across routine page, routine form, routine list filtering, routine row selection, and company link routing. - `pnpm --filter @paperclipai/ui typecheck`: passed after building the fresh worktree's shared and plugin SDK dependencies. - `node scripts/check-test-budget.mjs --files ui/src/components/routine-page/RoutinePage.test.tsx`: passed. - `pnpm verify`: passed on final head `989dad85d8fc6dfe45cc4490e798dd8da1fb1ff1`. All 309 selected files passed: 4,012 UI tests and 537 CLI tests passed, with one UI test skipped. Environment: macOS arm64, Node 25.6.1, pnpm 9.15.4. - Earlier attempts exposed missing Postgres package library symlinks in the fresh worktree, then a run invalidated by changed setup inputs. Ran the dependency's own symlink hydration script and repeated verification on the stable final checkout. Those earlier attempts are not counted as passes. - CI [typecheck](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142231921191), [build](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142231921278), and [policy](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142231921302) passed on the final head. All selected test and browser shards passed. The final [verify gate](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142233704075) and [e2e gate](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142233695844) passed on the same head. - [Greptile review](https://github.com/paperclipai/paperclip/pull/23332#issuecomment-7293910180): 5/5 on the final head, with no findings. - No live tenant, deployment, or browser acceptance test was run. This change only changes a link target. - Reviewed the complete diff locally for secrets, personal data, and run artifacts. ## Risks Low risk. The project page already accepts project IDs and applies its existing authorization and canonical URL handling. The link's visible label stays the project name. There is no schema or API change. Revert the link change to restore the former behavior. ## Model Used OpenAI Codex, `gpt-6.1-sol`, with xhigh reasoning effort and local code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
3884cc6df4 |
fix(ui): open Needs You on Assigned to you, keep saved filters (#23321)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The Coordinator Inbox (Needs You, `/decisions`) shows the decisions and problems that wait for a person > - #22964 made the page open on "All assignees" for a board member who has no saved assignee choice > - The page title and badge read as personal, so a board member sees other people's decisions and thinks they are theirs to act on > - This pull request opens the page on "Assigned to you" again when no choice is saved, and keeps the saved toolbar from #22964 > - The benefit is that each person opens on their own work, and a board member who wants the company-wide queue picks "All assignees" once and keeps it ## Linked Issues or Issue Description Refs #22964 **What existing behavior does this improve?** The opening assignee filter on the Coordinator Inbox / Needs You page (`/decisions`). **Current behavior** A board member with no saved assignee choice opens Needs You on "All assignees". The page shows decisions that are for other people (for example, a question an agent asked the person who created the task), with no signal that the list is not personal. **Proposed behavior** Every person with no saved assignee choice opens Needs You on "Assigned to you". The assignee, agent, project, and grouping choices stay saved per company and person, as in #22964. A board member who picks "All assignees" or one person still reopens on that choice. **Reason and benefit** A page named "Needs you" must open on the work that needs this person. The saved toolbar already removes the repeated clicks that #22964 set out to remove, so the company-wide default is not necessary. ## What Changed - `ui/src/lib/coordinator-attention.ts`: `openingCoordinatorAssignee` returns "Assigned to you" when no usable choice is saved, also for board members. A saved choice that the person may open still wins. - `ui/src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx`: Tests now start from "Assigned to you", prove that "All assignees" sticks after a person picks it, and prove that the page loads the personal feed at once when nothing is saved. The board-access wait test now covers a saved "All assignees" choice. - `ui/src/lib/coordinator-attention.test.ts`: Update the unit expectations for the opening filter. - `tests/e2e/coordinator-inbox-views.spec.ts`: Assert "Assigned to you" on open, then pick "All assignees" and prove that it and the grouping persist across navigation and reload. - `doc/PRODUCT.md`: Document the opening filter and the saved choices. ## Verification - `cd ui && npx vitest run src/components/coordinator/ src/lib/coordinator-attention.test.ts src/hooks/useAttentionViews.test.tsx src/lib/attention-views.test.ts` → 7 files, 49 tests passed. - RED check: with the old `everyone ? "all" : "me"` fallback restored, 13 tests in the toolbar and coordinator-attention suites fail. - `pnpm --filter @paperclipai/ui typecheck` → pass. - `PAPERCLIP_E2E_PORT=3257 npx playwright test --config tests/e2e/playwright.config.ts tests/e2e/coordinator-inbox-views.spec.ts` against a freshly built UI → 2 passed (desktop and mobile). ## Risks - Behavioral shift: board members who relied on the #22964 default open on "Assigned to you" until they pick "All assignees" once. After that, the saved choice applies. - A board member who already picked a filter keeps it. No saved data changes. - The classic (non-Coordinator) Decisions page is unchanged. > 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`) by Anthropic, in Claude Code with tool use, shell execution, 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 - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1130.0-canary.872900 |
||
|
|
1949a8fa10 |
fix(onboarding): sign in through a plugin-managed execution environment (#23312)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Onboarding connects the first agent to an AI provider account, often with a Claude or Codex subscription sign-in > - A plugin can manage an execution environment whose driver declares `supportsLoginPty` and `requiresAgent`. Each agent's lifecycle prepares that environment for the agent, and the sign-in runs in it > - An instance can make such a plugin-managed execution environment its default > - The onboarding wizard offered browser sign-in only in a sandbox-driver environment, so it blocked the connect step in every plugin-managed execution environment > - The sign-in also cannot start until the agent's lifecycle has prepared the environment > - This pull request lets onboarding and the new-agent flow sign in through a plugin-managed execution environment, after the environment is prepared for the agent > - The benefit is that subscription sign-in works when the default environment is plugin-managed ## Linked Issues or Issue Description Refs #22695 and #20906. **What happened?** The default environment is a plugin-managed execution environment whose driver declares `supportsLoginPty`. A user starts onboarding and chooses Claude or Codex with a subscription. The connect step shows "This environment does not support browser sign-in. Go back to use an API key or choose another model." Connect stays disabled. **What did you expect to happen?** The connect step starts a browser sign-in in the plugin-managed execution environment for the onboarding agent. The agent configuration form and the AI Connections page already do this for plugin-managed environments. **Steps to reproduce** 1. Install an environment plugin with a `requiresAgent` driver that declares `supportsLoginPty`, and make its environment the instance default. 2. Start onboarding for a new company. 3. Choose Claude or Codex, and keep the subscription option. 4. See the message above. Connect is disabled. ## What Changed - The onboarding wizard and the new-agent flow use the shared `environmentSupportsLoginPty` rule. Before, both flows had their own sandbox-only check. - In a plugin-managed execution environment, onboarding sends the sign-in to its own setup agent (`requiresAgent` and `agentId` on `AdapterLoginPanel`). The new-agent flow does the same with its draft agent. - Onboarding polls the setup agent until the environment can take the sign-in for it: a Paperclip runner agent on the login environment in `verifying` or `ready`. Until then the step shows "Preparing your agent's computer…", the user-facing name for this environment. A failed preparation shows the error and a "Retry preparation" button. A failed agent read shows "Could not check your agent's computer." and retries the read. - The new-agent flow keeps the login panel unmounted until the environment is prepared (`loginHostPending` on `AgentProviderConnection`). The panel starts the sign-in on mount, and the disabled fieldset does not stop that. - Both flows latch the readiness per agent and environment (`useAgentComputerLoginReady`). A configuration change sends the setup draft through preparation again. That must not unmount a sign-in that is already on screen. - The auth-signal route now accepts a plugin-managed execution environment for `claude_local` and `codex_local`, and answers `unknown` there. Before, it returned 422, and the onboarding step stayed undecided and never showed the sign-in. The signal reads only host-local state, which says nothing about a plugin-managed environment. - The new-agent flow now says "Preparing your agent's computer…", the same as onboarding. - Each part of the login PTY question now has one owner: - Shared `environmentLoginRequiresAgent` decides whether a sign-in needs an agent. The four UI flows and the server's login target resolver use it instead of their own `driver === "plugin"` checks. - Shared `isPluginEnvironmentLoginAdapter` and `pluginEnvironmentLoginReadsCredential` decide which adapters sign in through a plugin-managed execution environment, and which of them must read the credential back. `environmentSupportsLoginPty` and the server's login target resolver use them. The server's capability resolver takes the adapter type instead of a credential-read flag. - `sandboxProviderSupportsLoginPty` decides sandbox-provider support for both the capability listing and the sign-in check. - The credential read uses `pluginSupportsLoginPty`, like the rest of the plugin login path. Before, it checked only the manifest flag and the read method. - The agent configuration form's gate is now the shared rule plus "not in create mode when an agent is required". Its duplicate driver check and an always-true condition are gone. ## Verification - `pnpm typecheck` in `ui/` and `server/`: no errors. - `npx vitest run src/lib/agent-computer-login.test.ts src/lib/agent-computer-login.hook.test.tsx src/components/new-agent/AgentProviderConnection.computer-login.test.tsx src/components/new-agent/AgentProviderConnection.test.tsx` in `ui/`: tests pass. The `AgentProviderConnection` sign-in test covers a slow preparation, and the readiness hook test covers a re-preparation of the same environment. - `npx vitest run src/__tests__/adapter-auth-signal-routes.test.ts` in `server/`: tests pass. The two new plugin-managed environment cases fail without the route change. - `pnpm typecheck` in `packages/shared/`: no errors. `npx vitest run src/environment-support.test.ts` in `packages/shared/`: 9 tests pass. - In `server/`: the device-login, setup-token, login-session runtime, sandbox-capability, credential-read and OpenAPI route suites pass (159 tests). A new credential-read case refuses a driver that does not meet the plugin login rule. - In `ui/`: the `AgentConfigForm`, `AgentProviderConnection`, `agent-computer-login` and onboarding analytics suites pass. - I did not do a live onboarding with a real plugin-managed execution environment. Reviewers who have such an instance can reproduce with the steps above. Expect "Preparing your agent's computer…", then the provider sign-in, then the hire. ## Risks - Onboarding waits for the environment's preparation before a subscription sign-in in a plugin-managed execution environment. A slow preparation makes the connect step wait for that time. An API key or a saved subscription does not wait. - The latch keeps the sign-in on screen while a configuration change prepares the same environment again. If the plugin refuses the sign-in in that window, the sign-in panel shows its usual error and retry. - The setup draft must resolve to the Paperclip runner in the plugin-managed environment. If it does not, the step stays on "Preparing your agent's computer…". Plugin-managed environments run only the Paperclip runner, so this is not expected. - No migration and no API contract change. The auth-signal route accepts one more environment driver. - The credential read now requires the full plugin login rule (`creationOperationVersion` 1 and every login worker method). A plugin that reaches the credential read already passed that rule when its login lease was acquired, so no working plugin should change. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), with extended thinking and tool use (code search, shell, tests) 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 - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
554227d926 |
fix(analytics): send queued product events after consent (#23328)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Hosted workspaces record browser product events for the onboarding funnel. > - The wizard can open before a visitor accepts browser analytics. > - The capture path discarded those events and did not send them after Accept. > - This pull request holds pending events in page memory until the visitor accepts. > - The funnel can then retain the original event order and times. ## Linked Issues or Issue Description **What happened?** A visitor could open onboarding, complete steps, and then accept analytics. The earlier browser events were missing. The funnel could show server events such as workspace entry without the later onboarding events, even when the visitor used the wizard. **Expected behavior** Hold structured product events while consent is pending. Send them once after Accept, with their original order and timestamps. Discard them after Decline or a change of user. Do not load PostHog before consent. **Steps to reproduce** 1. Open a hosted workspace that requires analytics consent, with no stored choice. 2. Open onboarding and complete a step before choosing Accept. 3. Choose Accept. 4. Confirm that the opening and step events reach the analytics client once, with their original timestamps. **Paperclip version or commit** The fix is based on master at `630cf042302`. The tested PR revision is `46df54b9ede8e5757f7af1a9d41b3c3593fe3430`. **Deployment mode** Hosted workspace browser analytics. The regression runs locally in jsdom. Related merged work: #22186 added browser consent; #22814 added onboarding failure and chat events; #23315 enabled draft saving in the naming step. A search found no duplicate PR for this queue fix. ## What Changed - Track pending, granted, and denied consent in the browser analytics state. - Reuse the existing 50-event queue while consent is pending. Flush it on Accept, after the client is ready. - Clear pending events on Decline or a change of user. Apply user identity before sending the queue. - Add regression tests for the Accept button, onboarding events, queue limits, and user changes. Document the queue lifetime. - Remove the retired Runner support assertion that draft saving is limited to step 4. PR #23315 added saving in both naming and connect steps. Retain the other first-agent checks and the existing early-setup browser test for name persistence and draft reuse. ## Verification Environment: macOS arm64, Node.js v25.6.1, pnpm 9.15.4. Final local checks use revision `46df54b9ede8e5757f7af1a9d41b3c3593fe3430`. - The Accept-button regression failed before the fix: it expected the earlier events but received an empty capture list. - `pnpm exec vitest run --project @paperclipai/ui ui/src/lib/analytics ui/src/components/ProductAnalyticsGate.test.tsx ui/src/components/ProductAnalyticsSetting.test.tsx`: passed, 289 tests across 9 files. - `pnpm exec vitest run --config tests/runner-e2e/vitest.config.ts tests/runner-e2e/chat-catalog-domains/identity-new-company-native.test.ts`: passed, 51 tests. This suite first reproduced the stale draft-step assertion from the failed CI job. - `pnpm --filter @paperclipai/ui typecheck`: passed. - `node scripts/check-test-budget.mjs --files tests/runner-e2e/chat-catalog-domains/identity-new-company-native.test.ts ui/src/components/ProductAnalyticsGate.test.tsx ui/src/lib/analytics/onboarding-analytics.test.tsx`: passed. - `git diff origin/master...HEAD --check`: passed. - `pnpm verify`: exited 2 because `doc/cloud-browser-analytics.md` triggers broader CI coverage. Focused checks above passed; the full local suite was not run. - GitHub Actions CI: [all planned suites passed](https://github.com/paperclipai/paperclip/actions/runs/46519983330/job/142210329280) on `46df54b9ede8e5757f7af1a9d41b3c3593fe3430`, including [typecheck and release registry](https://github.com/paperclipai/paperclip/actions/runs/46519983330/job/142208788257), [build](https://github.com/paperclipai/paperclip/actions/runs/46519983330/job/142208788273), Runner support, general tests, serialized tests, and browser E2E shards. No live PostHog capture was checked. - Greptile: [5/5 on the current revision](https://github.com/paperclipai/paperclip/pull/23328#issuecomment-7292786296), with a successful check and no unresolved review threads. ## Risks - Accept now sends structured product events generated earlier in the same page visit. Nothing is sent while consent is pending. - The queue retains at most 50 events in memory. Further events are dropped until it drains. Reloading the page loses the pending queue. - This change does not record earlier page views or session replay. PostHog still loads only after consent. ## Model Used OpenAI `gpt-6.1-sol`, through the Codex harness in T3 Code, with xhigh reasoning effort and shell/code tools. The harness does not expose the context window size. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
f37252180b |
fix(openclaw-gateway): keep whitespace on streamed assistant deltas (#14150)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The `openclaw_gateway` adapter streams the agent reply as `assistant` deltas and joins them into the run summary > - Each delta goes through `nonEmpty()`, which trims whitespace > - Deltas carry their word-boundary space (`" blocked"`), so the trim removes it and words run together > - The broken text is stored as the issue comment, so users see corrupted agent replies > - This pull request keeps each delta verbatim and skips only empty strings > - The benefit is that agent comments from the OpenClaw gateway are stored correctly ## Linked Issues or Issue Description Fixes #14149 ## What Changed - Add `readAssistantChunk()` in `execute.ts`. It returns a non-empty string `delta` without a trim. If there is no delta, it falls back to the trimmed `text` (the old behavior). - Use `readAssistantChunk()` in the `assistant` stream handler. - Add unit tests for whitespace-bearing, whitespace-only, empty, and non-string deltas. ## Verification - `npx vitest run src/server/execute.test.ts` in `packages/adapters/openclaw-gateway`: 12 tests pass. - `npx tsc --noEmit` in the same package: no errors. - Manual: the same one-line change is applied to a local 2026.916.1 install that showed the bug. ## Risks Low risk. The change affects only `assistant` deltas. The final `join("").trim()` still removes outer whitespace from the summary. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, with tool use and code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: EpaL <358229+EpaL@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Andrew Aymeloglu <aaymeloglu@gmail.com>canary/v2026.1130.0-canary.872600 |
||
|
|
630cf04230 |
feat(onboarding): create the first agent's setup draft in the naming step (#23315)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Onboarding creates a company, names its first agent, and then connects the agent to an AI provider > - A plugin can manage an execution environment that its driver prepares for each agent (`requiresAgent`). The agent's lifecycle starts that preparation when the agent's setup draft exists > - Onboarding created the setup draft when the connect step opened, after the agent was named > - The preparation can be slow, and a subscription sign-in in that environment waits for it > - This pull request creates the setup draft in the naming step, so the preparation overlaps naming > - The benefit is a shorter wait before sign-in when the default environment is plugin-managed ## Linked Issues or Issue Description Refs #23312. **What existing behavior does this improve?** The onboarding naming step and the connect step for a new company. **Current behavior** The wizard creates the first agent's provisional setup draft when the connect step opens. A plugin-managed execution environment starts its preparation for the agent only then. A subscription sign-in in that environment waits for the full preparation (see #23312). **Proposed behavior** The wizard creates the same provisional setup draft when the naming step opens for a company with no agents. The preparation runs while the user names the agent. **Reason and benefit** The preparation does not depend on the provider choice. A later configuration change prepares the same environment again, which is fast because the environment already exists. The user waits less before sign-in. ## What Changed - The naming step creates the provisional setup draft as soon as a company with no agents exists. The draft is the same record the connect step created before: a provisional adapter, `setupAdapterPending`, and the role label as a placeholder name. - The naming step saves the typed name to the draft after a 400 ms pause in typing. The connect step saves it at once, as before. - A company that has agents keeps the old path, so the connect step's same-name reuse still applies. A failed early create also falls back to the connect step. The wizard tries the early create once per company. - When the connect step restores a provisional draft (source still pending), the wizard keeps its own name, role and appearance when it has a name. A name typed after a reload in the naming step is newer than the draft's name. - The `create-company path` e2e test now expects the draft when the naming step opens. A new e2e test covers the early draft, the saved name, a reload in the naming step, and that the connect step adopts the same record. ## Verification - `pnpm typecheck` in `ui/`: no errors. - `PAPERCLIP_PLAYWRIGHT_CHANNEL=chrome npx playwright test --config tests/e2e/playwright.config.ts tests/e2e/onboarding-early-setup.spec.ts tests/e2e/onboarding.spec.ts -g "naming step creates|create-company path"`: 2 tests pass. - The new `onboarding-early-setup` test fails without the wizard change: it times out while it waits for the draft in the naming step. - I did not measure the time saved on a live plugin-managed execution environment. It is about the time the user spends in the naming step. ## Risks - A user who stops onboarding in the naming step leaves a setup draft. In a plugin-managed execution environment, that draft also keeps its prepared environment. Before this change, the same happened to a user who stopped in the connect step. - The draft's name is the role label until the first save in the naming step. A reload in the first 400 ms after typing can lose those characters. The wizard keeps the name that is typed after the reload. - No migration and no API change. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), with extended thinking and tool use (code search, shell, tests) 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 - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>canary/v2026.1130.0-canary.872500 |
||
|
|
48deef0135 |
fix(claude-local): fail runs whose prompt a UserPromptSubmit hook blocked (#17766)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The `claude_local` adapter runs the Claude Code CLI and turns its stream-json output into a run result > - A project can define a `UserPromptSubmit` hook, and that hook can block the prompt > - When the hook blocks the prompt, the CLI runs no turn, exits 0 and reports a successful `result` whose text echoes the whole prompt > - The adapter returned that echo as the agent's reply, the server posted it as a comment, and the next wake carried that comment in the task history > - So each retry doubled the prompt, and the run looked successful > - This pull request detects the blocked prompt and fails the run with a specific error code and no echoed reply > - The benefit is that a hook rejection is visible as a failed run, and the prompt stops growing ## Linked Issues or Issue Description No public issue exists for this. I searched open and closed issues and pull requests for `UserPromptSubmit`, `blocked_by_hook`, `prompt_submit_outcome` and "hook blocked prompt". Related, but different: #15417 (pass-through of hooks-only settings for managed connections), #11976 / #16443 (Hermes prompt echo). **What happened?** A project `UserPromptSubmit` hook blocked the wake prompt. Claude Code emitted a `system` event with subtype `informational` and `prompt_submit_outcome.kind = "blocked_by_hook"`, then a `result` event with `subtype: "success"`, `is_error: false`, `num_turns: 0` and `result` equal to `UserPromptSubmit operation blocked by hook: … Original prompt: <whole prompt>`. The process exited with code 0. The adapter treated the run as successful and used the echoed text as the summary. The server posted the echo as the agent's comment. The next wake included that comment in the task history, so the prompt grew on each retry. We observed a wake prompt of about 3.6 MB. **Expected behavior** A prompt that a hook blocked is a failed run. The run must not post the echoed prompt as a reply. The run error must say that a hook blocked the prompt and give the hook reason. **Steps to reproduce** 1. In an empty directory, create `.claude/settings.json` with `{"hooks":{"UserPromptSubmit":[{"hooks":[{"type":"command","command":"echo 'blocked by policy hook' >&2; exit 2"}]}]}}`. 2. Run `claude -p --output-format stream-json --verbose "say hi" < /dev/null`. 3. See the `informational` event with `prompt_submit_outcome: {"kind":"blocked_by_hook","prompt_kept":false,"reason":"blocked by policy hook"}`, then a `result` event with `subtype: "success"`, `num_turns: 0` and the echoed prompt, and exit code 0 (seen with Claude Code 2.1.309). 4. Use the same project for a `claude_local` agent and wake it. Before this change, the run succeeds and its summary is the echoed prompt. **Paperclip version or commit** Seen on v2026.1023.0. The patch base is `master` at `a67a18c171`. **Deployment mode** Self-hosted, `claude_local` with `engine: cli`. ## What Changed - `createClaudeStreamParser` records the reason from a `system`/`informational` event whose `prompt_submit_outcome.kind` is `blocked_by_hook`, and returns it as `promptBlockedReason`. - `execute` sets `errorMessage` to `Claude prompt was blocked by a UserPromptSubmit hook: <reason>`, `errorCode` to `claude_prompt_blocked_by_hook`, `stopReason` to `prompt_blocked_by_hook`, an empty summary and `result: null` in `resultJson`. A non-null `errorMessage` makes the server record the run as failed. - The new error code is not a transient code, so the bounded transient retry does not repeat the blocked prompt. - Add an execute regression test with a fake CLI that emits the real event sequence. ## Verification - `npx vitest run server/src/__tests__/claude-local-execute.test.ts`: 35 passed. - The new test fails on `master` without the source change (`expected null to be 'claude_prompt_blocked_by_hook'`). - `tsc --noEmit` in `packages/adapters/claude-local`: no errors. `tsc --noEmit` in `server` gives the same error list as unchanged `master` in the same environment (the only errors come from the unbuilt `@paperclipai/paperclip-runner` package). - Manual check of the CLI event shape with Claude Code 2.1.309, as in the steps above. ## Risks - Low risk. The new branch runs only when the CLI reports `prompt_submit_outcome.kind === "blocked_by_hook"`. - If a future CLI version changes this event shape, the adapter falls back to the current behavior. > 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 AI-assisted with Claude Code and OpenAI Codex coding agents; exact model versions are not listed. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [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 (none needed: no documented behavior or setup changes) - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>canary/v2026.1130.0-canary.872400 |
||
|
|
a1b9eed57d |
fix(mcp): stop masking upstream MCP and OAuth 502 errors as Paperclip outages (#23295)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Users connect external MCP servers and OAuth apps in Paperclip so
agents can use their tools
> - When a remote MCP server or OAuth authorization server rejects
automatic registration or discovery (for example, returning HTTP 400
`invalid_redirect_uri` during Dynamic Client Registration), Paperclip
returns HTTP 502 with a structured upstream error payload
> - The UI error classifier previously treated every HTTP 502 without a
`CODE_COPY` entry as a Paperclip outage, so it discarded the server
message and showed "Paperclip is temporarily unavailable"
> - This pull request shares a canonical allowlist of upstream
MCP/OAuth/remote HTTP 502 error codes between the server and UI,
preserves upstream error messages with accurate retryability, shows
clear sign-in guidance with Paperclip's copyable callback URL, and
resumes the saved draft connection during manual client recovery
> - The benefit is that users immediately see why a remote MCP server
rejected sign-in and how to fix it (allowlisting Paperclip's callback
URL or entering a client ID) without hitting a false Paperclip outage or
creating duplicate connections
## Linked Issues or Issue Description
**What happened?**
When a user connects a remote MCP server with browser sign-in and the
remote authorization server rejects Dynamic Client Registration (for
example, returning HTTP 400 `invalid_redirect_uri` because it requires a
client allowlist), the Paperclip server returns HTTP 502 with `{ error:
"The authorization server rejected Paperclip's callback URL.", details:
{ code: "oauth_dynamic_client_registration_failed", providerError:
"invalid_redirect_uri", status: 400 } }`. The UI classified that HTTP
502 as a transient connectivity outage and displayed "Paperclip is
temporarily unavailable. Please try again in a moment." instead of the
actual reason.
**Expected behavior**
Paperclip should preserve its server-authored error message for
allowlisted upstream HTTP 502 responses, derive `retryable` accurately
(non-retryable for permanent upstream rejections, retryable for upstream
outages/5xx/rate-limits/timeouts), and avoid triggering the app-wide
outage banner. In the MCP connection flow, Paperclip should explain why
the remote server rejected automatic sign-in setup, expand the Browser
sign-in section with Paperclip's copyable callback URL above Client ID
and Client secret, and resume the saved draft connection instead of
creating duplicate numbered connections when the user retries.
**Steps to reproduce**
1. Open Apps and connect a custom MCP server URL whose OAuth
authorization server rejects Dynamic Client Registration (such as HTTP
400 `invalid_redirect_uri` or another upstream registration/metadata
error).
2. Start browser sign-in.
3. Observe that Paperclip previously showed "Paperclip is temporarily
unavailable. Please try again in a moment." instead of explaining the
callback URL or registration rejection.
**Paperclip version or commit**
Reproduced on `master` at commit `2d764bebc6` (and prior `bc98abda0c`).
**Deployment mode**
Other (applies to both Paperclip Cloud and self-hosted deployments).
## What Changed
- **Shared contracts (`packages/shared`)**:
- Added `packages/shared/src/upstream-failure-codes.ts` (re-exported
from `packages/shared/src/index.ts`) defining the single canonical
allowlist of upstream HTTP 502 error codes
(`UPSTREAM_MCP_OAUTH_FAILURE_CODES`,
`UPSTREAM_REMOTE_HTTP_FAILURE_CODES`,
`UPSTREAM_BAD_GATEWAY_FAILURE_CODES`,
`isUpstreamBadGatewayFailureCode`), transient HTTP status helper
(`TRANSIENT_UPSTREAM_HTTP_STATUSES`, `isTransientUpstreamHttpStatus`),
and shared retryability policy (`isRetryableUpstreamFailure`). Transient
HTTP statuses (408, 425, 429, and 5xx) are checked before the permanent
`oauth_dynamic_client_registration_failed` fallback so rate-limited or
timed-out registration attempts remain retryable. Any unlisted
structured 502 still falls back to the transient outage path.
- Updated `connectToolAppSchema` in
`packages/shared/src/validators/tool-access.ts` so `resumeConnectionId`
works for generic `link` connections as well as gallery apps (still
requiring `galleryKey || link`), enabling the recovery path to resume a
saved generic MCP draft instead of creating a duplicate connection.
- **Server (`server/`)**:
- Updated `server/src/services/mcp-connection-failure.ts` so
`mcpDiscoveryHttpFailure` emits `{ code: "mcp_remote_http_error", status
}` in `HttpError` details.
- Updated `server/src/services/tool-access/catalog/failures.ts` so
`sanitizeHttpFailure` imports `UPSTREAM_MCP_OAUTH_FAILURE_CODES` from
`@paperclipai/shared` and preserves upstream MCP/OAuth failure codes
with HTTP 502 instead of collapsing them to `"paperclip_error"`.
- Updated `server/src/routes/tool-access.ts` so when `svc.startOAuth`
throws a non-manual-client `HttpError` after creating a `draft`
connection, `error.details` includes `connectionId:
result.connectionId`.
- Updated `server/src/services/tool-access.ts` (`connectGalleryApp`) so
resuming a draft via `resumeConnectionId` with a generic `link` enforces
that the draft is not a curated gallery app and that its stored MCP
endpoint matches the requested `link`.
- **UI (`ui/`)**:
- Updated `ui/src/api/errors.ts` so `isStructuredUpstreamBadGateway` and
`isRetryableUpstreamBadGateway` delegate to
`isUpstreamBadGatewayFailureCode` and `isRetryableUpstreamFailure` from
`@paperclipai/shared` (keeping unlisted structured 502s,
`ApiUnavailableError`, and `TRANSIENT_CODES` on the outage banner path,
and returning `retryable: false` for permanent upstream rejections vs
`retryable: true` for upstream 5xx, rate limits, timeouts, or temporary
outages).
- Updated `ui/src/pages/apps/generic-mcp-connect.ts` with
`"oauth_client"` focus, plain-English guidance for DCR (including
temporary rate-limit/timeout/5xx guidance with `focus: "none"` vs
permanent rejection guidance with `focus: "oauth_client"`), metadata,
redirect, token, and remote HTTP failures, plus pure
`genericGuidanceFormPatch` and `resolveGenericDraftResumeId` helpers.
- Updated `ui/src/features/connections/oauthFailureMessages.ts` to cover
`oauth_dynamic_client_registration_failed` (including transient HTTP
429/408/425/5xx responses), `oauth_dcr_response_invalid`, and
`oauth_metadata_failed`, extract `connectionId` in
`readOAuthApiErrorDetails`, and add `oauthStartFailureMessage`.
- Added `ui/src/features/connections/useGenericDraftResume.ts`
(`useGenericDraftResume` + `grantKindFromConnection`) and updated
`ui/src/features/connections/GenericMcpConnectStep.tsx`,
`ui/src/features/connections/ConnectionSetupFlow.tsx`, and
`ui/src/pages/tools/PasteConfigTab.tsx` to deduplicate guidance form
transitions via `applyGenericConnectGuidance`, preserve and resume the
failed generic draft connection ID across retries without creating
duplicates while starting a fresh draft if the URL, company, credential
ownership (`grantKind`), or dedicated agent changes, clear stale drafts
on `404` / `connection_setup_not_incomplete`, display Paperclip's
copyable callback URL (using `useCopyAction`) above Client ID and Client
secret when Browser sign-in expands, and remove the unused `ApiError`
import. No source file crossed the 1,000-line threshold
(`ConnectionSetupFlow.tsx` and `tool-access.ts` were already above 1,000
lines).
- **Tests**:
- Synchronized `tests/runner-e2e/source-sdk-public-inputs.json` for the
`@paperclipai/shared` public source graph.
- Added/updated regression tests in
`packages/shared/src/upstream-failure-codes.test.ts`,
`packages/shared/src/validators/tool-access.test.ts`,
`ui/src/api/errors.test.ts`,
`ui/src/pages/apps/generic-mcp-connect.test.ts`,
`ui/src/features/connections/oauthFailureMessages.test.ts`,
`ui/src/features/connections/GenericMcpConnectStep.machine.test.tsx`,
`ui/src/features/connections/ConnectionSetupFlow.generic-mcp.test.tsx`,
`server/src/services/tool-access/catalog/failures.test.ts`,
`server/src/services/__tests__/mcp-connection-failure.test.ts`, and
`server/src/__tests__/generic-mcp-connection.test.ts`.
## Verification
Ran on latest commit `9d088abf91`:
- `pnpm --filter @paperclipai/shared build && pnpm --filter
@paperclipai/shared typecheck && pnpm --filter @paperclipai/shared exec
vitest run src/upstream-failure-codes.test.ts
src/validators/tool-access.test.ts` — passed (2 files, 20 tests).
- `pnpm --filter @paperclipai/ui typecheck` — passed (0 errors).
- `pnpm --filter @paperclipai/ui exec vitest run src/api/errors.test.ts
src/pages/apps/generic-mcp-connect.test.ts
src/features/connections/oauthFailureMessages.test.ts
src/features/connections/ConnectionSetupFlow.generic-mcp.test.tsx
src/features/connections/ConnectionSetupFlow.oauth.test.ts` — passed (5
files, 140 tests).
- `node tests/runner-e2e/source-sdk-public-inputs.mjs $(git rev-parse
HEAD) --check` — passed (`changed: false`, 582 inputs).
- `pnpm exec vitest run --config tests/runner-e2e/vitest.config.ts
tests/runner-e2e/source-sdk-public-inputs.test.mjs` — passed (13 tests).
Full GitHub CI & review gates on final head `9d088abf91` ([`ci` run
46468259760](https://github.com/paperclipai/paperclip/actions/runs/46468259760)):
- `ci / verify`, `ci / e2e` (all 16 shards), `ci / Typecheck + Release
Registry`, `ci / policy`, `ci / General tests` (20/20), `ci / Runner
support suite` (4/4), `ci / Verify Paperclip` (9/9), `ci / Verify
serialized server suites` (9/9), `ci / Sandbox profile`, `Superagent
Security Scan`, `Socket Security`, `Contributor trust`, `security/snyk`,
`commitperclip PR Review`, and `Greptile Review` (5/5, 0 unresolved
threads) all passed on `9d088abf91`.
Visual states covered via component and flow tests using existing design
tokens (`border-input`, `bg-muted/40`, `text-foreground`,
`text-muted-foreground`): initial generic MCP connect step, expanded
Browser sign-in with copyable Paperclip callback URL (`Copy` / `Copied`
/ `Copy failed`), inline guidance banner for DCR/metadata/credential
errors (including transient rate-limit/timeout/5xx copy), draft resume
on manual client retry, fresh draft creation on access ownership change,
and draft clearing on `404` / `connection_setup_not_incomplete`.
## Risks
- Low risk. Uncoded HTTP 502 responses, unlisted structured 502 codes,
proxy HTML `ApiUnavailableError` responses, and `tenant_app_unavailable`
/ `tenant_app_starting` responses still classify as `"transient"` and
still trigger the app-wide outage banner.
- Security: Untrusted upstream OAuth `error_description`, `error_uri`,
and response bodies remain blocked; only Paperclip-authored messages and
allowlisted RFC error codes drive UI copy. Generic draft resume enforces
route-level configure authorization
(`assertToolConnectionConfigureAccess`), rejects curated gallery drafts,
and requires a matching normalized server endpoint.
> 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
- Google DeepMind Antigravity (Gemini-based coding agent via ACPX
runtime) 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
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
canary/v2026.1130.0-canary.872300
|
||
|
|
3621d7204d |
fix(native-runtime): retire finished plugin owners after destroyed leases (#23292)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Paperclip Runner agents can run per-turn tasks on plugin environments that destroy each ephemeral lease after a turn completes. > - When a plugin environment destroys a finished per-turn lease, `createPluginEnvironmentDriver().destroyRunLease` releases the lease row with `status: "failed"`, `cleanupStatus: "success"`, a non-null `releasedAt`, and a bound `remoteExecutionTermination` stop receipt. > - On the next turn, `remoteExecutionHasStopped` accepts that lease as stopped, but `priorRemoteSandboxLeasesEnded` only accepts `released` or `expired`, so every follow-up fails with `runner_state_identity_mismatch: prior_owner_terminal_state_indeterminate; retirement_refused=prior_lease_active` until automatic recovery retries with `forceFreshSession`. > - Even after retirement succeeds on a `per_turn` run, `replaceAfterConfirmedProviderStateLoss` only inspected `persistedWarmSession` (undefined for `per_turn` runs) instead of checking the control-plane session checkpoint. > - This pull request accepts cleanly destroyed `failed` leases (`cleanupStatus === "success"`, `releasedAt !== null`, different `providerLeaseId`) in `priorRemoteSandboxLeasesEnded` and falls back to `controlPlane.loadSessionCheckpoint()` when computing `replaceAfterConfirmedProviderStateLoss` after `pluginCheckpointRetired`. > - The benefit is that per-turn plugin Runner follow-ups retire settled destroyed leases and continue on the first attempt instead of failing once and forcing a fresh-session retry on every turn. ## Linked Issues or Issue Description Refs #22973, #23007. **What happened?** On a plugin environment running `per_turn` Paperclip Runner tasks (`leasePolicy: "ephemeral"`), every completed turn tears down its lease through `createPluginEnvironmentDriver().destroyRunLease`, which stores `status: "failed"`, `cleanupStatus: "success"`, `failureReason: "paperclip_runner_destroy_after_turn"`, a non-null `releasedAt`, and a bound `remoteExecutionTermination` stop receipt. When the next follow-up turn ran for the same task session, `recoverPluginRunnerCheckpoint` confirmed that the prior task stopped with no retained checkpoint, `remoteExecutionHasStopped` returned `true` (because `hasRemoteTerminationReceipt` accepts `["released", "expired", "failed"]` with `cleanupStatus === "success"`), and `inspectFinishedPerTurnRunnerdOwner` then called `priorRemoteSandboxLeasesEnded`. Because `priorRemoteSandboxLeasesEnded` only accepted `status === "released" || status === "expired"`, every follow-up failed immediately with: `runner_state_identity_mismatch: prior_owner_terminal_state_indeterminate; retirement_refused=prior_lease_active` Recovery then retried ~20-30s later with `forceFreshSession`, which succeeded on a new session ID and repeated the same failure on the next turn. In addition, once a `per_turn` run retires a confirmed-unavailable plugin checkpoint (`pluginCheckpointRetired = true`), `replaceAfterConfirmedProviderStateLoss` only checked `persistedWarmSession`, which is `undefined` for `per_turn` runs (whose persisted checkpoint lives in `controlPlane.loadSessionCheckpoint()`). **Expected behavior** A finished prior run whose remote lease was destroyed with `status: "failed"`, `cleanupStatus: "success"`, `releasedAt !== null`, and a different `providerLeaseId` retires cleanly into `continuity-breaks` on the first follow-up attempt, and `per_turn` runs compute `replaceAfterConfirmedProviderStateLoss` from the control-plane session checkpoint when `persistedWarmSession` is absent (while still preserving same-session recovery for unfinished goals and pending-release Antigravity gates). **Steps to reproduce** Run `pnpm --filter @paperclipai/server exec vitest run src/services/native-runtime/native-session-executor.test.ts -t "retires a finished per-turn plugin owner after a destroyed lease"` against `2d764bebc6`. **Paperclip version or commit** Reproduced on `origin/master` at `2d764bebc6` (and observed on deployed `bc98abda0c`). **Deployment mode** Self-hosted / Cloud server with plugin Runner task environment. ## What Changed - `server/src/services/native-runtime/native-session-executor.ts`: - Updated `priorRemoteSandboxLeasesEnded` to select `cleanupStatus` and treat a prior lease as ended when `(status === "released" || status === "expired" || (status === "failed" && cleanupStatus === "success")) && cleanupStatus !== "failed" && releasedAt !== null && providerLeaseId !== currentProviderLeaseId`. - Updated `executePaperclipNativeSessionAttempt` to fall back to `await controlPlane.loadSessionCheckpoint()` when `pluginCheckpointRetired && !existingWarmSession` and `persistedWarmSession` is absent, passing the resulting checkpoint to `providerSessionReplaceableAfterStateLoss`. - File-length note: `native-session-executor.ts` is an existing >1,000-line module; this PR makes a surgical +12 net-line fix inside the two existing functions rather than introducing a new file. - `server/src/services/native-runtime/native-session-executor.test.ts`: - Added 5 parameterized red/green regressions (`retires a finished per-turn plugin owner after a destroyed lease only when cleanup succeeded`) covering destroyed per-turn plugin leases, active-goal preservation (`replaceAfterConfirmedProviderStateLoss: false`), failed cleanup refusal, unverified (`null`) cleanup refusal, and same-provider-task refusal (`retirement_refused=prior_lease_active`). ## Verification - **Red (before production fix)**: - `pnpm --filter @paperclipai/server exec vitest run src/services/native-runtime/native-session-executor.test.ts -t "retires a finished per-turn plugin owner after a destroyed lease"` - Result: `2 failed | 3 passed` — both `destroyed-after-turn` and `destroyed-after-turn-active-goal` failed with `Error: runner_state_identity_mismatch: prior_owner_terminal_state_indeterminate; retirement_refused=prior_lease_active`. - **Red for second-order fix (after Part 1 only)**: - Same command failed `1 failed | 4 passed` — `destroyed-after-turn` retired cleanly into `continuity-breaks` and then failed expecting `replaceAfterConfirmedProviderStateLoss: true` (received `false`). - **Green (after both fixes)**: - `pnpm --filter @paperclipai/server exec vitest run src/services/native-runtime/native-session-executor.test.ts -t "retires a finished per-turn plugin owner after a destroyed lease|handles unconfirmed plugin checkpoint status on replacement lease"` → `9 passed`. - `pnpm --filter @paperclipai/server typecheck` → passed (`below`, `cycle`, `above`, `tests`, `test-tree-0..2`). - `pnpm --filter @paperclipai/server exec vitest run src/services/native-runtime/native-session-executor.test.ts` → `1565 passed | 7 skipped (1572)`. ## Risks - Low risk. No database schema or migration changes. - Fail-closed guarantees are preserved: a `failed` lease with `cleanupStatus: "failed"` or `cleanupStatus: null`, an unreleased lease (`releasedAt === null`), a `released`/`expired` lease with `cleanupStatus === "failed"`, or a lease matching `currentProviderLeaseId` all still return `false` from `priorRemoteSandboxLeasesEnded` and refuse retirement. - Existing already-persisted `status: "failed", cleanupStatus: "success"` lease rows from previous releases retire cleanly immediately upon deploy (upgrade-safe). - Unfinished goals still keep `replaceAfterConfirmedProviderStateLoss: false`. ## Model Used - Google Gemini (Antigravity agentic assistant) with tool use (file read/edit, shell execution, browser inspection). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1130.0-canary.872200 |
||
|
|
cf0ba4d9ee |
fix(native): continue a resume the environment refuses in a fresh session (#22512)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Native agent runs can execute in an environment that a plugin driver provides. A run that continues a saved provider session submits the task with `resumeFrom` > - The driver can refuse that submit with `admission_rejected` (#20762 added this result). The reason is `account_binding_mismatch` when the agent's account changed after the saved session started. It is `session_state_unavailable` when the saved session state is not available > - Core records the refusal as `runner_task_admission_rejected`, fails the run, blocks the task and stops automatic retries. A person must click Retry, which only starts a fresh session > - The local adapters already continue in a fresh session when a resume cannot be honoured (for example "Codex resume session ... is unavailable; retrying with a fresh session") > - This pull request makes Core continue the task once, in a fresh provider session in the same workspace, when the driver refuses to resume a saved session for either reason. It uses the existing fresh-session retry machinery > - The benefit is that a resume the driver cannot honour no longer stops the agent's work and asks a person for a Retry that adds nothing ## Linked Issues or Issue Description Refs #20762 **What existing behavior does this improve?** The handling of an `admission_rejected` refusal on a native run that resumed a saved provider session, with the reason `account_binding_mismatch` or `session_state_unavailable`. **Current behavior** The run fails with `runner_task_admission_rejected`. The task becomes `blocked` with a board-owned hold that says "Automatic retries are stopped". Nothing continues the task until a person clicks Retry. **Proposed behavior** An environment driver can refuse to resume a session because its account binding changed or because its saved session state is unavailable. In either case, Core schedules one continuation in a fresh provider session in the same workspace. The continuation carries the usual fresh-session handoff context and tells the agent which reason applied. The task stays in its status and shows a scheduled retry. If the fresh session is refused too, the run stops as today. **Reason and benefit** A fresh session cannot meet the same refusal, because it supplies no `resumeFrom`. So an automatic continuation is safe and bounded, and the person has nothing to decide. The first version of this pull request covered only `account_binding_mismatch`. The reviewer decided that `session_state_unavailable` must continue too, to match the local adapters' "resume unavailable, retry fresh" behavior. ## What Changed - `native-resume-refused-continuation.ts` (new): the lane's reason code, limit (one continuation) and 5 s delay. It also has the continuation message and the fresh session's instruction. Both name the refusal reason. - `native-provider-capacity-retry.ts`: a new `materializeNativeResumeRefusedContinuation` lane on `materializeNativeFreshSessionRetry` (`forceFreshSession`, `freshSessionRetryContext`, liveness continuation context). It continues only when all of these are true: - the run's environment lease records the refusal with the reason `account_binding_mismatch` or `session_state_unavailable` - the same lease records a non-empty `runnerTaskResumeFrom`, so the run resumed a saved session - the run has no Stop request - the run is not itself this lane's continuation The shared materializer now counts attempts with `executionRetryAttemptCount(run, reason)`. For the four existing lanes this is the same value as before (`failureRetries`). - `execution-recovery-attempt.ts`: the new reason is an uncharged lane with its own counter, like `interrupted_preparation`. The refused run did no provider work. - `native-session-executor.ts`: in the terminal-failure transaction (issue, coordinator and run are locked), a `runner_task_admission_rejected` failure on a task the agent still owns tries the lane. When it schedules a continuation, the task is not blocked and no board hold is written. The coordinator's `failureDetail` gets `successorRunId` and the continuation message. Other recovery paths already step aside for `successorRunId`. - `run-dispatch/adapters/postgres.ts` and `heartbeat.ts`: the new reason joins the other native fresh-session lanes for retry classification and continuation-ownership checks. - `doc/plugins/PLUGIN_RUNNER_EXECUTION.md`: describes how Core handles `admission_rejected`. - A refusal of a run that did not resume keeps today's behavior. ## Verification - `npx vitest run src/services/native-runtime/native-resume-refused-continuation.integration.test.ts` (in `server/`): 8 tests pass. They cover: - for each reason, a resumed session gets one fresh continuation. The task is not blocked, no hold is written, the task shows `retry_scheduled`, and the scheduler promotes the continuation - the instruction names the reason - for each reason, a fresh-session refusal stays permanent - for each reason, the continuation's own refusal stays permanent - a stopped run gets no continuation - Red-green check: with only the executor change reverted, both continuation tests fail and the other six pass. - Neighbouring suites pass: `execution-recovery-attempt.test.ts`, `native-tool-receipt-limit.integration.test.ts`, `native-provider-capacity.integration.test.ts`, `native-agent-blocker.integration.test.ts`, `native-closed-session-retry.integration.test.ts`, `plugin-runner-task.test.ts`, `native-sandbox-disk-full.test.ts`, `heartbeat-retry-scheduling.test.ts`, `run-dispatch/adapters/postgres.test.ts`, `native-session-executor.test.ts`. - Server typecheck (`node scripts/typecheck-layers.mjs`) passes. - Not run locally: the full suite and the Runner release and eviction integration suites. CI runs them. ## Risks - Behavior change: two refusals that blocked the task now continue it automatically. The continuation is limited to one per refused resume, and a person's Stop prevents it. - A `session_state_unavailable` continuation starts a new provider conversation. The earlier conversation is not carried over, but the fresh-session handoff context and the workspace are. - The failed run still shows its `runner_task_admission_rejected` error. The coordinator's next action and the scheduled retry explain the continuation. - The lane is uncharged, so it does not use the chain's failure-retry budget. A later resume that is refused again can continue again, once. - No database migration. > 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 and code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Paperclip <noreply@paperclip.ing> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
63fffa8fcb |
test(server): drop heartbeat run-log cases duplicated by the module suite (#23191)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The heartbeat run-log pipeline redacts secrets and images from chunks with `compactRunLogChunk`, then truncates oversized chunks. > - Two suites cover this function: `server/src/__tests__/heartbeat-run-log.test.ts` and the module suite `server/src/services/heartbeat/run-log.test.ts`. Both run in the default general-server lane. > - Two of the four cases in the `__tests__` file repeat contracts the module suite already proves with stronger, exact assertions (image-data redaction with the exact 1024-character threshold and consistency; truncation with exact head/tail/omission output and a redaction-before-truncation ordering check). > - This pull request deletes the two duplicated cases and keeps the two cases with unique coverage (Paperclip credential-shape redaction and the long-base64 performance guard). > - The benefit is less duplicated test code and two fewer executions of the same production path with no loss of failure detection. ## Linked Issues or Issue Description No public issue exists. Problem description: duplicated test coverage for `compactRunLogChunk`. The `__tests__/heartbeat-run-log.test.ts` suite was checking image-data redaction and chunk truncation through `compactRunLogChunk`, while `services/heartbeat/run-log.test.ts` proves the same contracts with exact boundary assertions. ## What Changed - Deleted "redacts inline base64 image data from structured log chunks" from `server/src/__tests__/heartbeat-run-log.test.ts`. Retained coverage: `services/heartbeat/run-log.test.ts` "preserves the image omission threshold at %i characters" (exact 1023/1024 boundary) and "omits every large image consistently across repeated calls". - Deleted "truncates oversized chunks after sanitizing them" from the same file. Retained coverage: "keeps the existing head, tail, and omission count for a custom limit" (exact truncation output) and "redacts credentials and image data before deciding whether a chunk needs truncation" (ordering proof). - Kept "redacts Paperclip credential shapes before persisting run-log chunks" (unique PAPERCLIP_API_KEY env/JSON/flag and refresh-token shapes) and "redacts a tool call that writes base64 of source text without stalling" (performance guard) unchanged. ## Verification - `npx vitest run src/__tests__/heartbeat-run-log.test.ts src/services/heartbeat/run-log.test.ts` (in `server/`): 2 files, 26 tests passed. - `npx tsc --noEmit -p .` (server package): clean. - Both files are selected in the default general-server lane per `scripts/general-server-shard-durations.json`. - Full CI (typecheck, all lanes, Greptile) runs on this PR; local runs of the full suite were not performed. ## Risks Low risk. Deletion-only change to one test file; production code is untouched. If a future regression removes image redaction or truncation, the retained services-level cases fail at their assertions. ## Model Used GLM (Z.ai) — openrouter/z-ai/glm-5.3, used via the Paperclip runner for test-suite analysis and this change. ## 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 Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com> |
||
|
|
1847abcd91 |
refactor(test): remove test support orphaned by the nightly soak prune (#23142)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The server test tree under `server/src/__tests__/` keeps suites, fixtures, and helper modules that support them. > - The nightly soak prune in #22831 removed 483 soak suites, but eleven of their support files stayed behind. > - These files have no importer left. No test selects them. They never run, but every contributor still reads, compiles, and typechecks them. > - This pull request deletes the eleven orphaned support files. Each one is proven unreferenced. > - The benefit is 531 fewer lines of dead test support, and a test tree that holds only live code. ## Linked Issues or Issue Description No public issue exists for this cleanup. The problem is described here. **What existing behavior does this improve?** Test suite maintainability and typecheck scope of `server/src/__tests__/` after the nightly soak prune (#22831). **Subsystem affected** server/ — REST API & orchestration services **Current behavior** Eleven test-support files under `server/src/__tests__/helpers/` and `server/src/__tests__/fixtures/` have zero importers since the prune in #22831 removed every suite that used them. They match no vitest include pattern, so they never execute. **Proposed behavior** Delete the eleven dead files. Keep every live fixture and helper. Add no new code. ## What Changed - Deleted five orphaned helpers: `file-delivery-daytona.ts`, `native-question-owner.mjs`, `observer-replay-report.ts`, `recovery-population.ts`, and `maintenance/idle-work-capture-probe.ts`. - Deleted six orphaned fixtures: `daytona-worker-lifecycle-sdk.mjs`, `online-workspace-e2d-protocol.mjs`, its `online-workspace-e2d-protocol.provenance.json` build receipt, `sandbox-creation-receiver.ts`, `plugin-worker-deadline.cjs`, and `plugin-worker-idle.cjs`. - Deleted 531 test/support LOC. No production code, no test entry points, and no assertions were removed. ## Verification - Repo-wide reference scan: each of the eleven file stems was searched across every source, manifest, workflow, tsconfig, and doc file in the repository. Zero references exist. The scan also covers spawn patterns, because plugin-worker and other fixtures are referenced by exact file name everywhere they are used. - Selection check: `server/vitest.config.ts` selects only `src/**/*.test.ts` and `scripts/**/*.test.mjs`. None of the eleven files matches, so no run loses a suite. - `pnpm verify` reported the eleven deleted paths and asked for the required CI lanes (`typecheck_release_registry`, `general_tests`, `verify_paperclip_runner`, `build`, `verify_serialized_server`, `e2e_shards`), as designed for source deletions. Required CI will cover them. - Focused local run: `pnpm --filter @paperclipai/server exec vitest run src/services/issue-continuation-summary.test.ts` — 2/2 tests passed. - Kept siblings verified live: `idle-work-capture.ts`, `blocker-stall-fixture.ts` (benchmark consumer), and `tool-profile-matching-fixture.ts` (documented benchmark) are referenced and were not touched. ## Risks - Low risk. Each deleted file had no importer, so no behavior or coverage can change. If a future suite needs one of these helpers, it is in git history. ## Model Used - GLM (model id `openrouter/z-ai/glm-5.3`), driving a Paperclip test-gardening agent: tool use, shell execution, repository-wide reference scans, and local vitest runs. Assisted by no other model. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes: #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com> Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
79b61962c9 |
refactor(runner-e2e): remove the unreferenced Kimi context v1 calibration fixture (#23094)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The runner E2E suite stores provider calibration data as JSON fixtures under `tests/runner-e2e/fixtures/`. > - PR #18029 added two Kimi context calibration fixtures: `kimi-context-command-v1.json` and `kimi-context-command-v2.json`. From the first day, only the v2 file was loaded; the rendezvous test reads v2 by exact name. > - The v1 file kept its place in the repository, but no code, script, workflow, or document ever read it. A repository-wide search and a full-history search for its name found no reader. > - An unread fixture adds maintenance work and gives no coverage. > - This pull request removes that one unreferenced fixture. The v2 fixture stays and keeps the calibration coverage. ## Linked Issues or Issue Description No public issue tracks this cleanup. The problem is described here: **What existing behavior does this improve?** The runner E2E fixture inventory. The suite keeps calibration data that tests actually read. **Subsystem affected** `tests/runner-e2e` — Runner E2E qualification suite. **Current behavior** `tests/runner-e2e/fixtures/kimi-context-command-v1.json` (284 lines, 14.9 KB) sits in the fixtures directory with no reader. **Proposed behavior** The file is removed. Every remaining fixture in the directory is still read by a test or harness. **Reason and benefit** Less dead test data. No test output changes. ## What Changed - Deleted `tests/runner-e2e/fixtures/kimi-context-command-v1.json` (284 lines of test-support data). Production code: no change. Test code: no change. ## Verification - Reference scan: a search of every tracked text file for the name `kimi-context-command-v1` matched only the fixture path itself. The name occurs in no source file. - History scan: `git log --all -S kimi-context-command-v1.json` reports no commit that ever referenced the name in file content. The file was added with a reader for v2 only. - The only loader of the Kimi calibration fixtures is `tests/runner-e2e/kimi-context-rendezvous.test.ts:13`, which reads `kimi-context-command-v2.json` by exact name. - No test or harness enumerates the fixtures directory, so file removal cannot change a directory scan. - No test command selects this file. The deletion cannot change any test result. - Not run locally: the Vitest suites. This session had no installed dependencies, and the change only removes a data file that no test loads. The required CI checks run on this branch head. ## Risks Low risk. The file was never loaded. The v2 fixture keeps the calibration data. The deleted file stays in git history. ## Model Used GLM 5.3 (Z.ai), model ID `z-ai/glm-5.3`, served through the opencode CLI under the Paperclip Runner test-gardening routine. Tool use and shell execution were enabled. Reasoning mode: standard chain-of-thought. Context window size: not disclosed by the provider. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes: #` / `Refs: #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [ ] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] 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 Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com> |
||
|
|
ff51c42568 |
refactor(plugin-llm-wiki): remove unreferenced fixtures/basic-root tree (#23027)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The LLM Wiki plugin gives Paperclip a local-file wiki. It reads sources, writes pages, and answers queries. > - The plugin package contains a sample wiki tree under `fixtures/basic-root/`. > - No test, script, workflow, or package export reads this tree. The tests read the live `templates/` tree through `src/templates.ts`. > - Two fixture files, `AGENTS.md` and `IDEA.md`, are byte-identical copies of `templates/AGENTS.md` and `templates/IDEA.md`. > - This pull request removes the unused `fixtures/basic-root/` tree. > - The benefit is a smaller test-support surface. No stale copy of the wiki schema remains. ## Linked Issues or Issue Description No public GitHub issue exists for this cleanup. The in-PR description follows the enhancement template. **What existing behavior does this improve?** Test support for the LLM Wiki plugin package. The package carries a sample fixture tree that no code selects or reads. **Subsystem affected** `packages/plugins/plugin-llm-wiki` — test support files only. **Current behavior** The package contains 14 fixture files under `fixtures/basic-root/` (258 lines). The files describe a sample wiki: a schema (`AGENTS.md`), a pattern note (`IDEA.md`), raw sources, and generated pages. Nothing loads them: - The plugin vitest config selects `tests/**/*.spec.ts` only. No workflow, script, or runner executes a file under `fixtures/`. - The package `files` list (`agents`, `dist`, `migrations`, `skills`, `templates`, `README.md`) excludes `fixtures`. The published artifact does not contain it. - The fixture was added with the initial plugin import (May 2026) and was not touched again. - `fixtures/basic-root/AGENTS.md` and `IDEA.md` duplicate `templates/AGENTS.md` and `templates/IDEA.md` byte for byte. `src/templates.ts` reads the `templates/` copies. **Proposed behavior** Delete `packages/plugins/plugin-llm-wiki/fixtures/basic-root/` and the now-empty `fixtures/` directory. No test, production file, lockfile, or workflow changes. **Reason and benefit** The tree is dead test-support weight. A stale, byte-identical copy of the wiki schema can mislead a future maintainer into editing the wrong tree. Removal keeps 258 test-support lines out of the package and does not change any executed or published path. **Breaking changes** None. The deleted files are outside the package `files` list, so npm-published artifacts are unchanged. No test or production code references them. **Additional context** Nightly test-gardening audit of unaudited plugin-package test support. ## What Changed - Removed `packages/plugins/plugin-llm-wiki/fixtures/basic-root/**` — 14 files, 258 test-support lines. Zero production lines, zero registered test cases (no case referenced these files), zero lockfile or workflow changes. ## Verification Reference and selection proof: - Searched all tracked file types for `basic-root`, `basic_root`, `basicRoot`, and each fixture filename. Only the fixture files themselves match. No code, workflow, script, skill, agent prompt, or documentation path references them. - GitHub history: one commit touches this path — the initial plugin import. No later commit reads or changes it. - No open or merged pull request touches `packages/plugins/plugin-llm-wiki/fixtures/**`. - Selection: `vitest.config.ts` includes `tests/**/*.spec.ts` only. No CI lane or npm script executes files under `fixtures/`. Local runs, `packages/plugins/plugin-llm-wiki`, before and after the deletion: - `pnpm exec vitest run --config ./vitest.config.ts` — same result both runs: 4 tests passed; `tests/plugin.spec.ts` passed. `tests/wiki-route-sidebar-ui.spec.ts` and `tests/issue-attachments.spec.ts` fail identically before and after on `Failed to resolve import "react"`. The `react` peer dependency is not installed in this container. This is a pre-existing environment setup failure, unrelated to this deletion. - `pnpm run typecheck` — passes after the deletion (tsc reports no errors). - Repo-wide `pnpm -r typecheck`, `pnpm test:run`, and `pnpm build` were not run locally. The required CI lanes supply that coverage for this pull request head. ## Risks - Low risk. Deletion only. No runtime path reads the removed files, and the published package never contained them. ## Model Used - Zhipu GLM via OpenRouter, model id `z-ai/glm-5.3` (Paperclip Test Gardener agent). Context window size is not disclosed to the agent. No special reasoning mode. Tools: shell, file search, and the GitHub REST API. Every pull request section above was written by this model. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes: #` / `Refs: #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [ ] I have run tests locally and they pass — the runnable plugin suite passes; two spec files fail on a pre-existing missing `react` peer in this container, identically before and after the change - [x] I have added or updated tests where applicable — no test references the deleted fixtures, so no test change applies - [x] I have updated relevant documentation to reflect my changes — no documentation references the deleted files - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green — pending on this pull request head - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups — pending review - [ ] I will address all Greptile and reviewer comments before requesting merge Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com> |
||
|
|
8aba5a575e |
test: retire duplicated workspace-inheritance and environment-form cases (#22391)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The repository keeps its regression proof in Vitest suites. Two suites and one UI suite held duplicate test cases. > - The file `server/src/__tests__/issues-service.test.ts` has two describe blocks with the same name. Each block held one copy of a test about workspace inheritance from a source issue. The two copies differed only in the `projectId` input. > - The file `ui/src/pages/CompanyEnvironments.test.tsx` held byte-identical second copies of two tests about the SSH remote-auth option, inside the same describe. > - Duplicate registrations run the same production path twice. They add CI work and maintenance cost, and they give no new proof. > - This pull request removes the duplicate registrations. It keeps one registration for each contract, with the same assertions and fixtures. > - The benefit is less duplicated test code and fewer repeated case executions, with the same regression safety. ## Linked Issues or Issue Description No public GitHub issue covers this cleanup. The problem follows the enhancement template. **What existing behavior does this improve?** The behavior of the existing test suites. The suites `issueService.create workspace inheritance` (server) and `CompanyEnvironments — test provider button` (ui) still protect the same contracts, without duplicate registrations. **Subsystem affected** - `server/src/__tests__/issues-service.test.ts` — the workspace-inheritance cases of `issueService.create`. - `ui/src/pages/CompanyEnvironments.test.tsx` — the SSH environment form cases for the remote-auth option. **Current behavior** - Two describe blocks in `issues-service.test.ts` register a test with the same name. One copy passes `projectId` to `create()`; the other copy omits `projectId` and asserts that the follow-up inherits the project from the source issue. All other assertions are the same. - `CompanyEnvironments.test.tsx` registers two tests twice. The second copies are byte-identical to the retained copies. **Proposed behavior** - One `it.each([true, false])` registration covers the explicit and the implicit `projectId` input. The `projectId` inheritance assertion runs in both variants. - The byte-identical second copies in `CompanyEnvironments.test.tsx` are removed. The retained copies stay without changes. **Reason and benefit** The removal keeps every assertion and every fixture. The retained registrations execute the same production code and detect the same regressions. The change deletes 136 lines of test code and adds 55 lines. It removes 4 repeated case executions per run of the UI file (1 + 3 `it.each` rows) and removes 1 duplicated registration in the server file. Duplicate work was searched before this pull request was opened. No open or merged pull request touches these duplicate cases. ## What Changed - `server/src/__tests__/issues-service.test.ts`: the retained test now uses `it.each([true, false])` for the explicit and the implicit `projectId` input. The assertion `expect(followUp.projectId).toBe(projectId)` was moved from the deleted copy and now runs in both variants. The duplicate copy in the second describe block was deleted. No fixture changed. - `ui/src/pages/CompanyEnvironments.test.tsx`: the byte-identical second copies of `defaults new SSH environments to the agent's Paperclip account` and `preserves the remote-auth option when editing an existing SSH environment (saved=%s)` were deleted. The retained copies were not changed. ## Verification - Base revision: `201abacd6e` (master). Branch head: `9bbc77867a`. - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/issues-service.test.ts` — 155 tests passed (all suites of the owner file, real embedded Postgres, no name filter). - `pnpm --filter @paperclipai/ui exec vitest run src/pages/CompanyEnvironments.test.tsx` — 43 tests passed with this change; the same command at the base revision reported 47 tests. The 4 removed cases were byte-identical duplicates of retained cases. - Keeper control 1: with a temporary production change that copies the source issue's `executionWorkspaceId` to the follow-up, both `it.each` variants fail at `expect(followUp.executionWorkspaceId).toBeNull()`. The production change was restored after the check; the file matched the committed bytes. - Keeper control 2: with a temporary production change that skips the `projectId` inheritance from the source issue, only the `explicitProjectId=false` variant fails, at `expect(followUp.projectId).toBe(projectId)`. The production change was restored after the check. - `pnpm --filter @paperclipai/ui typecheck` passed. - The server package typecheck could not run on this host: the `cycle` layer of `scripts/typecheck-layers.mjs` needs more memory than this machine has, and `tsc` was stopped by the operating system (SIGKILL) on both attempts. This is a host limit, not a product failure. CI runs the same typecheck on this PR head. - CI runs the full test lanes on this PR head. The checks below are the required proof. ## Risks - Low risk. No production code changed. No test selection, routing, or CI configuration changed. - The server consolidation keeps the same number of scenario executions (two) through the same production path, so it reduces maintenance cost, not server CI wall-time. - The UI deletions remove 4 repeated case executions per run of the file. No measured CI wall-time claim is made from this change. ## Model Used - OpenRouter `z-ai/glm-5.3` (GLM), operated as the Paperclip "Test Gardener (GLM)" agent. Tool use: file search and edit, shell test runs, GitHub publication through the `gh` CLI. Context window size: not tracked by the operator. Reasoning mode: default. ## 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 --- ## Update (2026-11-24 rebase) Master's #22679 deleted `ui/src/pages/CompanyEnvironments.test.tsx`, which made this branch conflict. The branch was rebased onto master `28aa32e7`: the obsolete UI-file deduplication was dropped, and this PR now carries only the server-side deduplication in `server/src/__tests__/issues-service.test.ts` (single commit `4c115486`). Everything written above about the UI file describes work that no longer exists in this PR. Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com> |
||
|
|
aa76a16879 |
refactor(server): retire the native input boundary alias (#22299)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - `server/src/__tests__/native-runner-input-boundary.test.ts` is a two-line alias: a comment plus one import of `packages/paperclip-runner/src/contracts/native-execution.test.ts`. It contributes no assertion, setup, or configuration of its own. > - The alias was added in #12591 (2026-08-31), before the Runner package suites ran in required PR CI. A 2026-10-13 audit receipt retained it for exactly that reason: the package suite was omitted from the root default project list, so the alias was its only root-suite entry point. > - Since then, `verify_paperclip_runner` became a required PR job whose default matrix includes `test:typescript:vitest --package-lane=K/3` for K in 1..3 (plus a native-server lane), and those lanes partition the full package vitest inventory (`src/**/*.test.ts` in `packages/paperclip-runner/vitest.config.ts`) as a complete, non-overlapping cover. `src/contracts/native-execution.test.ts` therefore runs in exactly one required package lane on every full-CI PR. > - The same suite also executed a second time per PR inside the serialized server lane through this alias. That is now a pure duplicate execution, so this pull request deletes the alias. ## Linked Issues or Issue Description - **What existing behavior does this improve?** Test cost only. Production code does not change. - **Subsystem affected** `server` test selection; `packages/paperclip-runner` unchanged. ## What Changed - Deleted `server/src/__tests__/native-runner-input-boundary.test.ts` (2 lines: comment + import of the package-owned `native-execution.test.ts`). - No production changes. The retained owner `packages/paperclip-runner/src/contracts/native-execution.test.ts` is untouched and still selected by the required package lanes. - `scripts/general-server-shard-durations.json` still lists a 272 ms weight for the deleted path; the shard script reads durations with a `?? fallbackWeight` default, so a stale manifest key is inert and the measurement bot refreshes the manifest. Left unchanged to keep the diff minimal. ## Verification - Static evidence for safe removal: - Package lane coverage: `packages/paperclip-runner/vitest.config.ts` includes `src/**/*.test.ts`; `scripts/run-pr-vitest-lane.mjs` + `scripts/vitest-package-lanes.mjs` partition that inventory into complete non-overlapping lanes; `.github/workflows/pr-trusted.yml` runs `test:typescript:vitest --package-lane=1/3..3/3` and `--native-server` in the `verify_paperclip_runner` matrix, and the final validation job asserts each planned suite result for that job. - The alias adds no setup or separate assertion: its whole body is one import (2-line file). - Whole-repository reference search for `native-runner-input-boundary`: only `doc/plans/*` receipts, `packages/paperclip-runner/docs/design/standalone-thin-paperclip-adapter.md`, and the shard duration manifest mention it; no executable test-selection command, generator, or import references it. - Duplicate gate: no open pull request's diff touches `server/src/__tests__/native-runner-input-boundary.test.ts` or `packages/paperclip-runner/src/contracts/native-execution.test.ts` (checked via the pulls API for every open PR matching the names). PR #21980 (open, `codex/test-garden-duplicate-forward-reconciliation-row`) touches a different file (`workspace-runtime.test.ts`); not this routine's work. - Local runs: **not run** — this execution workspace ran out of disk during `pnpm install` (the `pnpm-lock.yaml` refresh bot lags the ACPX pin bump, so a frozen install fails at master HEAD and the `--no-frozen-lockfile` install filled the 10 GB disk). No local test or typecheck could run; the deletion is a test entry-point removal whose safety rests on the selection evidence above, not on a green local run. - Baseline comparison: master HEAD `440f96247b` had the same install blocker; nothing about this 2-line deletion can affect module resolution for the retained suites. ## Risks - Contributors running only the root `pnpm test` no longer execute the native-execution suite in that run; it still runs under `pnpm --filter @paperclipai/paperclip-runner test:typescript` (local) and in the required package CI lanes. This matches how every other `packages/paperclip-runner` suite is already routed. - CI savings are estimated, not measured: the shard manifest weights the alias at ~272 ms per server-lane run plus module transform cost, but no wall-time measurement of this PR's lane was taken. - Remaining audit candidates (retained, not deleted this run): `devtools/browser/src/live/transcript-model.test.ts` vs `src/browser/transcript-model.test.ts` (near-identical titles, but each exercises its own production module — possible production duplication, out of test-gardening scope); the three `execute.acp-fallback.test.ts` adapter copies (each mocks its own protocol); `runner-tool-results.live.test.ts` (opt-in live suite, skipped by default). ## Model Used GLM-5.3 (openrouter/z-ai/glm-5.3) driving the Paperclip Test Gardener agent. ## Checklist - [x] No production behavior changes - [x] No checks weakened; the retained owner suite is selected in required PR CI - [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] No documentation files added or modified |
||
|
|
5f1178b966 |
Fix first-agent skill setup racing an uncommitted installation (#23308)
## Thinking Path > - Paperclip manages AI agents and the skills they need for work. > - First-agent setup assigns the bundled operating and onboarding skills. > - An environment plugin can initialize those skills inside a transaction. > - Another request could share that transaction's refresh promise and read before its commit. > - The hire then rejected valid default skills as unknown references. > - This pull request scopes shared refresh work to each database handle and makes concurrent bundled creation idempotent. ## Linked Issues or Issue Description **What happened?** First-agent onboarding on a fresh hosted stack failed with `Invalid company skill selection (unknown references: ...)` after the user entered a Claude API key. The failure occurred during skill assignment, before a provider connection could be verified. The environment plugin initialized the bundled library inside its skill-install transaction. The hire request awaited the same company-wide refresh promise. That promise settled before the outer transaction committed. The hire's separate connection then read an empty library and returned HTTP 422. **Expected behavior** A hire resolves committed bundled skills even when another installer is active. A failed competing transaction must not leave the hire dependent on rolled-back work. Concurrent callers must retain one installed skill per key. **Steps to reproduce** 1. Create a company with no initialized skill library. 2. Start bundled inventory initialization inside a transaction and hold its commit. 3. Resolve first-agent skill selections through the ordinary database handle while initialization is active. 4. Let initialization finish, while the outer transaction is still open. 5. Observe the unknown-reference error from the separate connection. The added real-PostgreSQL regression controls these boundaries without real-clock sleeps. **Paperclip version or commit** Observed on `79dadd86551e4deb254163dd1f952f2908f1d351`. Reproduced locally on `79ef76757879`. **Deployment mode** Hosted Docker deployment. The underlying transaction race also applies to other deployments. Related: #22477 repaired a different first-agent skill upload failure. Searches of open and closed skill/onboarding and skill/transaction changes found no duplicate of this repair. ## What Changed - Store in-flight inventory refreshes by database handle and company. Service instances on the same handle still share work. Other connections and transactions refresh through their own visibility boundary. - Take the existing skill publication advisory lock before the bundled-create recheck. Reuse a concurrent installation once it is visible. Keep normal user-created skill conflict handling intact. - Recheck a shipped release under the skill-row lock before inserting its version. Reuse a matching release and reject a concurrent snapshot with different contents. - Keep the fix in the existing inventory and import owner. No schema, provider, UI, or public API changes are required. - Add commit and rollback regressions that hold the installer open until the competing caller attempts publication. Preseed the folder metadata and use inline packages for this specific creation race so unrelated folder and object-store locks do not settle the race first. - Add concurrent release-seeding cases for matching and corrupted snapshots. Existing tests cover shared refreshes, separate actor visibility, and revoked project access. ## Verification - The original commit/rollback regressions reproduced the unknown-reference HTTP 422 before the repair. - Review regression, red: both concurrent release-seeding cases reproduced PostgreSQL `23505` on `company_skill_versions_skill_release_idx` before the release recheck was added. - Creation-race test: removing the bundled-create recheck makes the tightened commit case fail with HTTP 409. The protected code passes. This proves the test reaches the concurrent-creation boundary. - Green: all six inventory-concurrency cases pass, including commit, rollback, matching release reuse, corrupt release refusal, same-handle coalescing, and separate actor visibility. - Final revision: `5ac8f4d7acc1a2fe5111935d892c5d57ef54b5a6`. All 277 tests passed across nine focused files: company skill service, runtime concurrency, runtime selection, environment skills, plugin-managed skills, managed content, agent skill routes, package upload, and bundled release validation. - `pnpm --filter @paperclipai/server typecheck` passed, including source and test layers, on the final source. - Test command: `pnpm exec vitest run server/src/__tests__/{company-skills-runtime-concurrency,company-skills-service,company-skills-runtime-selection,environment-skills,plugin-managed-skills,managed-skill-content,agent-skills-routes,skill-package-upload}.test.ts server/src/services/bundled-skill-release-validation.test.ts`. - `node scripts/check-test-budget.mjs --files server/src/__tests__/company-skills-runtime-concurrency.test.ts` and `git diff --check` passed. - Environment: local macOS arm64 with real embedded PostgreSQL. Tests use controlled gates rather than real-clock sleeps. - The previous head, `088b8f8822d5bc218f4e5e7cfcf61c510de0776d`, passed all 270 focused tests, server source/test typechecks, and [CI](https://github.com/paperclipai/paperclip/actions/runs/46488494810). The 4/5 review identified the release race and the test gap addressed here. The final revision has now passed fresh CI and review; the results are recorded below. - `pnpm verify --explain` selected 1,981 tests, with 1,978 retained conservatively. Focused local checks cover this repair; required CI supplies the broader typecheck, build, test, Runner, and browser coverage. - Staging diagnosis used the served Core SHA, bounded request logs, and read-only database queries. The logs and row timestamps match the reproduced transaction race. - Test code and service behavior document this internal invariant; no user-facing command or API contract changed. - A deployed onboarding retry with the fixed revision has not been run. This PR does not deploy the repair or validate the user's provider credential. - Current-head [Greptile review](https://github.com/paperclipai/paperclip/pull/23308#issuecomment-7288511940) is 5/5 on `5ac8f4d7acc1a2fe5111935d892c5d57ef54b5a6`. Both prior review threads are resolved. - Final [CI run, attempt 2](https://github.com/paperclipai/paperclip/actions/runs/46491251884/attempts/2) completed successfully on `5ac8f4d7acc1a2fe5111935d892c5d57ef54b5a6`. Scope: typecheck/release registry, build, native Runner checks, general tests, serialized server suites, and all 16 browser shards. GitHub reports the branch as clean and mergeable. - Attempt 1 lost the runners for [browser shard 5](https://github.com/paperclipai/paperclip/actions/runs/46491251884/job/142104554848) and [browser shard 12](https://github.com/paperclipai/paperclip/actions/runs/46491251884/job/142104554842). Those interrupted attempts are not passes. GitHub initially rejected targeted retries while the parent workflow was running. Both shards passed in attempt 2. ## Risks Different database handles now perform their own inventory refresh. The bundled-create lock prevents duplicate publication when these refreshes overlap. Same-handle coalescing and the existing access checks remain effective. The change does not relax unknown-skill validation or normal edit/create conflicts. No migration is needed. ## Model Used OpenAI GPT-6.1 Sol (`gpt-6.1-sol`) through the Codex harness, with xhigh reasoning effort and tool use. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1130.0-canary.871400 |
||
|
|
79ef767578 |
fix(ui): hide startup steps too short to name and hold labels long enough to read (#23299)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The task view names each startup stage of a run until the agent works, for example "Preparing workspace" or "Starting agent". > - Core and environment plugins report every startup step as it starts, however short, and the task view decides which labels to show. > - The view held each label for 500 ms and showed every change at once. A step of a few milliseconds that started after a longer step appeared at once and stayed up after it ended. Also, 500 ms is less than the time most labels take to read. > - This pull request adds a short show delay, so that steps too short to name never appear, and holds each shown label for its reading time. > - The benefit is a status line that changes only for steps that last, and stays up long enough to read. ## Linked Issues or Issue Description No public issue exists. Follows #22956, which added the startup stage labels. **Subsystem affected** Task chat UI: the startup stage line of a running turn (`ui/src/components/task-chat`). **Problem or motivation** A startup step that lasts a few milliseconds can show its label for 500 ms after the step ended. For example, a short "Connecting tools" step inside a long "Starting agent" step changes the line twice. Also, the 500 ms hold is shorter than the time needed to read most labels. **Proposed solution** Use the common loading-indicator pattern of a show delay plus a minimum display time. Base the minimum time on reading time: - A new stage's label shows only after the stage stays current for 300 ms. - A shown label stays up for 50 ms per character (20 characters a second, the usual adult subtitle reading speed), and at least five-sixths of a second (the usual subtitle minimum). **Alternatives considered** - Only a minimum display time (the current behavior). This prevents flicker, but short steps still show and stay up after they end. - Hide steps in the reporter. This would put a display rule in each reporter. Reporters report every step, and the view decides what to show. ## What Changed - `useHeldLabel` shows a new label only after it stays current for `STARTUP_LABEL_SHOW_DELAY_MS` (300 ms). Labels that come and go within that time never show. - A shown label stays up for `startupLabelHoldMs(label)`: the greater of 833 ms and 50 ms per character. Today's labels stay up for 0.83 s to 0.95 s. - The end of startup (no label) has no show delay. The last label is still held so that it can be read. Agent activity replaces the line as before. - The first label shows at once. A task opened during startup can show a stage that is already old, and `Thinking` in its place would be wrong. - `DESIGN.md` describes the show delay, the reading-time hold, and the first label. ## Verification - `npx vitest run src/components/task-chat/run-startup-stage.test.ts` in `ui`: 9 tests pass. They cover the first label, the hold per label, the show delay, a short step inside a longer one, a skip to the latest stage, a longer hold for a longer label, and the end of startup. - `npx vitest run src/components/TaskChatThread.test.tsx -t "startup stage"` in `ui`: the startup stage thread tests pass. - `pnpm --filter @paperclipai/ui typecheck` passes. - CI runs the full suite. ## Risks - Low risk. This changes display timing only. - Each new label shows 300 ms later than before. A shown label can stay up for up to about 0.65 s after its step ends, if the step is just longer than the show delay. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use (shell, file edits, web research). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>canary/v2026.1130.0-canary.871300 |
||
|
|
79dadd8655 |
fix(hermes): keep a non-numeric cost out of the run accounting (#17266)
## Thinking Path
> - Paperclip runs a Hermes agent through the `hermes_local` adapter
> - The adapter reads the run's cost out of the Hermes CLI output,
because Hermes prints it
> - The cost is read with a regex over the whole output, and the whole
output includes the model's own answer
> - The capture group of that regex matches text that is not a number,
so an answer that happens to contain a word like "spent." is read as a
cost
> - `parseFloat(".")` is NaN, and NaN does not survive the run
accounting: the server refuses to store it and marks the run failed
> - The agent did the work and left its answer on the issue, but the run
is red
> - A failed run is not settled either, so the session is not carried
into the next heartbeat, and the memory the run was meant to keep is
lost
> - The token parse next to the cost parse already guards exactly this
shape, and the cost parse does not
> - This pull request keeps the cost only when it is a finite number
## Linked Issues or Issue Description
There is no public GitHub issue for this defect. The description below
follows `.github/ISSUE_TEMPLATE/bug_report.yml`.
**Pre-submission checklist**
- [x] I have searched existing open and closed issues and this is not a
duplicate. The repository was searched for the cost regex, the `costUsd`
accounting and the `adapter_failed` error. The related items are listed
at the end of this section. None of them covers this case.
- [x] I am on the latest released version of Paperclip (or can reproduce
on `master`). The change is based on `master` at `043f2514e`. The new
test fails on that revision.
- [x] I have confirmed the error originates in Paperclip itself — not in
my agent adapter, API provider, or local configuration. The Hermes
adapter is part of this repository, not an external plugin. The defect
is in `packages/adapters/hermes/src/server/execute.ts`. The new test
fails on unmodified `master` and passes with the fix.
**What happened?**
A Hermes agent answered on its issue, and the answer was correct and
still on the issue. The run was recorded as failed anyway, with:
```
adapter_failed
Invalid input: expected number, received NaN
path: ["costUsd"]
```
The adapter reads the cost out of the Hermes output with:
```ts
const COST_REGEX = /(?:cost|spent)[:\s]*\$?([\d.]+)/i;
```
The regex runs over the whole output, and the whole output contains the
model's own answer. The answer contained the word `spent.` — as ordinary
English prose, at the end of a sentence. The regex matched it, the
capture group was `.`, and `parseFloat(".")` is `NaN`.
The server then refused to store `NaN` as the run's cost, and marked the
run failed. Because the run failed, it did not settle, and the session
was not carried into the next heartbeat — so the memory the Hermes
runtime exists for was lost as well.
**Expected behavior**
A cost that is not a number must not fail a run. The run should be
recorded with no cost, the same way a run with no cost line at all is
recorded.
**Steps to reproduce**
1. Give an agent a Hermes adapter (`hermes_local`).
2. Let the agent answer with text that contains the word `cost` or
`spent` followed by a full stop, for example `the round it spent.`
3. Start a run of the agent.
4. The run is marked `failed` with `adapter_failed` and `Invalid input:
expected number, received NaN`.
5. The answer the agent left on the issue is still there, but the run is
red, it does not settle, and the next heartbeat does not resume the
session.
**Paperclip version or commit**
`master` at `043f2514e`.
**Deployment mode**
Self-hosted server.
**Installation method**
Built from source.
**Agent adapter(s) involved**
Hermes. The change is in `packages/adapters/hermes`, so no other adapter
changes.
**Database mode**
Not database-related.
**Node.js version**
v24.22.1 on the author's own Linux host, where the tests ran before the
push.
**Operating system**
Linux on the author's own Linux host, where the tests ran before the
push.
**Relevant logs or output**
The error above is the complete error from the server. The adapter's own
output at that point was a normal, successful answer.
**Additional context**
The same defect has a second effect that is easy to miss. The Hermes
runtime is the one runtime in the company that keeps a session between
heartbeats, so that the second heartbeat resumes the first one's thread.
A run that fails is not settled, so its session is not recorded, and the
next heartbeat starts from nothing. A single unlucky word in one answer
therefore costs the agent its memory.
## What Changed
- `packages/adapters/hermes/src/server/execute.ts`: the cost that the
adapter reads out of the Hermes output is kept only when it is a finite
number. The capture group of the cost regex is `[\d.]+`, which also
matches text that is not a number, so an answer that contains a word
like `spent.` was read as a cost of `NaN`. The server refuses to store a
`NaN` cost and marks the whole run failed, even though the agent did its
work and the answer is on the issue. A cost that is not finite is now
left unset, which is the same state a run without a cost line ends up
in.
- `packages/adapters/hermes/src/server/execute.cost.test.ts`: new test
file with three cases, run against a capture process that prints a
fixture answer. The cases check that an answer containing `spent.`
leaves the cost unset, that a real cost is still reported, and that the
session is still handed back so that the next heartbeat can resume it.
- No code comments are added. The upstream contributing guide asks that
a pull request carries none, so the explanation of the failure mode
lives in this description.
## Verification
The commands below ran on the author's own Linux host, before the push.
They did not run on CI. The host used Node.js v24.22.1 and vitest 5.0.3.
The tree was the upstream `master` revision `043f2514e`, with this
repository's own harness on top of it; the adapter files under test are
identical in both trees.
```sh
cd packages/adapters/hermes
./node_modules/.bin/vitest run src/server/execute.cost.test.ts
```
Before the change, the new case failed. The failure was the production
symptom itself.
```
FAIL src/server/execute.cost.test.ts > Hermes cost parsing (real capture process) > leaves the cost out when the output does not carry a number
AssertionError: expected NaN to be undefined
❯ src/server/execute.cost.test.ts:68:28
Test Files 1 failed (1)
Tests 1 failed | 2 passed (3)
```
After the change, the file passes.
```
Test Files 1 passed (1)
Tests 3 passed (3)
```
The whole package suite was re-run after the change, so that the fix is
not traded against the rest of the adapter.
```
Test Files 11 passed (11)
Tests 176 passed (176)
```
The type check of the package passes as well.
```sh
cd packages/adapters/hermes
./node_modules/.bin/tsc --noEmit
```
### The pull request carries no code comments
The contributing guide asks that a pull request adds no code comments,
so the explanatory block of this change was removed and the reasoning
moved into this description. The tree of the branch was rebuilt from the
branch content alone, and the whole package suite was run again on that
tree.
```
Test Files 11 passed (11)
Tests 176 passed (176)
```
The new test runs the adapter against a capture process that prints a
fixture answer, the same way the other adapter tests do. It checks three
things: an answer that contains `spent.` leaves the cost unset, a real
cost is still reported, and the session is still handed back so that the
next heartbeat can resume it.
## Risks
- The change is local to the Hermes adapter. No other adapter and no
server code changes.
- A cost that is not a number is now recorded as no cost. That is the
same state a run without a cost line ends up in, and the run's
accounting already handles it.
- A real cost is still reported. The change only rejects values that are
not finite, so `0` is still a cost and `0.0123` is still a cost.
- The regex itself is not tightened. It still matches the same text as
before; the difference is that a capture that does not parse as a number
is dropped instead of being carried into the accounting.
- The upstream contributing guide asks that a pull request carries no
code comments, so this change adds none. The explanation that the code
would have carried lives in this description instead: the failure mode
is not obvious from the diff, so a reviewer has to read the description
above to follow the change.
## Model Used
- Provider: MiniMax
- Model id: `minimax-M3.1-Flash`
- Context window: not published in this environment. The size is
unknown.
- Reasoning mode: the environment does not expose a reasoning or
thinking mode for this model.
- Capabilities used: tool use, code execution, shell, file editing.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` /
`Closes: #` / `Refs: #` OR (b) described the issue in-PR following the
relevant issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
canary/v2026.1130.0-canary.871200
|
||
|
|
12d0bfa232 |
fix(openclaw-gateway): show thinking and tool steps in the run transcript (#17136)
# fix(openclaw-gateway): show thinking and tool steps in the run transcript ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The OpenClaw gateway adapter runs agents on a remote OpenClaw gateway and streams the agent events into the run log > - The run transcript in the UI shows thinking and tool calls for the built-in adapters, for example `claude_local` and `codex_local` > - For `openclaw_gateway`, the UI parser shows only `assistant` text and errors. It drops `thinking` events and tool `item` events, but the run log has them > - So a board operator cannot see what an OpenClaw agent thinks or which tools it calls while the run is live. A slow or stuck run looks like "Working" with no detail > - This pull request maps these two event streams to the transcript entries that the UI already renders > - The benefit is the same transcript detail for OpenClaw agents as for the built-in adapters, with no server change ## Linked Issues or Issue Description Refs #1639 (OpenClaw gateway transcript output). Related open PRs change the `assistant` branch of the same parser: #13665, #14150, #14217, #4793. This PR does not change that branch. It adds two new branches. **What existing behavior does this improve?** The run transcript of an `openclaw_gateway` agent. **Subsystem affected** Adapters: `packages/adapters/openclaw-gateway/src/ui/parse-stdout.ts`. **Current behavior** `parseAgentEventLine` returns transcript entries only for the `assistant`, `error` and `lifecycle` streams. For `stream=thinking` and `stream=item` it returns an empty list, so the UI shows nothing for them. **Proposed behavior** `stream=thinking` becomes a `thinking` entry (the `delta` text with `delta: true`, or the full `text`). A tool `item` with `phase: "start"` becomes a `tool_call` entry. A tool `item` with `phase: "end"` becomes a `tool_result` entry. A result with a status other than `completed` is an error. **Reason and benefit** Operators can see what an OpenClaw agent does during a run, as they can for the built-in adapters. **Breaking changes** None. Only the UI parser changes. The stored run log does not change. ## What Changed - `parseAgentEventLine` maps `stream=thinking` to `thinking` entries. It keeps streamed deltas, which `appendTranscriptEntry` already joins. - `parseAgentEventLine` maps tool `item` events (`kind: "tool"`) to `tool_call` (start) and `tool_result` (end) entries. The OpenClaw event has the tool name and a title, but not the tool input or output. The entry uses the title as the input and as the result content, and the errortext for a failed tool. - New `parse-stdout.test.ts` with cases for thinking, tool start, tool end (completed and failed), and the streams that stay ignored. ## Verification - `vitest run` on `packages/adapters/openclaw-gateway/src/ui/parse-stdout.test.ts`: 6 tests pass. - Manual: the same mapping on a 2026.1012.0 instance with OpenClaw 2026.9.33 agents. The run transcript shows the thinking and each tool stepduring the run. - Not run: the full repository type check. ## Risks Low risk. The change adds two branches to a UI parser. The events that were shown before have the same result. A thinking stream can be long,so the transcript of an OpenClaw run gets longer, as it is for the built-in adapters. ## Model Used Claude Opus 5.5 (`claude-opus-5-5`), with tool use and code execution, 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 - [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: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
fa283aeea2 |
feat(plugins): let an environment plugin report its task's startup stage (#22970)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - A run's environment can come from a plugin, which runs the agent's task through environment task operations such as prepare and submit. > - The stacked pull requests below this one make Core publish each run's startup stage from the steps it times, and show that stage in the task view. > - Core cannot see inside a plugin's task operation. A slow step there, such as a stopped machine starting, shows as whatever stage Core was in when it called the plugin. > - This pull request lets an environment plugin report its task's stage, from the same closed list Core uses, while one of its task operations runs. > - The benefit is that the task view names the real reason a plugin-backed turn has not started yet, with no stages only plugins know about. ## Linked Issues or Issue Description No public issue exists. Stacked on #22956 (UI), which is stacked on #22953 (server). **Subsystem affected** Plugin SDK (`packages/plugins/sdk`), plugin host services and environment task runtime (`server/src/services`), and the plugin docs. **Problem or motivation** A plugin's environment task operation can take many seconds, for example when it starts a stopped machine. The task view keeps the stage Core showed when it called the plugin, so the wait has the wrong name. **Proposed solution** Add `ctx.environmentTasks.reportStartupStage({ taskId, stage })`. Core accepts a report only while one of that plugin's task operations for a run is in flight. The reported stage shows instead of Core's stage until the operation returns. **Alternatives considered** - Free-form status text from the plugin. It would not match Core's stages, and each plugin would word the same step in a different way. - Stages that only plugins can report. One shared list keeps Core and plugins aligned, so the task view needs no plugin-specific labels. ## What Changed - SDK: `ctx.environmentTasks.reportStartupStage({ taskId, stage })` and the `environmentTasks.reportStartupStage` host method. The call needs the existing `environment.drivers.register` capability. The test harness records reports in `startupStageReports`. - Server: the environment task runtime opens a reporting window for the plugin and task while each task operation for a run is in flight. Inside the window, the plugin's stage shows instead of Core's stage, and may be an earlier stage (for example `starting_environment` during submit). When the last operation returns, Core's stage shows again. - Server: Core ignores a report outside a window, for another plugin's task, with an unknown stage, or after the agent's turn starts. A report never fails the task operation. - Docs: `PLUGIN_ENVIRONMENT_TASKS.md` has a "Startup stages" section, and `PLUGIN_SPEC.md` lists `ctx.environmentTasks`. - `tests/runner-e2e/source-sdk-public-inputs.json`: regenerated for the changed SDK sources. ## Verification - `npx vitest run tests/host-client-factory.test.ts tests/testing-environment-tasks.test.ts` in `packages/plugins/sdk`: the capability gate and the harness record (26 tests pass). - `npx vitest run src/services/run-startup-stage.test.ts src/__tests__/environment-task-runtime.test.ts` in `server`: windows open and close per operation, overlapping operations, reports outside a window or after the turn starts are ignored, an earlier stage shows during the window, and a report from inside a real task operation reaches the run (78 tests pass). - `node tests/runner-e2e/source-sdk-public-inputs.mjs <head> --write` reports no changes. - `pnpm --filter @paperclipai/plugin-sdk typecheck` and `pnpm --filter @paperclipai/server typecheck` pass. - CI runs the full suite. ## Risks - Low risk. The call is new and optional. Plugins that do not call it see no change. - A plugin can only report for its own task, only while Core waits on one of its operations, and only from the shared stage list. It cannot change the stage after the agent's turn starts. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use (shell, file edits). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1a726eaccf |
feat(ui): name a run's startup stage instead of Thinking (#22956)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The task view's runner turn shows a status header and a current-activity line while an agent works. > - From the claim until the agent's turn starts, that line says "Thinking", even while the run acquires its environment, restores its session or connects tools. > - The stacked pull request below this one makes the server publish each run's startup stage. > - This pull request shows "Getting ready" from message submission, then the server's stage after the claim, instead of "Thinking". It holds each shown stage briefly so fast steps do not flicker. > - The benefit is that a person can see why a turn has not started yet. ## Linked Issues or Issue Description No public issue exists. Stacked on #22953, which adds the server side. **Subsystem affected** Task chat runner turn (`ui/src/components/task-chat`), live run updates (`ui/src/context/LiveUpdatesProvider.tsx`) and `DESIGN.md`. **Problem or motivation** A cold start can spend many seconds on setup before the agent's first event. The activity line says "Thinking" for all of it, so a slow start looks like a slow model. **Proposed solution** Start a queued turn on "Getting ready", which is also the server's first stage after the claim, so the line does not change at the claim. Then name the server's startup stage until the agent's turn starts. Keep the header and the 30-second "Waiting to start" rule as they are. **Alternatives considered** A trailing debounce (show a stage only after it lasts some time). It delays every stage by the same amount and still cannot tell whether a step will continue. This change shows each stage at once and only holds a shown stage for a minimum time. ## What Changed - `run-startup-stage.ts` (new): the stage labels (`Getting ready`, `Waking up`, `Preparing workspace`, `Restoring session`, `Connecting tools`, `Starting agent`, and `Resuming session` for a resumed provider session) and `useHeldLabel`. A changed label shows at once when the current one has been visible for 500 ms. Otherwise the latest label shows when the 500 ms end, and labels in between are skipped. - `TaskChatRunnerTurn`: the current-activity line of a queued turn shows "Getting ready" instead of "Thinking", from message submission. A running (claimed) run shows the held server stage. Stages shimmer like "Thinking". Named holds (for example waiting for a provider) still win, and a turn still queued after 30 seconds with no named hold still says "Waiting to start". The header keeps "Working". "Thinking" begins when the agent's turn starts. - `TaskChatThread`: passes the live run's `startupStage` and `startupSessionResumed` to the runner turn. - `LiveUpdatesProvider`: the `heartbeat.run.startup_stage` event patches cached runs. It drops unknown stages and does not refetch. - `DESIGN.md`: a queued turn's activity line is now "Getting ready" instead of "Thinking", and a new paragraph next to the queued-turn rule describes the stages. ## Verification - `npx vitest run src/components/task-chat/run-startup-stage.test.ts`: labels, immediate change after the hold, the hold and skip to the latest label, the return to the default, and an undone change. - `npx vitest run src/components/TaskChatThread.test.tsx`: a claimed run shows its stage and keeps the "Working" header, a resumed session shows "Resuming session", agent activity replaces the stage, and a queued run shows no server stage. The existing admission tests now expect "Getting ready" where they expected "Thinking", and the mounted-through-startup test checks that the line stays "Getting ready" across the claim. The two tests that check for no startup feedback also reject "Getting ready". - `npx vitest run src/context/LiveUpdatesProvider.test.ts`: the event becomes a cache patch and unknown stages are dropped. - `npx vitest run src/components/TaskChatThread.test.tsx src/components/IssueChatThread.test.tsx src/components/task-chat`: 932 tests pass. `pnpm --filter @paperclipai/ui typecheck` passes. - CI runs the full suite. ## Risks - Low risk. The change is presentation only. If the server sends no stage (an older server, or after a restart), the line shows "Thinking" as before. - Queued turns now say "Getting ready" instead of "Thinking" during admission. The 30 second grace, the "Waiting to start" rule and named holds are unchanged. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use (shell, file edits). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
76e3b7e172 |
feat(runs): track each run's startup stage for the board (#22953)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - When a run starts, Core claims it, prepares the host, acquires and prepares the execution environment, restores the saved session, sets up tools, and starts the agent's runner. > - The task view shows "Thinking" for all of that time, so a slow cold start looks like a slow model. > - Core already times each of these steps (`heartbeat.prepare.*`, `native.controller.*` and the native run trace), but nothing tells the board which step is running. > - This pull request adds a closed list of startup stages and a process-local tracker that follows those timed steps. It sends the current stage to the board as a live event and adds it to active run reads. > - The benefit is that the board can say what a run is doing before the agent's turn starts. The UI change comes in a stacked pull request. ## Linked Issues or Issue Description No public issue exists. **Subsystem affected** Run execution status (`server/src/services/heartbeat*`, native runtime trace) and the shared run types. **Problem or motivation** From the claim to the agent's first turn, the task view always says "Thinking". On a test instance over 24 hours, the median time before the first agent event was 10 to 50 seconds. Most of it was environment setup, session migration (median 0.3 s, P90 14 s) and tool setup (median 8 s, P90 18 s), not model time. A user cannot tell a slow start from a slow model. **Proposed solution** Name the startup steps that every execution environment goes through and report the current one. Derive the stages from the steps Core already times, so the stage and the trace spans cannot drift apart. **Alternatives considered** Free text from each environment, which gives inconsistent wording and lets an environment show arbitrary text. Grouping by where the work runs, which breaks the order because Core does host work both before and after it acquires the environment. ## What Changed - `packages/shared`: add `RUN_STARTUP_STAGES` (`getting_ready`, `starting_environment`, `preparing_workspace`, `restoring_session`, `connecting_tools`, `starting_agent`), the `heartbeat.run.startup_stage` live event type and its payload type, and the `startupStage` and `startupSessionResumed` run fields. - `server/src/services/run-startup-stage.ts`: a process-local tracker. One table maps timed step names to stages. A run only moves forward within one execution attempt. Startup ends at the agent turn, turn submission or first agent activity (native runs), or when the heartbeat enters a direct adapter. When startup ends, the stage clears but the attempt keeps its resumed-session flag until the attempt ends. The store is bounded (512 runs, and a 1 hour TTL while a stage shows). - The preparation timing helper (`measure`) and the native run trace (`start`, which `record` also uses) report each step to the tracker. The heartbeat starts tracking when a run starts executing and stops when the execution ends. The native executor reports a resumed provider session. - `tests/runner-e2e/source-sdk-public-inputs.json`: regenerated, because the pinned shared SDK sources changed. - `decorateHeartbeatRunRuntimeStatus` adds `startupStage` and `startupSessionResumed` to active run reads and clears them for ended runs. - The native session executor ends startup when a run that reattached after a restart sees its turn already under way: a replayed `turn.submitted` or `turn.started`, or agent output, including output that arrives before this attempt saw its own `turn.started`. ## Verification - `npx vitest run src/services/run-startup-stage.test.ts` (13 tests): stage order, the forward-only rule, skipped stages, the end of startup, unknown runs, the resumed session (also after the turn starts), a new attempt, company and agent checks, TTL and the size bound, the real timing helper and native trace hooks, and active run reads. - `npx vitest run src/__tests__/heartbeat-execution-configuration.test.ts`: a new case runs a registered direct adapter through real preparation on the test Postgres. Each run publishes `getting_ready`, `starting_environment`, `preparing_workspace`, then the end of startup, and no stage shows while the adapter runs. - `cd tests/runner-e2e && npx vitest run source-sdk-public-inputs.test.mjs source-sdk-public-type.test.ts source-sdk-evidence.test.ts` (59 tests) after the registry refresh. - The CI failure in `adapter-utils` `run-fault-matrix.test.ts` (`case_14c`) is in a package this change does not touch. It passed three times locally. - Existing tests near the change pass: `native-run-trace.test.ts`, `native-run-trace-context.test.ts`, `heartbeat/preparation-timing-context.test.ts`, `heartbeat-run-runtime-status.test.ts`, `realtime/live-event-delivery.test.ts` (108 tests). - `npx vitest run src/services/native-runtime/native-session-executor.test.ts -t "native startup stage after a restart|native resumed preparation timing"` (16 tests): a reattached run leaves startup on a replayed turn start and on new agent output. Both new cases fail without the fix. - `pnpm --filter @paperclipai/shared typecheck` and `pnpm --filter @paperclipai/server typecheck` pass. - CI runs the full suite. ## Risks - Low risk. The tracker is in memory only and is never persisted. A server restart clears it, and the board then shows what it shows today. No run, session or launch state changes shape, so no saved state needs a migration. - Every hook is wrapped so that a tracker error cannot fail a run or its trace. - The live event uses the existing `heartbeat.run.*` delivery rule: it needs a `runId` and the viewer's run read access. - One extra live event per stage change (at most about seven for each run attempt). ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use (shell, file edits, Honeycomb trace queries for the timing data). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e7ed0c2f93 |
fix(workspaces): reconcile project-derived workspace bindings when a task moves projects (#23293)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - When a task is created in a project without explicit workspace overrides, Paperclip derives `projectWorkspaceId`, `executionWorkspaceSettings`, and a project-derived `workspaceSelection` (`source: "project"`). > - Moving that unbound task to a different project via `issues.update` left the old project's `projectWorkspaceId` and `workspaceSelection` behind. > - Subsequent runs kept resolving back to the old project's workspace and storage owner, causing repeated workspace validation or storage-incompatibility failures even after the user moved the task to a compatible project. > - This pull request re-derives project-derived workspace bindings when an unbound task moves projects, and reconciles already-moved unbound tasks with stale `source: "project"` bindings at run admission while preserving explicit workspace selections and bound execution workspaces. > - The benefit is that moving an unbound task to a compatible project immediately lets it run on the new project's workspace without hidden stale-workspace failures. ## Linked Issues or Issue Description Related: #17552, #22849. **What happened?** When a task was created in a project, `issues.create` automatically set `projectWorkspaceId` and `workspaceSelection` with `source: "project"`. If the task failed before binding an execution workspace (`executionWorkspaceId === null`) and the user moved the task to a different project (for example from a Core-storage project to a plugin-storage project), `issues.update` updated `projectId` but left `projectWorkspaceId` and `workspaceSelection` pointing to the old project's workspace. Every subsequent run still resolved the old project's workspace and storage policy and failed. **Expected behavior** - Moving an unbound task whose workspace binding is project-derived (`source: "project"`, or a legacy `projectWorkspaceId` belonging to the previous project with no `workspaceSelection`) re-derives `projectWorkspaceId`, `workspaceSelection`, and `executionWorkspaceSettings` from the new project (or clears them when moving to no project or a sourceless project). - Explicit workspace selections (`source !== "project"`), bound execution workspaces (`executionWorkspaceId != null`), pending workspace selections, and tasks with an active running run or pending workspace recovery keep their current workspace binding. - Tasks already moved on an older release with a stale `source: "project"` binding pointing to a different project are reconciled at run admission before workspace preparation. **Steps to reproduce** 1. Create a Core-storage project A with a Git workspace and a plugin-storage project B with a Git workspace. 2. Create an isolated task in project A (so `issues.create` sets `workspaceSelection.source = "project"`). 3. Move the task to project B via `issueService.update(id, { projectId: projectB.id })`. 4. Before this fix, `projectWorkspaceId` and `workspaceSelection.selection.projectWorkspaceId` still point to project A's workspace. **Paperclip version or commit** Reproduced against `origin/master` at `2d764bebc6ed`. **Deployment mode** Self-hosted / Cloud server. Verified locally on macOS arm64 with embedded PostgreSQL. ## What Changed - `server/src/services/project-move-workspace-reconciliation.ts`: add focused helpers (`isProjectDerivedWorkspaceBindingStale`, `deriveProjectDefaultWorkspaceBinding`, `hasActiveTaskWorkspaceRunHolder`) shared between issue updates and run admission. - `server/src/services/execution-workspaces.ts`: add `reconcileProjectWorkspaceForProjectMove` (used by `issues.update`) and `reconcileStaleProjectWorkspaceAtAdmission` (used at run admission for already-moved tasks with stale `source: "project"` bindings). Keeping the shared reconciliation helpers in a sibling module avoids growing `execution-workspaces.ts` and `issues.ts` unnecessarily. - `server/src/services/issues.ts`: invoke `reconcileProjectWorkspaceForProjectMove` inside `issues.update` after `changesPrivacy` when `projectId` changes and no explicit workspace fields were supplied. - `server/src/services/heartbeat.ts`: invoke `reconcileStaleProjectWorkspaceAtAdmission` alongside `releaseAncestorWorkspaceBindingAtAdmission` at run admission, marking `workspaceSelectionChanged = true` when reconciled. - `server/src/__tests__/issue-project-move-workspace.test.ts`: add red-green database regressions for moving to another project, moving to a sourceless/null project, preserving explicit selections, preserving bound `executionWorkspaceId`, deferring mid-run moves, and reconciling already-moved tasks at admission. - `server/src/__tests__/agent-project-access.test.ts`: use `source: "explicit"` for the explicitly-retained-source denial test and add a companion test verifying `source: "project"` re-derives on project move. ## Verification - **Red (before production edits)**: - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/issue-project-move-workspace.test.ts` failed on `re-derives a project-derived workspace when moving an unbound task to another project` and `clears a project-derived workspace when moving to no project or a sourceless project` because `projectWorkspaceId` and `workspaceSelection` stayed pinned to the old project. - **Green (after production edits)**: - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/issue-project-move-workspace.test.ts src/__tests__/agent-project-access.test.ts` — 20/20 passed. - `pnpm --filter @paperclipai/server typecheck` — passed. - `pnpm --filter @paperclipai/server build` — passed. - `pnpm --filter @paperclipai/server exec vitest run src/services/heartbeat/workspace-preparation.test.ts -t "names incompatible Core project storage|rejects Core Git worktree preparation"` — 2/2 passed. - `pnpm --filter @paperclipai/server exec vitest run src/services/task-interruption-presentation.test.ts` — 82/82 passed. - `pnpm verify --explain` selected 1978/2333 files due to touching central server services; required GitHub Actions CI supplies the broad suite coverage. - Live deployment and recovery of previously affected tasks on hosted instances are outside this PR's scope. ## Risks - Low risk. Reconciliation is gated to unbound tasks (`executionWorkspaceId == null`, `workspacePendingSelection == null`) with no active run holder or pending workspace recovery, and never alters explicit (`source !== "project"`) workspace selections or bound files. - Moving a task to a project whose trust boundary currently denies the assigned agent will not fail the move; execution access remains enforced at run admission. ## Model Used - Google Gemini (Antigravity agentic coding assistant) with tool use, shell execution, and local test verification. Exact deployment model ID and context window are not exposed to the session. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [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.1130.0-canary.870700 |
||
|
|
2d764bebc6 |
feat(customer-success): add runs.search (/read-v3) and structured platform run diagnostics (#22985)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Paperclip Cloud inspects tenant stacks read-only through `/api/customer-success/v1` > - Today, inspection can only read raw byte slices of one run log at a time, and platform guard or launcher errors inside agent shell commands leave runs marked `succeeded` with `exitCode: 0` and no `errorCode` > - Finding how many runs hit an error string requires downloading megabytes of raw logs and pulling customer prompts into agent context > - This pull request adds bounded, match-only `runs.search` and stack-wide `count` on `/read-v3`, plus closed-vocabulary platform run diagnostics recorded on runs and surfaced in `view: "summary"` > - The benefit is fast, privacy-preserving prevalence diagnosis without exposing raw customer prose or missing errors hidden inside succeeded runs ## Linked Issues or Issue Description **Subsystem affected** Server and shared contracts: `/api/customer-success/v1` inspection endpoints, shared inspection wire contract, and run-event platform diagnostics. **Problem or motivation** When a platform wrapper (such as the Git storage guard or GitHub credential launcher) fails inside an agent tool call, the outer agent run often still finishes with `status: "succeeded"` and `errorCode: null`. Investigating prevalence through customer-success inspection previously required paging raw `runs.log` byte ranges one run at a time, pulling customer prompts into context and making fleet-wide triage impractical. **Proposed solution** 1. Extend the shared customer-success wire contract (`packages/shared/src/customer-success.ts`) with `runs.search` (1 to 5 literal substrings, no regex, optional creation window, counts/co-occurrence/sample pointers only by default, redacted excerpts only when `companyId` and `includeExcerpts: true` are set) and stack-wide `count` on `/api/customer-success/v1/read-v3`. 2. Execute `runs.search` inside the existing read-only, repeatable-read transaction using in-database `strpos` matching over `heartbeat_run_events` plus `heartbeat_runs` error fields, falling back to chunked `RunLogStore` scans with overlap windows for legacy/non-native runs or runs without stored events. 3. Add a closed-vocabulary platform diagnostic detector (`packages/shared/src/run-diagnostics.ts`) that records deduplicated `platform.diagnostic` rows in `heartbeat_run_events`, attaches `diagnostics` to `view: "summary"` run reads, and optionally reports bounded PII-free diagnostic codes to Paperclip Cloud when a stack diagnostics capability is configured. **Alternatives considered** Paging raw `runs.log` slices from Cloud or the agent. That transfers megabytes of unrelated customer prose, hits rate limits, and still fails to surface known platform errors in structured run summaries. ## What Changed - `packages/shared/src/customer-success.ts`: add `INSPECTION_SEARCH_READ_PATH` (`"/read-v3"`), `runs.search` operation and strict parser bounds, optional `companyId` for `runs.search` (without excerpts) and stack-wide `count`, and `InspectionRunSearchResult` types. - `packages/shared/src/run-diagnostics.ts` & `packages/shared/src/index.ts`: add closed-vocabulary `RUN_PLATFORM_DIAGNOSTIC_CODES` and deterministic `detectRunPlatformDiagnostics()`. - `server/src/services/customer-success-run-search.ts`: implement bounded read-only `searchCustomerSuccessRuns()` with in-DB `strpos` event matching, overlap-window `RunLogStore` fallback, co-occurrence tracking, diagnostic aggregation, and opt-in secret-redacted excerpts. - `server/src/services/customer-success-inspection.ts` & `server/src/routes/customer-success.ts`: mount `/read-v3`, enforce versioned path gating, support stack-wide `count`, and attach `diagnostics` to `runs` `view: "summary"`. - `server/src/services/run-platform-diagnostics.ts`, `server/src/services/native-runtime/paperclip-control-plane-port.ts`, `server/src/services/agent-task-run-telemetry.ts`, `server/src/services/native-runtime/native-run-log-export.ts`: detect and deduplicate `platform.diagnostic` run events, exclude them from PRP log export, and emit bounded PII-free Cloud reports when configured. - `server/src/__tests__/customer-success.test.ts`, `server/src/__tests__/run-platform-diagnostics.test.ts`, `server/src/__tests__/customer-success-cloud.test.ts`, `server/src/__tests__/openapi-routes.test.ts`, `doc/CUSTOMER-SUCCESS-INSPECTION.md`: unit tests, coordinated PostgreSQL qualification coverage, OpenAPI route list update, and documentation. ## Verification - `pnpm --filter @paperclipai/shared build && pnpm --filter @paperclipai/shared typecheck && pnpm --filter @paperclipai/server typecheck` — passed. - `cd server && pnpm exec vitest run src/__tests__/customer-success.test.ts src/__tests__/run-platform-diagnostics.test.ts src/__tests__/openapi-routes.test.ts` — 78/78 passed. - `cd server && PAPERCLIP_INSPECTION_CLOUD_DIST=<cloud-dist> pnpm exec vitest run src/__tests__/customer-success-cloud.test.ts` — passed end-to-end against two live PostgreSQL databases, verifying `/read-v3` `runs.search`, `diagnostics` in run summaries, default non-waking fleet queries, and `fleet.diagnostics`. ## Risks - Low risk. All inspection reads remain inside repeatable-read, read-only transactions behind EdDSA Cloud permits and replay fencing. - Older tenants without `/read-v3` answer 404, so Cloud fails closed with `tenant_inspection_version_unsupported` during rolling upgrades. - `platform.diagnostic` rows stay in the instance database (`heartbeat_run_events`); Cloud reporting is a no-op unless Cloud explicitly delivers `PAPERCLIP_RUNTIME_DIAGNOSTICS_CAPABILITY`, and emits only closed enum codes and run/driver metadata (never customer prose). ## Model Used - Google Gemini 4 Neon (High) in Antigravity with tool use (shell, file editing, test execution). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1130.0-canary.870600 |
||
|
|
bc98abda0c |
Keep onboarding subscription instructions plain (#23274)
## Thinking Path > - Paperclip connects agents to models. > - People choose a subscription during onboarding. > - The panel has a sign-in button and instructions. > - A second link appeared inside the instructions while waiting. > - The requested design keeps the instructions plain and the actions on buttons. ## Linked Issues or Issue Description **Subsystem affected** Subscription onboarding for Claude and OpenAI. Refs #23268 and #23270. **Current behavior** The waiting instructions contain a link to the provider. **Proposed behavior** Use plain text for both instructions. Open provider sign-in from the button. Keep the waiting button disabled and offer Retry when the attempt ends. ## What Changed Removed the waiting instruction link. Made the sign-in pill a native button. Use the published code deadline to show expiry even if the status poll misses the timeout. Updated the wizard tests. ## Verification All 25 login card and form tests passed locally. Both provider cases check the waiting state for links. ## Risks Closing the provider tab while waiting means the user must return to the provider tab, go Back, or wait to retry. ## Model Used OpenAI GPT-6 with Codex repository and test tools. ## Checklist - [ ] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [ ] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [ ] I have run tests locally and they pass - [ ] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [ ] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting mergecanary/v2026.1130.0-canary.870500 |
||
|
|
429a004da5 |
Honor device sign-in expiry during onboarding (#23270)
## Thinking Path > - Paperclip connects agents to model providers. > - Onboarding starts a device login for OpenAI. > - The login starts its session clock before it acquires a sandbox. > - The command must stop by the deadline shown for the session. > - The wizard can then offer a fresh code when that session expires. ## Linked Issues or Issue Description **Subsystem affected** Subscription onboarding and displayed-code login. Refs #23268. **Current behavior** An unattended OpenAI login can show a generic failure at expiry. **Proposed behavior** Use the session deadline and show the same expiry message as Claude. Show “Waiting…” for OpenAI and “Waiting for code…” for Claude. ## What Changed Bound the command timer to the remaining session lifetime. Arm the host timer before the command can schedule its own timeout. Keep the outcome fixed during cleanup. Updated the OpenAI waiting label. ## Verification All 79 tests in the device login service, runner, and login card suites passed. These cover delayed sandbox setup, failure before expiry, and timeout at the deadline. ## Risks Early command failures still need their own failure state. The change preserves those failures and explicit cancellation. ## Model Used OpenAI GPT-6 with Codex repository and test tools. ## Checklist - [ ] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [ ] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [ ] I have run tests locally and they pass - [ ] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [ ] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting mergecanary/v2026.1130.0-canary.870400 |
||
|
|
111973c5e3 |
Show waiting and retry in the onboarding sign-in card (#23268)
## Thinking Path > - Paperclip helps people manage AI agents. > - Onboarding connects an agent to a model. > - Users open the provider sign-in from the connection card. > - The card should show when the provider is waiting and how to recover after a timeout. > - This change keeps both actions in the same place. ## Linked Issues or Issue Description **Subsystem affected** Model connection during first-agent onboarding. Related work includes #23255 and #6636. **Current behavior** The sign-in link remains active after opening the provider. Retry appears in the footer. **Proposed behavior** Show a waiting label beside the code. Offer retry inside the card when sign-in expires. Keep Next disabled during these states. ## What Changed - Show the provider-specific waiting label after opening sign-in. - Show a retry action and saved-setup message in the card. - Cover both providers and the reset after retry. ## Verification - Ran the UI typecheck. - Ran the adapter login card and local login tests. All 33 passed. ## Risks Local and hosted sign-in expose retry through different handlers. This change keeps the existing session handlers. ## Model Used OpenAI GPT-6 with Codex repository and test tools. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>nightly/v2026.1130.0-nightly.0 canary/v2026.1130.0-canary.870300 |
||
|
|
e55b475f30 |
Polish the onboarding model connection cards (#23255)
## Thinking Path > - Paperclip helps people manage AI agents. > - Onboarding connects the first agent to a model provider. > - Both subscription flows ask the user to complete an authorization step. > - Moving that action into the provider card keeps the footer stable. > - The updated cards also keep their spacing through loading and mode changes. ## Linked Issues or Issue Description **Subsystem affected** First-agent onboarding. **Current behavior** The sign-in action changes the footer label during connection. Switching credential modes shifts the layout. **Proposed behavior** Show the provider sign-in action beside its code. Keep Next disabled while connecting. Advance after verification. ## What Changed - Align the Claude and OpenAI code controls, instructions and provider marks. - Reserve the loaded card height and animate the API controls together. - Update the standalone walkthrough with simulated provider approvals. ## Verification - Browser walkthroughs covered both simulated approvals and automatic advance to Review before integration with master. - Measured equal loading and ready heights, API field spacing, and mode-switch positions in the local preview. - On revision `7c07c13c5f`, UI typecheck passed, 31 focused tests passed, and the Chromium Claude paste-to-chat journey passed. ## Risks Local and hosted login use different retry paths. Check both during review. ## Model Used OpenAI Codex, GPT-6, with repository and browser tools. ## Checklist - [x] Included project context, issue description, verification scope and risks. - [x] Described the model and tools used. - [x] Checked the roadmap for overlapping onboarding work. - [ ] Verify final revision in CI and resolve review feedback. - [x] I have searched GitHub for duplicate or related PRs and linked them above Related prior work includes #19557 and #13499. --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1130.0-canary.870200 |
||
|
|
629281b1e8 |
fix(test): eliminate Cloud Readiness timeouts in route imports and multi-page arbiter drain tests (#23160)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Post-merge `Cloud readiness` runs the full server test suite with `--retry=0` before publishing new Core Docker images. > - Five consecutive `Cloud readiness` runs on `master` failed over 22 hours because two test timeout patterns surfaced under multi-worker CI shards. > - First, `issue-activity-events-routes.test.ts` and `issue-comment-attribution-audit-routes.test.ts` dynamically import `server/src/routes/issues.ts` inside the first `it()` block, crossing the 15s `testTimeout` when 5 fork workers simultaneously hit Vite's transform server. > - Second, `native-status-arbiter-corpus.test.ts` seeds 103 rows sequentially in its multi-page drain tests, crossing 60s under 7-worker shared-Postgres load and causing `afterEach` to time out before restoring real timers. > - This pull request moves those module imports into `beforeAll`, aligns `server/vitest.config.ts` `testTimeout` with `hookTimeout` (30s), batches the 103-row fixture seeding with bounded concurrency, and guards timer restoration in `try/finally`. > - The benefit is green, deterministic post-merge `Cloud readiness` builds without weakening any test assertion or retry policy. ## Linked Issues or Issue Description **What happened?** Five consecutive `Cloud readiness` workflow runs on `master` failed and cancelled over a 22-hour window, blocking new Core image publication: - Three runs failed with `Test timed out in 15000ms` on the first test of `server/src/__tests__/issue-activity-events-routes.test.ts` (twice) and `server/src/__tests__/issue-comment-attribution-audit-routes.test.ts` (once) while dynamically importing `server/src/routes/issues.ts` under 5-worker parallel serialized shards. - Two runs failed in `server/src/__tests__/native-status-arbiter-corpus.test.ts` when `drains more than one reconstruction page without replaying settled reviews` timed out at `60000ms` during 103 sequential `seedReview()` calls, which also timed out `afterEach` (`30000ms`) before restoring `vi.useRealTimers()`. **Expected behavior** All server route and native status arbiter tests pass reliably on post-merge `Cloud readiness` (`--retry=0`) without cold-transform timeouts or leaked fake timers. **Steps to reproduce** 1. Run `Cloud readiness` (`release-verify.yml`) on `master` with `--retry=0` on 8-core runners (`maxWorkers=5` serialized shards, `maxWorkers=7` general-server shards). 2. Observe cold dynamic imports of `routes/issues.ts` inside `it()` crossing `15000ms` and the 103-row sequential seed test in `native-status-arbiter-corpus.test.ts` crossing `60000ms`. **Paperclip version or commit** `c57471459f` (`master`) ## What Changed - **`server/src/__tests__/issue-activity-events-routes.test.ts`**: Register module mocks and import `routes/issues.js` and `middleware/index.js` once in `beforeAll` (30s timeout) instead of calling `vi.resetModules()` and re-importing on every test; keep full `vi.clearAllMocks()` and mock defaults reset in `beforeEach`. - **`server/src/__tests__/issue-comment-attribution-audit-routes.test.ts`**: Pre-import `routes/activity.js` and `routes/issues.js` in `beforeAll` alongside embedded Postgres startup (30s timeout) instead of lazily importing inside `createApp()` on the first test. - **`server/vitest.config.ts`**: Increase `testTimeout` from `15000` to `30000` (matching `hookTimeout` and `teardownTimeout`) so parallel cold Vite transforms on 5-worker CI shards do not flake the first test in sibling route suites. - **`server/src/__tests__/native-status-arbiter-corpus.test.ts`**: Seed the 103 fixtures in both multi-page drain tests in bounded concurrent batches of 8, parallelize the final status assertions, allow `30_000ms` for multi-page `flush()`, and wrap `coordinator?.stop()` in `try/finally` in both `afterEach` hooks so `vi.useRealTimers()` and `vi.restoreAllMocks()` always run. ## Verification - `pnpm --filter @paperclipai/server typecheck` — passed - `pnpm exec vitest run --project @paperclipai/server server/src/__tests__/issue-activity-events-routes.test.ts server/src/__tests__/issue-comment-attribution-audit-routes.test.ts server/src/__tests__/native-status-arbiter-corpus.test.ts` — passed (`3/3` files, `189/189` tests; `issue-activity-events-routes.test.ts` ran in `3.95s` total and test 1 of `issue-comment-attribution-audit-routes.test.ts` ran in `445ms`) ## Risks - Low risk: test-only and Vitest timeout configuration changes. No production server behavior, schema, or API contracts are changed, and no test assertions or retry policies are weakened. ## Model Used - Google DeepMind Antigravity (Gemini 3.1 Pro, agentic tool use with shell verification) ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) |
||
|
|
c57471459f |
feat(responsibilities): add routine filter and routine agent avatars (#23159)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - The experimental Responsibilities dashboard (`outline_v2`) lists a
person's areas and responsibilities as a clean outline.
> - Today, operators cannot filter the Responsibilities outline by
whether a responsibility has routines, and rows do not show which agents
are assigned to those routines.
> - Operators need a quick visual signal of which responsibilities
already have agent-run routines and a fast way to focus on
responsibilities with or without routines.
> - This pull request adds `routineAgentIds` to `ResponsibilityRollup`,
adds the shared toolbar filter icon with "Has routines" and "No
routines" options (defaulting to either), and displays slightly
overlapping agent avatars on the right side of responsibility rows that
have assigned routines.
> - The benefit is faster scanning of routine coverage across
responsibilities without leaving the outline view.
## Linked Issues or Issue Description
**What existing behavior does this improve?**
The Responsibilities dashboard (`outline_v2` view at
`/<prefix>/responsibilities`) and the `ResponsibilityRollup` response
returned by `GET /api/companies/:companyId/responsibilities`.
**Subsystem affected**
Cross-cutting (multiple of the above)
**Current behavior**
The Responsibilities dashboard header shows only a search box, total
counts, and the New area button. Each responsibility row shows only its
bar sentence or title, with no visual indicator of which agents are
assigned to its routines and no filter to narrow by routine presence.
**Proposed behavior**
The header adds the shared toolbar Filter icon button beside the search
box, opening a popover with "Has routines" and "No routines" options
(both unchecked by default so either is shown) and a Clear action. Each
responsibility row with one or more non-archived routines assigned to
agents displays those agents' avatars slightly overlapping on the right
side of the row (up to 4 avatars with a `+N` overflow indicator and a
tooltip listing agent names).
**Reason and benefit**
Operators scanning their responsibilities need to see at a glance which
responsibilities already have agents running routines and quickly filter
to responsibilities that still need routines set up (or only those with
routines).
**Breaking changes**
Additive field `routineAgentIds: string[]` added to
`ResponsibilityRollup`. Existing callers ignore unknown fields.
## What Changed
- Added `routineAgentIds: string[]` to `ResponsibilityRollup` in
`packages/shared/src/types/responsibility.ts` and refreshed the pinned
hash in `tests/runner-e2e/source-sdk-public-inputs.json`.
- Updated `responsibilityService.computeRollups` and
`buildResponsibilityRollup` in `server/src/services/responsibilities.ts`
to select `routines.assigneeAgentId` (ordered deterministically by title
and id) and deduplicate non-null assignees across non-archived member
routines (direct and project-linked) with no extra queries.
- Added `OutlineV2RoutineFilter` and `filterOutlineV2Groups` in
`ui/src/lib/responsibility-outline-v2.ts`.
- Added the shared toolbar `Filter` icon popover ("Has routines" / "No
routines", default either) and live filtered counts to
`ui/src/pages/Responsibilities.tsx`.
- Updated `ui/src/components/responsibilities/DashboardOutlineV2.tsx` to
filter groups, unfold matching areas while filtered, show an empty-match
state with a Clear filter button, and render slightly overlapping
routine-agent avatars (`size={20}`, `-space-x-1.5`, capped at 4 with
`+N`) on the right side of each row that has routines with assigned
agents.
- Added unit, embedded-Postgres integration, jsdom UI, and Storybook
coverage (`server/src/__tests__/responsibilities-rollup.test.ts`,
`server/src/__tests__/responsibilities.test.ts`,
`ui/src/lib/responsibility-outline-v2.test.ts`,
`ui/src/components/responsibilities/DashboardOutlineV2.test.tsx`,
`ui/src/pages/Responsibilities.outline-v2.test.tsx`, and
`ui/storybook/stories/activity/responsibilities.stories.tsx`).
## Verification
- `pnpm --filter @paperclipai/shared build` — passed.
- `pnpm --filter @paperclipai/server typecheck` — passed (all 7 layers).
- `pnpm --filter @paperclipai/ui typecheck` — passed.
- `pnpm check:token-gates` — passed (all 4 gates clean).
- Focused Vitest suites (194 tests across 10 files) — passed:
- `server/src/__tests__/responsibilities-rollup.test.ts` (18/18)
- `server/src/__tests__/responsibilities.test.ts` (37/37, embedded
PostgreSQL)
- `server/src/__tests__/responsibility-summaries.test.ts`,
`responsibility-summary-generator.test.ts`,
`responsibility-tools.test.ts`
- `ui/src/lib/responsibilities.test.ts` (41/41),
`responsibility-views.test.ts` (35/35),
`responsibility-outline-v2.test.ts` (15/15)
- `ui/src/components/responsibilities/DashboardOutlineV2.test.tsx` (2/2)
- `ui/src/pages/Responsibilities.outline-v2.test.tsx` (1/1)
- Manually verified live Storybook preview (`Dashboard view: Outline v2,
routine avatars & filter`) in dark mode across default, "Has routines",
"No routines", and "Clear" states, confirming avatar overlap for 1, 2,
and 3 agents and empty states for rows without routines.
- Note: `pnpm verify` exited with code `2` because
`tests/runner-e2e/source-sdk-public-inputs.json` changed; CI supplies
the full broad suite.
## Risks
- Low risk. `routineAgentIds` is computed from the existing
`memberRoutines` query in `computeRollups` (adding one column selection
and deterministic ordering, no new queries or schema migrations).
## Model Used
- Google Gemini 4 Neon (High) via Antigravity 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
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
|
||
|
|
c1bb0e80b3 |
fix(ci): enable containerd image store before loading merge-group OCI archive (#23157)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The `docker-merge-group.yml` workflow builds and probes `linux/amd64` and `linux/arm64` production images in the merge queue so `docker.yml` can promote verified bytes on `master`. > - Every `linux/arm64` merge-group run on `ubuntu-24.04-arm` fails during `docker load --input "$ARCHIVE"` with `open /var/lib/docker/tmp/docker-import-.../blobs/json: no such file or directory`. > - That failure prevents `linux/arm64` merge-group image verification from ever succeeding and leaves red merge-queue workflow runs on every merge. > - This pull request enables Docker's `containerd-snapshotter` image store (and verifies activation after restart) before `Set up Docker Buildx` in the `build` job so `ubuntu-24.04-arm` loads OCI image index archives with provenance attestations cleanly. > - The benefit is green `linux/arm64` merge-group builds while preserving full SLSA provenance attestations and PID 1 orphan-reaping checks. ## Linked Issues or Issue Description **What happened?** Every `linux/arm64` run of `.github/workflows/docker-merge-group.yml` on `ubuntu-24.04-arm` fails in `Verify PID 1 reaps orphaned processes` during `docker load --input "$ARCHIVE"` with `open /var/lib/docker/tmp/docker-import-.../blobs/json: no such file or directory`. **Expected behavior** Both `linux/amd64` and `linux/arm64` merge-group builds should load the OCI archive, pass `scripts/assert-orphan-reaping.sh`, record the verified image, and upload the artifact. **Steps to reproduce** 1. Trigger `.github/workflows/docker-merge-group.yml` via the `master` merge queue (for example, run `46002863710`). 2. Observe `linux/amd64` (`ubuntu-26.04`) passes `docker load`, while `linux/arm64` (`ubuntu-24.04-arm`, classic Docker graphdriver) fails with missing `blobs/json`. ## What Changed - Added a step in `.github/workflows/docker-merge-group.yml` (`build` job, before `Set up Docker Buildx`) that enables Docker's `containerd-snapshotter` image store when not already enabled, restarts Docker, and asserts `containerd.snapshotter` is active in `docker info`. - Added a regression assertion in `scripts/merge-group-image.test.mjs` scoped to the `build` job verifying `containerd-snapshotter` precedes `Set up Docker Buildx`. ## Verification - Ran locally against the PR worktree: - `node --test scripts/merge-group-image.test.mjs scripts/macos-runner-runtime-workflow.test.mjs` — all passed. - `vitest run server/src/__tests__/docker-runner-workflows.test.ts server/src/__tests__/docker-build-stamp.test.ts` — 33/33 passed. - Full PR CI runs on this PR; live `ubuntu-24.04-arm` `docker load` behavior will be verified on the next `merge_group` run after merge. ## Risks - Low risk: scoped strictly to `docker-merge-group.yml` (which has read-only permissions and no registry credentials) and skipped as a no-op on runners that already enable `containerd-snapshotter`. - Easy to roll back by reverting this PR. ## Model Used - Gemini (Antigravity) ## 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) |
||
|
|
7bd652e3ba |
perf(ci): shard release-verify stragglers and move typecheck cache warmup (#23156)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Every merge to `master` runs `release-verify.yml` on the dedicated `paperclip-post-merge-x64` fleet to certify the exact commit before downstream releases consume it. > - Four lanes currently bottleneck `release-verify.yml` at ~6m–6m 30s (`server-integration`, `server (1/10)`, `Serialized tests (1/9)`, and `Build` with 75s of serial typecheck-cache warming), while every other lane finishes in 2m–3m 45s. > - Post-merge verification latency directly delays every release pipeline waiting on exact-source proof. > - This pull request shards those three test stragglers using existing deterministic shard flags and moves incremental typecheck cache warming into `typecheck` (skipping a redundant server pass when `pnpm -r typecheck` already populated the cache). > - The benefit is a balanced ~4m post-merge verification critical path with zero weakened or removed checks. ## Linked Issues or Issue Description **What happened?** Post-merge release verification (`release-verify.yml`) takes ~6m 30s on its slowest lanes (`server-integration` 6m 29s, `server (1/10)` 6m 23s, `Serialized tests (1/9)` 6m 00s, and `Build` 5m 45s including 75s of `Warm incremental typecheck cache`), while the rest of the workflow finishes in ~3m. **Expected behavior** All lanes in `release-verify.yml` should run with balanced parallelism on `paperclip-post-merge-x64` so post-merge verification finishes in ~4m while running every existing check. **Steps to reproduce** 1. Inspect a canonical `master` run of `cloud-readiness.yml` / `release-verify.yml` (such as run `46019173820`). 2. Compare the four straggler lanes (345s–389s) against `Typecheck` (162s) and all other verification lanes (58s–225s). ## What Changed - Expanded `general-server-without-chat-or-native-runner` in `.github/workflows/release-verify.yml` from 10 to 20 shards. - Expanded `serialized_tests` in `.github/workflows/release-verify.yml` from 9 to 16 shards. - Split `verify_paperclip_runner` `server-integration` into 3 sharded lanes (`server-integration (1/3)`, `(2/3)`, `(3/3)`) passing `--shard-index` and `--shard-count` to `pnpm test:run:general -- --group general-server-native-runner`. - Moved `Check/Warm/Save incremental typecheck cache` from `build` into `typecheck`, skipping the duplicate `server/scripts/typecheck-layers.mjs` pass when `pnpm -r typecheck` already populated `server/node_modules/.cache/paperclip-typecheck`. - Updated workflow guard tests in `.github/scripts/tests/release-runner-cache.test.mjs`, `scripts/__tests__/release-verify-workflow.test.mjs`, and `.github/scripts/tests/ci-plan.test.mjs`. ## Verification - Ran locally against the PR worktree: - `node --test .github/scripts/tests/release-runner-cache.test.mjs scripts/__tests__/release-verify-workflow.test.mjs .github/scripts/tests/ci-plan.test.mjs .github/scripts/tests/post-merge-runner-routing.test.mjs` — all passed. - Full PR CI runs on this PR. ## Risks - Low risk: all tests and verification gates remain required; only matrix shard counts and cache-warm job placement change. - Peak post-merge AWS fleet concurrency increases by 19 lanes on `paperclip-post-merge-x64` (isolated from PR CI); easily reverted by reverting this PR if fleet scaling shows unexpected queue wait. ## Model Used - Gemini (Antigravity) ## 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) |
||
|
|
9c1fd24642 |
fix(secrets): keep a connected account's saved sign-in from being deleted or disabled (#23139)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Agents run with an AI account that a person connects, for example a
personal Claude subscription
> - Paperclip keeps the saved sign-in of a personal account as a value
of a user secret, and that secret shows on the Secrets page
> - A person can delete or disable that secret, or its value in My
secrets, and Paperclip does not stop them
> - Then the connection still shows as healthy, but every agent run that
uses it fails with "Reconnect this AI account"
> - The reconnect also refuses the changed sign-in slot, so the person
cannot repair the account in place
> - This pull request refuses to delete or disable a user secret or its
value while a connected account uses it, and tells the person to
disconnect the account instead
> - The benefit is that a cleanup on the Secrets page cannot silently
stop all agent runs
## Linked Issues or Issue Description
**What happened?**
A user deleted the user secret that holds the saved sign-in of their
personal Claude subscription. The Secrets page did not warn them. After
that, every agent run failed with "Reconnect this AI account"
(`configuration_incomplete`). The connection still showed as healthy and
stayed the default for the provider. When the user tried to reconnect,
Paperclip refused the personal reconnect because the sign-in slot was
changed. The user then added a new company-shared account. Agents that
use "my default" ignore company-shared accounts, so the runs continued
to fail.
**Expected behavior**
Paperclip does not let a person delete or disable a secret that a
connected account uses. The message names the account and tells the
person to disconnect the account instead.
**Steps to reproduce**
1. Connect a personal Claude subscription and make it your default.
2. Open the Secrets page. Find the user secret with the key
`ai_<grantId>`.
3. Disable it or delete it.
4. Assign a task to an agent that uses your default AI account.
5. The run fails with "Reconnect this AI account". The AI account still
shows as healthy.
**Paperclip version or commit**
`master` at
|
||
|
|
c72c468708 |
fix(github): a failed run's request waits for its automatic continuation (#23117)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Each GitHub request to a review bot gets a comment that must end in a real reply or an honest notice, and stay correct > - When a run fails with a cause the system continues automatically (restart class, setup before provider work, recovery runs), a new run follows within minutes > - Both settle paths marked the request's comment "This turn stopped before completing" and final as soon as the failed run ended, so the continuation's answer never reached that thread > - On staging, a Ponytail review run failed twice across a deploy; the automatic retry succeeded three minutes later and updated the PR review to 5/5, but the inline thread still says "stopped" > - This pull request makes the request wait, for up to 30 minutes, while the system's continuation is still expected > - The benefit is that a recovered task's thread shows its real outcome instead of a stale failure notice ## Linked Issues or Issue Description Refs #22672, #23049 **Describe the bug** A review run failed with `native_continuation_requires_reconciliation` (twice, across a deploy). The system's automatic retry then succeeded and updated the PR's main review comment. The inline thread for the request had already been set to the final notice "This turn stopped before completing" and was never updated. **Steps to reproduce** 1. A request's run fails with an error the system continues automatically. 2. The publication transport (`failRun`) or the terminal sweep settles the request as "stopped" and final. 3. The automatic continuation succeeds and publishes, but the thread is final and is not revisited. **Expected behavior** The thread waits while the continuation is expected, then shows the continuation's reply or a link to the latest response; it says "stopped" only if no continuation comes. ## What Changed - `response-run-state.ts`: `responseRunColumns` adds `continuesAutomatically` (the existing `continuesAutomaticallySql`), read in the same statements as the rest of the run state. - `response-execution.ts`: `awaitsAutomaticContinuation(run, latestRun)`: the failed run continues automatically, is still the task's latest run, and ended under 30 minutes ago (`GITHUB_CONTINUATION_WAIT_MS`). While true the outcome is `waiting`, and the result carries `awaitingContinuation`. - `terminal-response-work.ts`: such a request is not parked, so the sweep reads it again on later passes. - `chat-github-response-comments.ts`: `failRun` defers with a conflict while the continuation is awaited; once a newer run exists it is refused as before and the sweep settles the request. ## Verification - New test `waits for the automatic continuation of a failed GitHub request run` (recent): fails on master (the thread says "stopped"), passes here: `failRun` defers, the sweep keeps "Working on this…", then the continuation and a newer response settle it with the link. Second case (failure 31 minutes old) still settles "stopped". - Updated `reconciles a GitHub working comment when execution stops without a publication` to a failure older than the wait window, which is what it tests. - GitHub chat integration suites (response maintenance, finding threads, workflow, retry and recovery, publications): 140 passed. Server typecheck is clean. ## Risks - A failed run's thread now shows "Working on this…" for up to 30 minutes while a continuation is expected, instead of "stopped" at once. - Waiting requests are re-read on each sweep pass (bounded by the 30-minute window). ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, 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 - [ ] 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> |
||
|
|
c49e80da6c |
fix(voice): exclude voice transport from tool health sweep and clarify Speko callback opt-in (#23116)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Speko voice connections create a channel-scoped tool connection with `transport: "voice"` so the assigned agent can call the responsible person through `call_my_phone`. > - The background tool-connection health sweep excluded `chat_sdk` and `runtime_auth` transports, but omitted `voice`. > - Every 15 minutes, the sweep called `checkConnectionHealth` on active Speko connections, hit `unsupportedToolConnectionTransport()`, and overwrote their health state to `error`. > - In addition, when `call_my_phone` was not present in an agent's tools for a task, the Speko skill did not explain how to help the user check Call my phone opt-in, tool access, or task eligibility. > - This pull request replaces the duplicated negative transport filters with a single positive `HEALTH_SWEEP_TRANSPORTS` allowlist, repairs already-corrupted active Speko voice connections in bounded atomic batches (while preserving real errors), handles `transport: "voice"` safely in manual `checkConnectionHealth`, and updates the Speko skill guidance. > - The benefit is that active Speko voice connections self-heal and stay healthy instead of degrading into false errors every 15 minutes, and agents give accurate troubleshooting guidance when `call_my_phone` is absent. ## Linked Issues or Issue Description Refs #23052 **Describe the bug** Active Speko voice connections (`transport: "voice"`) are picked up by the scheduled tool-connection health sweep after 15 minutes and marked `healthStatus: "error"` with `"This connection has no supported tool integration. Add a supported account or MCP connection from Connectors."`. **Steps to reproduce** 1. Connect and activate a Speko voice endpoint. 2. Wait 15 minutes for the scheduled tool-connection health sweep (or call `sweepConnectionHealth({ staleAfterMs: 0 })` / `scheduledHealth.load(companyId)`). 3. Inspect the Speko `tool_connections` row. **Expected behavior** Voice channel connections (`transport: "voice"`) are excluded from the generic tool-connection health sweep via a shared positive transport allowlist, previously corrupted active Speko voice rows self-heal without clearing real errors, and manual health checks do not overwrite them to `error`. ## What Changed - Export `UNSUPPORTED_TOOL_CONNECTION_TRANSPORT_MESSAGE` from `server/src/services/tool-access/catalog/failures.ts`. - Export `HEALTH_SWEEP_TRANSPORTS`, `healthSweepConnectionWhere()`, and `repairUnsupportedVoiceConnectionHealth()` in `server/src/services/tool-access/catalog/health.ts`; use the shared allowlist in both `sweepConnectionHealth` and `connectionHealthSchedule.load`. - Repair active Speko voice connections previously marked with `UNSUPPORTED_TOOL_CONNECTION_TRANSPORT_MESSAGE` (only when the paired active Speko endpoint has `last_error IS NULL`), registering health/chat notifications before the batch update, running once per `connectionHealthSchedule` instance, and handling `transport: "voice"` safely in `checkConnectionHealth`. - Update `server/src/services/voice/speko-skill.ts` so agents check task eligibility, tool access, and the `Call my phone` (`Allow this agent to call me about my tasks`) setting when `call_my_phone` is absent. - Add red-green regression tests in `server/src/__tests__/tool-access-service.test.ts` (including `scheduledHealth.load`, `sweepConnectionHealth`, `checkHealth`, multi-batch repair, and real-error preservation) and `server/src/__tests__/voice-session-store.integration.test.ts`. ## Verification - `pnpm --filter @paperclipai/server exec vitest run -t "sweeps enabled active connection health|repairs active Speko voice connections|delivers Speko guidance to existing agents" src/__tests__/tool-access-service.test.ts src/__tests__/voice-session-store.integration.test.ts` (3 passed) - `pnpm --filter @paperclipai/server typecheck` (passed, 0 errors across `below`, `cycle`, `above`, `tests`, `test-tree-0`, `test-tree-1`, `test-tree-2`) ## Risks - Low risk: excludes non-tool transports from the generic MCP/REST health sweep via an explicit allowlist of the four supported transports (`mcp_remote`, `rest_api`, `local_stdio`, `plugin`), repairs only rows matching the exact unsupported-transport error message on active Speko endpoints with `last_error IS NULL`, and refines one sentence of Speko skill text. No schema migrations or breaking API changes. ## Model Used - Google Gemini (Antigravity agentic coding assistant with extended reasoning, tool use, and local command execution) ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1127.0-canary.869500 nightly/v2026.1128.0-nightly.0 |
||
|
|
f78a6f5ae3 |
fix(github): a run that ends without its own reply links the latest response (#23111)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Each GitHub request to a review bot gets a comment that must end in a real reply or an honest, useful notice > - #22798 made the terminal sweep link the latest response on the same pull request when a request's own run did not reply > - A second path settles the same comments: when a run finishes without a GitHub reply, the publication transport calls `failRun` with a fixed notice > - That path never looked for a newer response, so a thread could say "ended without publishing" while the PR already showed a fresh review > - This pull request gives `failRun` the same latest-response link > - The benefit is that both settle paths agree, and readers are pointed at the review instead of a dead-end notice ## Linked Issues or Issue Description Refs #22798, #22672 **Describe the bug** On a pull request the author replied "Fixed in …" on a review bot's inline finding. The bot re-reviewed and updated the PR's main review comment to 5/5, then a second run said no new review was needed. The inline thread settled to "This turn ended without publishing a final response. See the Paperclip task for details." instead of linking the updated review. **Steps to reproduce** 1. An inline request is answered by a run that publishes nothing on GitHub. 2. A response for the same task and PR was published after the request arrived. 3. The publication transport settles the run through `failRun` with the fixed notice. **Expected behavior** The thread says "See the latest response" with a link to it. ## What Changed - `server/src/services/chat-github-response-comments.ts`: for each request of the run, `failRun` looks up the latest response published for the task on the same pull request or issue since the request arrived (`githubLatestTaskResponseUrl`, scoped by base thread) and links it; otherwise it keeps the given notice. - New test in `github-review-response-maintenance.integration.test.ts`: an inline request whose run ends without a reply, with a newer assessment on the same PR, settles with the link. ## Verification - New test fails on master ("ended without publishing") and passes here. - `github-review-response-maintenance`, `github-review-workflow`, `github-retry-and-recovery` integration suites and the response-comment unit tests: 99 passed. Server typecheck is clean. ## Risks - One indexed lookup per request when a run settles without a reply; it reuses the same query and index as the terminal sweep. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, 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 - [ ] 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> |
||
|
|
99203b9f95 |
fix(ui): add mobile contextual navigation, drawer escape, and shell nav polish (#23047)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - The board UI uses contextual sidebars in `Layout` to switch sections
on Agent Detail, App Detail, Chat Endpoint Detail, Apps developer tools,
Agent Chat, and Company Settings pages.
> - On mobile viewports (`< 768px`), `Layout` hides the adjacent
secondary sidebar without rendering an inline section switcher for most
contextual routes, traps the mobile drawer inside the contextual sidebar
without a Workspace back path, leaks a half-masked `MobileBottomNav`
beside the open drawer, overlaps the `MobileBottomNav` unread badge over
the icon center, and misaligns the `PageTabBar` native `<select>`
chevron while dropping readable text from JSX tab labels.
> - Operators on mobile cannot reach agent configuration views
(`Identity`, `Harness / Runtime`, `Secrets & variables`, `Permissions /
Trust`, `Advanced`, `Activity`, `Runs`, `Costs`, `Budgets`, and plugin
`detailTab` slots) or leave contextual drawers cleanly.
> - This pull request adds inline mobile section switchers for all
contextual-sidebar routes, adds a non-trapping `Workspace | <Section>`
switcher to the mobile drawer, fixes `MobileBottomNav` badge alignment
and drawer z-index layering, adds `companySettingsPluginSlots` support
to `CompanySettingsNav`, and fixes `PageTabBar` mobile `<select>`
chevron alignment and JSX `<option>` text extraction.
> - The benefit is full mobile navigation parity across agent
configuration and contextual shell surfaces without breaking desktop
layouts.
## Linked Issues or Issue Description
**What happened?**
On mobile viewports (`< 768px`), opening an Agent Detail page
(`/agents/:agentId/overview`) showed no on-page tabs for the 10 built-in
views or plugin `detailTab` slots, and opening the mobile sidebar drawer
replaced global Workspace navigation with only the agent links and no
back link. The same inline-nav gap affected `AppDetail`,
`ChatEndpointDetail`, `AppsSidebar`, and `AgentChat`. In addition,
`CompanySettingsNav` omitted `companySettingsPluginSlots`, `PageTabBar`
stretched its mobile `<select>` wrapper inside `<Tabs>` so the
`<ChevronDown>` icon floated on the far right while falling back to raw
values for JSX labels, and `MobileBottomNav` overlapped two-digit unread
badges over the Inbox icon while peeking out beside the open mobile
drawer.
**Expected behavior**
Mobile operators see an accessible inline section switcher on Agent
Detail (all 10 built-in views plus plugin `detailTab` slots),
`AppDetail`, `ChatEndpointDetail`, `AppsSidebar`, and `AgentChat`.
Opening the mobile drawer always provides immediate access to global
Workspace navigation and cleanly layers above `MobileBottomNav`.
`CompanySettingsNav` aligns with `CompanySettingsSidebar` including
plugin settings slots and `/company/export`. `PageTabBar` aligns its
chevron inside the `<select>` box and renders readable plain text from
JSX tab labels. `MobileBottomNav` places unread counts cleanly at the
top-right corner of the icon.
**Steps to reproduce**
1. Resize the board UI to a mobile viewport (`390x844`, `< 768px`).
2. Open an Agent Detail page (`/agents/:agentId/overview`), an App
Detail page, a Chat Endpoint Detail page, an Agent Chat page, and
Company Settings.
3. Observe missing inline section controls on contextual routes, the
trapped mobile drawer, the misaligned `PageTabBar` chevron, and the
overlapping `MobileBottomNav` unread badge and open-drawer layering.
**Paperclip version or commit**
`85ad16b47e` (`master`)
**Deployment mode**
Local dev (`pnpm dev`) / Storybook responsive verification
## What Changed
- Added reusable token-backed `MobileContextualNav`
(`ui/src/components/MobileContextualNav.tsx`) with horizontal scroll,
group dividers, active pill auto-scroll, and optional danger/secondary
badges.
- Added `AgentContextualMobileNav`
(`ui/src/components/AgentContextualSidebar.tsx`), `AppDetailMobileNav`
(`ui/src/components/AppConnectionSidebar.tsx`), `ChatDetailMobileNav`
(`ui/src/components/chat/ChatDetailSidebar.tsx`), `AppsMobileNav`
(`ui/src/components/AppsSidebar.tsx`), and `mobileSwitcher` mode on
`AgentConversationsSidebar` / `AgentConversationSidebar` so all
contextual-sidebar routes render inline mobile navigation below
`BreadcrumbBar` in `Layout.tsx`.
- Updated `Layout.tsx` mobile drawer to never trap users: routes with
inline mobile nav default the drawer to global `<Sidebar>`, all
contextual routes expose a `Workspace | <Section>` switcher (with `←
Workspace` when viewing the contextual pane), and the drawer backdrop
(`z-40`) and drawer (`z-50`, `inert` when closed) mount at shell root
after `MobileBottomNav` (`z-30`, `visible={mobileNavVisible &&
!sidebarOpen}`).
- Updated `MobileBottomNav.tsx` badge positioning (`-top-1.5 left-3
min-w-4`) so two-digit (`96`) and `99+` badges anchor to the top-right
edge and expand outward without covering the icon center.
- Updated `CompanySettingsNav.tsx` to match `CompanySettingsSidebar.tsx`
ordering and routes (including `/company/export`) and to render and
match `companySettingsPluginSlots`.
- Updated `PageTabBar.tsx` mobile `<select>` wrapper (`w-fit max-w-full
self-start` + `w-full appearance-none bg-none`) to eliminate stray
far-right and duplicate chevrons, and added `extractTabOptionText` to
extract readable text from JSX `item.label` nodes.
- Removed unused `PageTabBar` and `Tabs` imports in
`ui/src/pages/AgentDetail.tsx` and added `flex-wrap` to the left-agent
membership notice banner.
- Added responsive mobile Storybook views (`AgentOverviewMobile`,
`AgentRuntimeMobile` in `agent-persona-pages.stories.tsx`;
`MobileSettingsAndBottomNav`, `MobileAgentDrawerOpen` in
`navigation-layout.stories.tsx`) and 5 new Vitest unit/component suites.
## Verification
- Targeted Vitest (`pnpm --filter @paperclipai/ui exec vitest run
src/components/PageTabBar.test.tsx
src/components/access/CompanySettingsNav.test.tsx
src/components/MobileBottomNav.test.tsx
src/components/MobileContextualNav.test.tsx
src/components/Layout.mobile.test.tsx src/lib/shell-navigation.test.ts
src/pages/agent-detail-navigation.test.ts
src/pages/apps/apps-rail.test.ts src/context/SidebarContext.test.tsx
src/lib/mobile-nav-scroll.test.ts
src/components/contextual-sidebar-styles.test.ts`): 11/11 files, 38/38
tests passed.
- Replay masking check (`pnpm --filter @paperclipai/ui exec vitest run
src/lib/analytics/replay-masking.test.tsx`): 220/220 tests passed.
- Typecheck (`pnpm --filter @paperclipai/ui typecheck`): passed with 0
errors.
- Design token gates (`pnpm check:token-gates`): all 4 gates CLEAN and
cliplab character in sync.
- Storybook catalog and map checks (`node scripts/storybook-catalog.mjs
--check && node --test scripts/check-maps.test.mjs
scripts/storybook-catalog.test.mjs
scripts/storybook-feature-index.test.mjs`): passed (372 files, 3490
stories; 30/30 tests passed).
## Risks
- Low risk: desktop layouts (`isMobile === false`) and desktop
sidebar/rail behavior remain unchanged.
- On mobile, hiding `MobileBottomNav` while `sidebarOpen` is true uses
the existing `data-visible="false"` + `inert` transition while
preserving `--tc-composer-bottom` so background page content does not
shift when opening or closing the drawer.
## Model Used
- Model Used: Gemini 4 Neon (High) — agentic coding assistant with
reasoning, code editing, shell execution, and local test verification.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
canary/v2026.1127.0-canary.869300
|
||
|
|
26c72ed7ca |
fix(ui): polish mobile tables, popovers, PageTabBar callers, and settings (#23048)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Operators use the board UI on mobile viewports (`390x844`) to inspect routines, members, costs, projects, dashboards, skills, and settings > - Wide tables overflowed the page horizontally, several `PageTabBar` callers omitted `value`/`onValueChange` (breaking their mobile section dropdowns), `w-96` popovers and floating save bars clipped or overlapped the bottom nav, and key controls were hover-only or cramped on narrow screens > - Mobile operators could not scroll clipped columns, switch sections, switch diff files, or tap hidden row actions on phones > - This pull request constrains table scrollers and flex/grid ancestors, wires all missing `PageTabBar` mobile callbacks, caps wide popovers and floating save bars using existing viewport tokens, polishes narrow layouts across collections and settings, and adds 390×844 Storybook views and Vitest regressions > - The benefit is clean mobile layout without horizontal page overflow and working touch controls across tables, tabs, popovers, dashboards, and settings ## Linked Issues or Issue Description Related mobile responsiveness PRs: #23045, #23046, #23047. **What happened?** On mobile viewports (`< 768px`, tested at `390x844`): - Wide tables in Routines, Members, Costs, Connections, and tool profile views caused horizontal page overflow or permanently clipped columns (`overflow-hidden`). - `AuditHub`, `Costs` (Providers/Billers), `Approvals`, `Inbox`, and `LegacyInbox` omitted `value` and/or `onValueChange` on `PageTabBar`, bypassing its mobile `<select>` section switcher. - `w-96` popovers in `RoutinePage` and `WorkspaceServiceControlBar` overflowed narrow viewports; the `CompanySkills` diff dialog hid its file picker on `< md` and its floating save bar overlapped `MobileBottomNav`. - `ProjectDetail` task toolbars crushed the search field on `< sm`, `Dashboard` charts rendered 2 cramped columns with uneven metric card heights, `Agents` hid row `Chat` buttons on touch devices, and `Inbox` hid nesting controls on `< sm`. **Expected behavior** Every collection, table, popover, dashboard, and settings screen stays within the mobile viewport (`scrollWidth <= innerWidth`), wide tables scroll horizontally inside their containers, mobile `PageTabBar` dropdowns switch sections cleanly, and touch users can reach all row actions, diff files, and nesting controls. **Steps to reproduce** 1. Open the board UI at `390x844` (or the added Storybook `*Mobile` stories). 2. Navigate to Routines, Settings → Members, Settings → Profile, Audit → Costs, Approvals, Project Detail, Dashboard, and Company Skills diff view. 3. Observe horizontal overflow, missing mobile tab switchers, hidden diff file picker, and cramped toolbars/charts prior to this change. **Paperclip version or commit** `85ad16b47e` (`master`) **Deployment mode** Local dev (pnpm dev) ## What Changed - **Horizontal table scroll containment & ancestor constraints**: - Wrapped and constrained tables plus flex/grid ancestors (`overflow-x-auto max-w-full`, `min-w-0`) in `RoutineTable.tsx`, `Routines.tsx`, `CompanyAccess.tsx`, `CostByUserTable.tsx`, `Costs.tsx`, `ProfileSettings.tsx`, `Connections.tsx`, `AgentToolsTab.tsx`, `RoutineHistoryTab.tsx`, `RoutineVariablesEditor.tsx`, `ProfilesTab.tsx`, `ProfileDetail.tsx`, `ProfilesIndex.tsx`, and `SmokeLabTab.tsx`. - Fixed `ProfileSettings.tsx` avatar upload `<label>` sizing (`inline-block w-fit`) so the camera badge stays anchored to the avatar circle. - **Wired missing `PageTabBar` mobile callbacks**: - Passed `value` and `onValueChange` to `PageTabBar` in `AuditHub.tsx`, `Costs.tsx` (Providers and Billers), `Approvals.tsx`, `Inbox.tsx`, and `LegacyInbox.tsx`. - **Popovers & floating bars**: - Capped `w-96` popovers in `RoutinePage.tsx` and `WorkspaceServiceControlBar.tsx` with `max-w-(--sz-calc-4)` and wrapping footer rows. - Added a mobile file `<select>` (`md:hidden`) in the `CompanySkills.tsx` version diff dialog and lifted its floating save bar above `MobileBottomNav` (`bottom-20 md:bottom-6 max-w-(--sz-calc-4) flex-wrap`). - **Touch visibility & responsive layout polish**: - Switched `ProjectDetail.tsx` task lists to `toolbarPresentation="collection"` so the toolbar wraps cleanly on `< sm`, and added `flex-wrap` to its left-membership notice banner. - Made the `Agents.tsx` inline row `Chat` button touch-visible via `pointer-coarse:opacity-100`. - Exposed mobile parent-child nesting toggle and row expand chevrons in `Inbox.tsx` and `LegacyInbox.tsx`. - Stacked `Dashboard.tsx` chart cards to `grid-cols-1 sm:grid-cols-2` and aligned the 2×2 summary metric cards with `auto-rows-fr items-stretch`. - Added responsive wrapping and width caps in `CompanySettings.tsx`, `Secrets.tsx`, `SkillStudio.tsx`, `GrokBotSetupContent.tsx`, and `ActionTestDialog.tsx`. - **Storybook & Vitest coverage**: - Added 390×844 mobile Storybook views for Routines (`RoutinesListMobile`, `RoutineDetailMobile`), Members (`MembersMobile`), Costs (`CostsMobile`), ProjectDetail (`ProjectDetailMobile`), CompanySettings (`CompanySettingsMobile`), and Dashboard (`DashboardMobile`). - Added `ui/src/pages/mobile-collections-responsive.test.tsx`. ## Verification - `pnpm exec vitest run ui/src/pages/mobile-collections-responsive.test.tsx ui/src/pages/CompanyAccess.test.tsx ui/src/pages/Dashboard.test.ts` — 3 files, 35/35 passed - `pnpm --filter @paperclipai/ui typecheck` — passed (0 errors) - `pnpm check:token-gates` — all 4 gates CLEAN + cliplab character in sync - `node scripts/storybook-catalog.mjs --check` — passed (373 files, 3494 stories) - `node --test scripts/check-maps.test.mjs scripts/storybook-catalog.test.mjs scripts/storybook-feature-index.test.mjs` — 30/30 passed ## Risks - Low risk: layout-only responsive class updates, missing prop wiring on `PageTabBar` callers, and additive mobile Storybook stories/tests. Desktop breakpoints (`sm:` / `md:` / `lg:` / `xl:`) preserve existing layouts. - Several edited pages (`CompanySkills.tsx`, `Inbox.tsx`, `LegacyInbox.tsx`, `Secrets.tsx`, `SkillStudio.tsx`, `Costs.tsx`, `ProfilesTab.tsx`, `RoutineHistoryTab.tsx`, `ActionTestDialog.tsx`) were already over 1,000 lines on `master`; this PR keeps edits minimal and localized without introducing new subsystems into those files. ## Model Used - Google Gemini 4 Neon (High) via Antigravity (tool use, code execution, multi-agent code review) ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
74f26f3b49 |
fix(ui): mobile parity for task detail, chat, goals, cases, and coordinator inbox (#23046)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Operators review tasks, agent conversations, goals, cases, and coordinator inbox decisions from both desktop and mobile viewports. > - On mobile viewports (`< 768px`), several core detail surfaces hide or disable controls that only mount in desktop sidebars: streamlined Task Detail hides both the Properties drawer trigger and the More task actions menu; Agent Chat's top-right Show properties toggle toggles a desktop-only panel; Goal Detail hides its Properties panel with no mobile drawer; Coordinator Inbox disables artifact and approval inspection; BreadcrumbBar crushes current page titles behind unshrinking ancestors; Case Detail clips long unbroken IDs; wide Markdown tables and rigid 4-column media grids overflow narrow screens. > - Mobile operators need full access to task properties, task actions, goal metadata, and decision artifacts without switching to a desktop browser or fighting horizontal page overflow. > - This pull request restores mobile sheet triggers and action menus across Task Detail, Agent Chat, Goal Detail, and Coordinator Inbox, fixes mobile breadcrumb priority and properties toggle visibility, wraps long Case Detail titles, contains wide Markdown tables inside scrollable bubble regions, updates rigid 4-column media grids to 2-to-4 responsive grids, and adds unit tests plus 390×844 Storybook mobile views. > - The benefit is complete mobile parity on Paperclip's core detail and inbox workflows with zero horizontal overflow and no regressions on desktop layouts. ## Linked Issues or Issue Description **What happened?** On viewports narrower than `768px` (such as `390×844` mobile): - Streamlined Task Detail hides both the mobile `Properties` sheet button (gated behind `!streamlinedTaskDetailEnabled`) and the `More task actions` (`...`) menu (nested inside `hidden md:flex`), making Properties, Plan, Artifacts, Subtasks, Copy, Archive, Privacy, and subtree Pause/Resume/Cancel controls unreachable. - On Agent Chat and mobile Task Detail routes, the top-right `Show properties` toggle calls `toggleTaskSidePanel`, which only toggles desktop-only `panelVisible` (`PropertiesPanel` is `hidden md:flex`) instead of opening the mobile `Sheet`. - `BreadcrumbBar` suppresses `propertiesToggle` on mobile task trails and gives ancestor segments `shrink-0`, crushing the final page label to one letter. - `GoalDetail` hides its Properties toggle (`hidden md:inline-flex`) and only writes to the desktop `PropertiesPanel`, leaving `<GoalProperties />` unreachable on mobile. - `CaseDetail` renders `<h1>` without `break-words` / `wrap-anywhere` or `min-w-0`, causing unbroken identifiers to overflow past `390px`. - `CoordinatorNeedsYou` sets `artifact = null`, disables mentioned-link interception, and sets `onViewDetails = undefined` on mobile, blocking inspection of approval details and decision artifacts. - Wide Markdown tables inside `TaskChatBubble` lack flex `min-w-0` containment and explicit `max-w-full overflow-x-auto` utility classes on the table scroll wrapper, and media grids in `IssueOutputSection`, `IssueAttachmentsSection`, and `TaskChatBubble` use rigid `grid-cols-4` on mobile. **Expected behavior** - Mobile users can open the `TaskSidePanel` `Sheet` from both the streamlined Task Detail header and the `BreadcrumbBar` top-right toggle (on both `/issues/:id` and `/chats/:agentRef`), and can open the `More task actions` (`...`) menu. - Mobile breadcrumbs keep the current page title legible by collapsing >2 leading segments and shrinking ancestor segments before the current crumb. - Mobile `GoalDetail` provides a `Properties` button that opens `<GoalProperties />` in a bottom `Sheet`. - Mobile `CaseDetail` wraps unbroken identifiers cleanly within the viewport. - Mobile `CoordinatorNeedsYou` opens approval details, artifact rows, and mentioned documents in a responsive bottom `Sheet` backed by `<CoordinatorReviewPanel />`. - Wide Markdown tables scroll horizontally within their bubble container without expanding page width, and media grids adapt from 2 columns on mobile to 4 columns on `sm+`. **Steps to reproduce** 1. Open Paperclip UI at a `390×844` viewport. 2. Visit a streamlined task detail page, an agent chat page, a goal detail page, a case detail page with a long unbroken token in its title, and the Coordinator Inbox (`/decisions`). 3. Attempt to open Properties, More task actions, Goal Properties, or an approval/plan artifact review panel, and inspect breadcrumb truncation and table overflow. **Paperclip version or commit** Reproduced on `origin/master` (`85ad16b47e`). ## What Changed - **`ui/src/pages/IssueDetail.tsx`**: Wired `toggleTaskSidePanel` and `breadcrumbPanelControl.open` to `mobilePropsOpen` when `isMobile` is true (including on `/chats/:agentRef`); moved `More task actions` (`...`) out of `hidden md:flex` so it stays reachable on mobile; added a mobile-only `Properties` button to streamlined Task Detail headers. *(Note on file size rule: `IssueDetail.tsx` already exceeded 1,000 lines; this PR adds only +36 net lines directly in the existing header and panel toggle hooks to avoid unnecessary churn.)* - **`ui/src/components/BreadcrumbBar.tsx`**: Rendered `propertiesToggle` on mobile task and chat trails whenever `showPropertiesToggle` or `breadcrumbPanelControl` is present; collapsed >2-segment mobile trails to parent + current and shrunk ancestor segments (`max-w-28`, `max-w-24` for task parents) while giving the final crumb `flex-1 min-w-0`. - **`ui/src/pages/GoalDetail.tsx`**: Added a mobile-only `Properties` trigger button and bottom `<Sheet>` rendering `<GoalProperties />`. - **`ui/src/pages/CaseDetail.tsx`**: Added `min-w-0`, `break-words`, and `wrap-anywhere` to the page container, header, and `<h1>` title. - **`ui/src/components/coordinator/CoordinatorNeedsYou.tsx`**: Removed mobile disables on `needsYouArtifact`, mentioned document clicks, and approval `onViewDetails`; guarded desktop `panelVisible` close sync with `!isMobile`; added a bottom `<Sheet>` rendering `<CoordinatorReviewPanel />` (with multi-tab switching when multiple artifacts are open). - **`ui/src/components/MarkdownBody.tsx` & `ui/src/components/task-chat/TaskChatBubble.tsx`**: Added `max-w-full overflow-x-auto` to the Markdown table scroll wrapper and `min-w-0 max-w-full` flex containment on chat bubbles. - **`ui/src/components/issue-output/IssueOutputSection.tsx`, `ui/src/components/IssueAttachmentsSection.tsx`, `ui/src/components/task-chat/TaskChatBubble.tsx`**: Updated rigid `grid-cols-4` media grids to `grid-cols-2 sm:grid-cols-4`. - **Storybook & Tests**: Added/updated 390×844 mobile Storybook exports (`TaskDetailMobile`, `AgentChatMobile`, `GoalDetailMobile`, `CaseDetailMobile`, `CoordinatorInboxMobile`) and 7 Vitest suites covering every changed surface. ## Verification - Targeted Vitest (8 files, 94 tests pass): `pnpm --filter @paperclipai/ui exec vitest run src/components/MarkdownBody.test.tsx src/components/BreadcrumbBar.mobile.test.tsx src/pages/GoalDetail.mobile.test.tsx src/pages/CaseDetail.mobile.test.tsx src/components/coordinator/CoordinatorNeedsYou.mobile.test.tsx src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx src/components/task-chat/TaskChatBubble.mobile.test.tsx src/pages/IssueDetail.mobile.test.tsx` - Design token & sync gates (All 4 gates CLEAN + cliplab character in sync): `pnpm check:token-gates` - TypeScript build & typecheck (0 errors): `pnpm --filter @paperclipai/ui typecheck` - Storybook catalog & map checks (372 files, 3490 stories; 30/30 catalog & map tests pass): `node scripts/storybook-catalog.mjs --check && node --test scripts/check-maps.test.mjs scripts/storybook-catalog.test.mjs scripts/storybook-feature-index.test.mjs` - Revision verified: `20c7e91bdad95b4679cd1707e6881a3f414f71a4` on local macOS worktree. Full repo CI suite and visual browser checks will run in GitHub Actions. ## Risks - Low risk: all new drawer/sheet paths and breadcrumb collapsing are strictly gated to mobile (`isMobile` / `md:hidden`), preserving existing desktop layouts and behaviors. - Mobile `CoordinatorNeedsYou` review sheets intentionally bypass desktop `PropertiesPanel` so desktop `panelVisible === false` does not auto-dismiss the mobile sheet; desktop panel behavior is unchanged. ## Model Used - **Provider & Model**: Google Gemini — Gemini 4 Neon (High) - **Capabilities**: Extended reasoning/thinking, tool use, local code execution, and automated test verification. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge |
||
|
|
ffd8dcb4af |
fix(ui): clear mobile bottom nav on overlays and wrap mobile toolbars (#23045)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The board UI renders a fixed mobile bottom navigation bar (`MobileBottomNav`, height `4rem` plus safe-area inset) and shared collection toolbars on narrow viewports below `48rem`. > - On mobile viewports (375px–390px), multi-control toolbars clip actions off-screen, hidden org-chart controls reserve invisible width in agent list view, and fixed or sticky footers and floating overlays either hide behind `MobileBottomNav`, overlap it, or overflow the right edge. > - Operators on mobile cannot reach save, discard, retry, wizard navigation, or toolbar filter controls when those surfaces collide with the bottom navigation bar or clip off-screen. > - This pull request adds shared mobile bottom-nav clearance tokens and responsive rules in `ui/src/index.css`, lifts fixed/sticky footers and floating overlays above `MobileBottomNav` on `< md` while constraining horizontal fit at 375px+, wraps `.design-toolbar-actions` and collapses hidden org-chart controls below `48rem`, and adds unit tests and mobile Storybook stories. > - The benefit is that every mobile toolbar, save bar, wizard footer, bulk selection bar, toast, retry alert, and voice call panel stays fully visible, reachable, and within the viewport width without changing desktop layouts. ## Linked Issues or Issue Description **What happened?** On viewports narrower than `48rem` (such as 375px–390px mobile screens): - `.design-toolbar-actions` did not wrap on mobile, pushing trailing controls (such as Group by and View dropdowns in Coordinator Inbox) off-screen into `overflow-x-clip`. - `.agents-org-controls-reveal` reserved invisible `width: max-content` space next to `New Agent` in mobile list view. - `AgentAdvancedTab` (`sticky bottom-0 z-10`) and `ProfileWizard` (`fixed inset-x-0 bottom-0 z-10`) footers sat behind `MobileBottomNav` (`z-30`, `h-16`). - `.agent-config-save-bar` (`bottom: 0; z-index: 40`) covered `MobileBottomNav`, and `.agent-selection-bar` (`--selection-bar-bottom: 48px`) overlapped its top 16px. - `ToastViewport` (`bottom-3 left-3 w-full max-w-sm`) overlapped `MobileBottomNav` and overflowed the right edge by 12px at 375px. - `IssueRowDetailsNotice` and `VoiceCallProvider` sat at `bottom-4` on top of `MobileBottomNav` and lacked mobile horizontal containment / viewport-safe max-height. **Expected behavior** - Multi-control toolbars wrap cleanly inside the mobile viewport, and hidden org-chart controls occupy zero space in mobile list view. - Fixed and sticky footers (`AgentConfigSaveBar`, `AgentAdvancedTab`, `ProfileWizard`) and floating overlays (`.agent-selection-bar`, `ToastViewport`, `IssueRowDetailsNotice`, `VoiceCallProvider`) clear `MobileBottomNav` on `< md` viewports and stay within 375px–390px horizontal bounds. - Desktop (`>= 48rem`) layout and positioning remain unchanged. **Steps to reproduce** 1. Open the Paperclip board UI at a `390x844` or `375x812` mobile viewport. 2. Open Coordinator Inbox or Agents list view and inspect `.design-toolbar-actions` and `.agents-org-controls-reveal`. 3. Open Agent settings (Identity/Runtime/Advanced), Tool Profile Wizard, Agent bulk selection, or trigger a toast, row-details retry alert, or active voice call panel while `MobileBottomNav` is visible. **Paperclip version or commit** `85ad16b47e` (`master`) ## What Changed - **`ui/src/index.css`**: - Added `--mobile-nav-overlay-bottom` (`calc(4rem + var(--spacing) * 3 + var(--sz-safe-bottom))`) and `--mobile-nav-overlay-max-h` tokens for floating overlays mounted outside `<main>`. - Added `@media (width < 48rem)` rules to wrap `.design-toolbar-actions` (`flex-wrap: wrap; min-width: 0; max-width: 100%`), expand `[data-canonical-toolbar="inbox"] [data-toolbar-search]` to `width: 100%`, and collapse hidden `.agents-org-controls-reveal:not([data-visible="true"])` (`display: none`). - Lifted `.agent-selection-bar` (`--selection-bar-bottom: calc(4rem + var(--spacing) * 3)`) and `.agent-config-save-bar` (`bottom: var(--tc-composer-bottom)`, `z-index: var(--z-20)`, mobile padding, full slide-out transform when hidden, and matching `.agent-settings-with-save-bar` bottom clearance) below `48rem` while preserving cascade and `prefers-reduced-motion: reduce` ordering. - **`ui/src/pages/AgentAdvancedTab.tsx`**: Updated the sticky save footer to use `mobile-nav-composer`, `bottom-(--tc-composer-bottom)`, `z-20`, `flex-wrap`, and `md:bottom-0`. - **`ui/src/pages/tools/profiles/ProfileWizard.tsx`**: Updated the fixed wizard footer to use `mobile-nav-composer`, `bottom-(--tc-composer-bottom)`, `z-20`, `md:bottom-0`, and `flex-wrap`, and increased mobile container bottom padding (`pb-36 md:pb-24`). - **`ui/src/components/ToastViewport.tsx`**: Lifted toasts with `bottom-(--mobile-nav-overlay-bottom) md:bottom-3` and replaced `left-3 w-full` with `inset-x-3 sm:inset-x-auto sm:left-3 sm:w-full` to eliminate 375px right-edge overflow. - **`ui/src/components/IssueRowDetailsNotice.tsx`**: Lifted above `MobileBottomNav` with `bottom-(--mobile-nav-overlay-bottom) md:bottom-4` and bounded mobile width with `inset-x-4 flex-wrap sm:left-auto sm:right-4 sm:max-w-sm sm:flex-nowrap`. - **`ui/src/components/voice/VoiceCallProvider.tsx`**: Lifted the active voice panel with `bottom-(--mobile-nav-overlay-bottom) max-h-(--mobile-nav-overlay-max-h) md:bottom-4 md:max-h-(--sz-calc-18)`. - **Tests & Storybook**: Added `ui/src/index.mobile-overlays.test.ts`, `ui/src/components/IssueRowDetailsNotice.test.tsx`, `ui/src/components/voice/VoiceCallProvider.test.tsx`, `ui/src/pages/AgentAdvancedTab.test.tsx`, `ui/src/pages/tools/profiles/ProfileWizard.test.tsx`, expanded `ui/src/components/ToastViewport.test.tsx`, and added catalog-compliant mobile stories in `ui/storybook/stories/navigation-preferences/mobile-overlays-clearance.stories.tsx`. ## Verification - `pnpm --filter @paperclipai/ui exec vitest run src/components/ToastViewport.test.tsx src/components/IssueRowDetailsNotice.test.tsx src/components/voice/VoiceCallProvider.test.tsx src/pages/AgentAdvancedTab.test.tsx src/pages/tools/profiles/ProfileWizard.test.tsx src/index.mobile-overlays.test.ts` — 6 test files passed, 14/14 tests passed. - `pnpm --filter @paperclipai/ui exec vitest run src/lib/analytics/replay-masking.test.tsx` — 220/220 tests passed. - `pnpm --filter @paperclipai/ui typecheck` — passed with 0 errors. - `pnpm check:token-gates` — all 4 token gates clean and `cliplab character in sync`. - `node scripts/storybook-catalog.mjs --check` — passed (373 files, 3491 stories). - `node --test scripts/check-maps.test.mjs scripts/storybook-catalog.test.mjs scripts/storybook-feature-index.test.mjs` — 30/30 tests passed. - Full-repo Vitest and browser E2E suites were not run locally; CI will run the required repository checks on this PR. ## Risks - Low risk. All positioning changes are scoped to `< md` / `< 48rem` viewports using existing CSS custom property conventions (`--tc-composer-bottom`, `--tc-composer-visible-nav-offset`, `--sz-safe-bottom`), leaving desktop (`>= 48rem`) layouts unchanged. - Floating overlays outside `<main>` (`ToastViewport`, `IssueRowDetailsNotice`, `VoiceCallProvider`, `.agent-selection-bar`) use the fixed `--mobile-nav-overlay-bottom` offset so they always clear `MobileBottomNav` even when rendered in `document.body` portals; when `MobileBottomNav` auto-hides on scroll, those overlays remain at the safe clearance height rather than tracking `<main>`'s scroll state. ## Model Used - Provider and model: Google Antigravity — Gemini 4 Neon (High) - Capabilities: tool use, code editing, local terminal/test execution ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge |
||
|
|
3fd66c0e12 |
fix(ui): surface local and hosted sign-in actions on the primary footer button (#23112)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Operators connect AI subscriptions (such as Google Antigravity, Claude, and Codex) through `AgentProviderConnection` and `OnboardingWizard`, which share `FooterNav` for the primary step button > - The remote sandbox login path (`AdapterLoginPanel`) updates the primary footer button to `Sign in to <Provider>`, `Retry sign-in`, or `Connecting`, but the local and hosted sign-in path (`useLocalAiLogin` + `LocalProviderLoginInstructions`) did not wire into `FooterNav` > - As a result, the primary footer button stayed disabled and labeled `Connect` both when sign-in failed/expired and when a sign-in URL was ready, forcing users to hunt for a small muted inline link (`Start sign-in again` or `Sign in to Antigravity`) > - This pull request maps `useLocalAiLogin` state onto the shared primary footer button in both `AgentProviderConnection` and `OnboardingWizard` and hides the redundant inline retry link on failed/expired states when the footer owns it > - The benefit is that the required next action is always the prominent, enabled primary button on every connect screen ## Linked Issues or Issue Description **What happened?** On the Connect Antigravity subscription screens (and other `useLocalAiLogin` subscription flows), the bottom-right primary button remained disabled and labeled `Connect` while the required action was a small muted link inside the card (`Start sign-in again` on failed/expired sign-in, or `Sign in to Antigravity` when the OAuth URL was ready). **Expected behavior** - When sign-in fails or expires, the primary footer button should be enabled and labeled `Start sign in`, and clicking it should restart the sign-in flow. - When the sign-in URL is ready, the primary footer button should be enabled and labeled `Sign in to Antigravity` (or the active provider name), and clicking it should open the authorization URL in a new tab. - Once sign-in succeeds, the primary footer button should switch back to an enabled `Connect` button. **Steps to reproduce** 1. Open the Antigravity app connection screen (`/apps/connect?source=antigravity`) in a hosted environment with subscription mode selected. 2. Observe the sign-in prompt state: the primary bottom-right `Connect` button is disabled while `Sign in to Antigravity` is only a small underlined link inside the card. 3. Let the sign-in fail or expire and observe the error state: the primary bottom-right `Connect` button stays disabled while `Start sign-in again` is only a small underlined link. ## What Changed - `ui/src/components/AdapterLoginChrome.tsx`: - Added `resolveLocalLoginPrimaryAction` to map `useLocalAiLogin` state (`preparing`, `error`/`expired`, `submitting`, `sign_in_required` with valid HTTP(S) `authorizationUrl`, and `ready`) to a typed primary CTA descriptor. - Added optional `primaryHandlesRetry` and `onSubmittingChange` props to `LocalProviderLoginInstructions` so hosts that surface `Start sign in` and `Connecting` on `FooterNav` hide the redundant inline error retry link while standalone callers keep existing behavior. - `ui/src/components/new-agent/AgentProviderConnection.tsx`: - Wired `resolveLocalLoginPrimaryAction` into `FooterNav` (`primaryLabel`, `primaryDisabled`, `primaryIcon`, `onPrimary`) so failed/expired states render an enabled `Start sign in` button, ready authorization URLs render an enabled `Sign in to <Provider>` button that opens the URL in a new tab, and submitting/preparing states show spinner feedback. - `ui/src/components/OnboardingWizard.tsx`: - Wired `resolveLocalLoginPrimaryAction` into `connectCta` and `handleConnectStepPrimary` for the matching `LocalProviderLoginInstructions` branch so onboarding has the same primary CTA behavior. - `ui/src/components/AdapterLoginChrome.test.tsx`, `ui/src/components/new-agent/AgentProviderConnection.test.tsx`, `ui/src/pages/apps/AppsConnect.test.tsx`: - Added unit and render tests covering `resolveLocalLoginPrimaryAction`, `primaryHandlesRetry`, enabled `Sign in to Antigravity` opening the authorization URL, enabled `Start sign in` restarting failed/expired sign-in without a redundant inline link, and returning to enabled `Connect` once ready. ## Verification - Ran `pnpm --filter @paperclipai/ui typecheck` — passed. - Ran `pnpm exec vitest run ui/src/components/AdapterLoginChrome.test.tsx ui/src/components/new-agent/AgentProviderConnection.test.tsx ui/src/pages/apps/AppsConnect.test.tsx ui/src/components/ai-connections/useLocalAiLogin.test.tsx` — 4 test files, 39 tests passed. ## Risks - Low risk: UI-only change scoped to the `useLocalAiLogin` branch of `AgentProviderConnection` and `OnboardingWizard`. Standalone `LocalProviderLoginInstructions` callers default to `primaryHandlesRetry = false`, and authorization URLs are validated as `http:` or `https:` before calling `window.open`. ## Model Used - Google Gemini (Antigravity agent with tool use, file editing, and shell execution). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1127.0-canary.868900 |
||
|
|
7d850ad65e |
fix(github): a superseded automatic review finishes instead of asking a person (#23064)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - GitHub review bots run automatic reviews for a specific pull request head > - When the head has moved on, the review tools refuse the stale review and explain why > - That explanation said "an authorized person can request a manual review", so an agent can read it as a blocker owned by a person > - On staging, a review task recovered for an already-merged PR did exactly that: it marked itself blocked and asked the PR author to request a review > - This pull request makes the refusal say the review is no longer needed and that the task should finish as done > - The benefit is that stale or merged-PR reviews close cleanly instead of waiting on a person ## Linked Issues or Issue Description Refs #23049 **Describe the bug** A review-bot task for a PR merged three days earlier was continued by the lost-wait recovery (#23049). Its automatic review targeted the PR's old head. The review tool refused with "no newer automatic review is queued for it. An authorized person can request a manual review", and the agent blocked the task, naming the PR author or a maintainer as owner. **Steps to reproduce** 1. An automatic review request targets head A of a pull request. 2. The pull request moves to head B (or is merged) with no newer automatic review queued. 3. The agent calls a review tool; the refusal tells it a person can request a manual review, and the agent blocks the task. **Expected behavior** The agent finishes the task as done; a merged or closed pull request needs no review, and nothing waits on a person. ## What Changed - `server/src/services/chat-github-reviews.ts`: `supersededAutomaticReview` receives the pull request. For a closed or merged PR the refusal says no review is needed; otherwise it says the review is no longer needed (or that a newer automatic review is queued). In every case it tells the agent to finish the task as done and not to block it or ask anyone to request a review. The error details add `pullRequestClosed`. - Test in `github-review-publications.integration.test.ts` for a closed and an open pull request whose head moved. ## Verification - New test (`tells a superseded automatic review to finish instead of waiting on a person`, closed and open): fails on master (the old message asks for a person), passes here. - `github-review-publications` and `github-review-workflow` integration suites: 39 passed. Server typecheck is clean. - After deploy: a recovered review for a merged PR should finish as done instead of blocking. ## Risks - Wording change for one refusal; the reason code and retryability are unchanged. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, 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 - [ ] 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.1127.0-canary.868800 |
||
|
|
2caedfe7b0 |
feat(voice): support outbound call messages, issue transcripts, and optional setup test for Speko (#23052)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - The Speko voice connection lets agents call a person's saved phone
number via `call_my_phone` and receive inbound phone calls that create
or continue tasks.
> - Outbound `call_my_phone` took no parameters, so the agent could not
speak a specific update or question when the person picked up, and
outbound call transcripts were not projected onto the bound issue.
> - Setup also blocked activation behind a mandatory two-turn browser
microphone test and failed with HTTP 400 when a Speko persona used a
cascade-only voice on `runMode: "s2s"`.
> - This pull request adds an optional `message` parameter to
`call_my_phone`, projects outbound and inbound phone call transcripts
onto the bound issue, derives inbound task titles from the caller's
request, falls back to a supported S2S voice on 400, and lets verified
Speko setups finish without a browser microphone test.
> - The benefit is that both agent-initiated phone updates (with
responses recorded in the issue) and inbound phone tasks work end-to-end
with reliable setup and full issue transcript visibility.
## Linked Issues or Issue Description
**What existing behavior does this improve?**
Speko voice connection setup (`POST
/api/chat-endpoints/:endpointId/finish`, `ChatEndpointSetup`), outbound
agent phone callbacks (`call_my_phone`), outbound/inbound phone
transcript projection (`voiceCallReports`), and incoming low-trust task
creation (`voiceInboundService`).
**Subsystem affected**
Cross-cutting (multiple of the above)
**Current behavior**
- `call_my_phone` accepts no arguments (`properties: {}`) and always
opens with `"Hi, this is your Paperclip agent calling as requested. Is
now a good time?"`.
- Outbound `call.pre_call` sets `idleRePrompts` to `"I'm still working
on it."` every 10 seconds.
- `voiceCallReports.projectTranscript` only writes the transcript
document onto issues for `guest_intake` sessions, omitting authenticated
outbound and inbound phone calls.
- Incoming `guest_intake` tasks always use the generic title `"Incoming
phone conversation"`.
- Activating a Speko connection requires completing a two-turn browser
microphone conversation before **Call my phone** and **Incoming calls**
settings become accessible.
- `configureVoiceDefaults` fails with HTTP 400 if the selected Speko
persona uses a cascade-only voice when switching to `runMode: "s2s"`.
**Proposed behavior**
- `call_my_phone` accepts an optional `message` string (1–2000 chars)
while still strictly rejecting recipient/phone arguments. Speko speaks
`message` immediately as `firstMessage` and instructs the voice model to
submit caller replies via `submit_request`.
- Outbound `call.pre_call` uses a 25-second conversational check-in
re-prompt instead of `"I'm still working on it."`.
- `voiceCallReports.projectTranscript` writes `"Outbound phone call
transcript"` / `"Phone conversation transcript"` onto the bound issue
for all phone calls (`outbound_phone` and `inbound_phone`), preserving
quarantine guards for `guest_intake`.
- Incoming `guest_intake` tasks derive a readable title from the
caller's first spoken request.
- Verified Speko connections can finish setup via `POST
/api/chat-endpoints/:endpointId/finish` (**Skip test & finish**) without
requiring a browser microphone test.
- `configureVoiceDefaults` falls back to S2S voice `"marin"` if Speko
returns HTTP 400 on `runMode: "s2s"`.
**Reason and benefit**
Makes both core phone workflows usable in production: agents can call an
opted-in person to deliver a concrete update and capture their spoken
response in the issue, callers can phone an agent to start a titled
task, and operators can complete Speko setup without a microphone or
cascade-voice failure.
**Breaking changes**
None. `message` is optional on `call_my_phone` so `{}` callers remain
compatible; existing recipient restrictions (`additionalProperties:
false`) and quarantine boundaries are preserved.
## What Changed
- Added optional `message` parameter to `call_my_phone` in
`server/src/services/voice/speko-agent-tools.ts`, threaded
`openingMessage` into `voice-session-service.ts`, `voice-prompts.ts`
(`buildOutboundPhoneVoicePrompt`), and `speko-provider.ts`
(`createPhoneSession`), and updated `speko-skill.ts`.
- Extended `voiceCallReports.projectTranscript` in
`server/src/services/voice/voice-call-reports.ts` to project phone call
transcripts onto the bound issue for `outbound_phone` and
`inbound_phone` sessions while keeping `guest_intake` quarantine
enforcement intact.
- Derived readable issue titles from the first `submit_request` text for
incoming `guest_intake` calls and refined outbound `call.pre_call`
`idleRePrompts` in `server/src/services/voice/voice-inbound-service.ts`.
- Added S2S voice fallback (`voice: "marin"`) on HTTP 400 in
`speko-provider.ts` (`configureVoiceDefaults`).
- Enabled optional test skip (`POST
/api/chat-endpoints/:endpointId/finish`) for verified Speko endpoints in
`server/src/services/chat-channels/setup-probes.ts` and added a **Skip
test & finish** button in
`ui/src/pages/apps/chat/ChatEndpointSetup.tsx`.
- Updated `packages/shared/src/app-definitions/speko.json` guidance
copy.
- Added unit and real-Postgres integration regressions in
`server/src/__tests__/speko-provider.test.ts` and
`server/src/__tests__/voice-session-store.integration.test.ts`.
## Verification
- `pnpm --filter @paperclipai/shared build && pnpm --filter
@paperclipai/server typecheck && pnpm --filter @paperclipai/ui
typecheck` — passed (0 errors across server layers and UI).
- `pnpm exec vitest run server/src/__tests__/speko-provider.test.ts
server/src/__tests__/speko-protocol.test.ts
server/src/__tests__/speko-call-report.test.ts
server/src/routes/voice-sessions.auth.test.ts` — 53/53 passed.
- `pnpm exec vitest run
server/src/__tests__/voice-session-store.integration.test.ts` — 133/133
passed (including new `call_my_phone` message + outbound transcript
projection, derived inbound title, and Speko finish-without-test
regressions).
- `pnpm exec vitest run ui/src/api/voiceSessions.test.ts
ui/src/components/voice/ ui/src/lib/voice-call-attempt.test.ts
ui/src/lib/voice-session-controller.test.ts
ui/src/lib/voice-transcript.test.ts
server/src/__tests__/chat-channels/slack-setup-and-registration.integration.test.ts`
— 161/161 passed.
- `pnpm run check:token-gates` — all 4 gates clean.
- Live local verification against Speko API + webhook-only Cloudflare
quick tunnel: verified Speko setup + `/finish` activation, live
`claude_local` MCP discovery of `call_my_phone` with `message`, live
Speko session create/inspect/end + signed `call.status`/`call.report`
callbacks through tunnel, and inbound `call.pre_call` + `submit_request`
creating a titled task.
## Risks
- Low risk. Additive optional schema field on `call_my_phone` (still
rejects unknown keys such as `to`). No database migrations required.
Transcript projection for authenticated calls writes only to the
session's bound issue under the existing per-session advisory lock. Live
PSTN audio still requires real-phone end-to-end confirmation after
staging rollout.
## Model Used
- Google Gemini 4 Neon (High) via Antigravity with tool use and local
code execution.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
|
||
|
|
9c91c097bd |
fix(workspaces): run the full-disk read-only inventory's Git reads under the sandbox storage guard (#23095)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - A Cloud sandbox saves the agent's workspace when a run ends. When the sandbox disk is full, a read-only fallback copies the workspace without writing to the sandbox (#19465). > - Before the copy, the fallback runs an inventory of the workspace inside the sandbox. For each Git repository, the inventory runs `git rev-parse`. For an untracked `node_modules` or virtual environment, it also runs `git ls-files`. > - Cloud sandboxes now put a Git storage guard first on `PATH`. The guard reads its limits from three environment settings: `PAPERCLIP_GIT_MIN_FREE_BYTES`, `PAPERCLIP_GIT_MIN_FREE_INODES` and `PAPERCLIP_GIT_MAX_GROWTH_BYTES`. Without them, it refuses every Git command as misconfigured (exit 75). > - The inventory gives Git a minimal environment, and that environment drops the three settings. Thus the guard refuses the first Git read, and the inventory refuses every Git workspace as an unsafe source. > - This pull request keeps the guard's three settings in the inventory's Git environment. It also records a guard refusal by its own reason. > - The benefit is that a full-disk save of a Git workspace can complete again. If the guard refuses Git below its free-space floor, the recorded cause says so. ## Linked Issues or Issue Description Refs #19465, #19619, #22546, #22848 **What happened?** On staging, full-disk workspace saves fail again on releases since the sandbox image added the Git storage guard. Nine saves from 2026-11-24 to 2026-11-27 recorded this cause: `remote_workspace_sandbox_disk_full: ...; remote_workspace_readonly_capture_failed: stage=inspect reason=unsafe_source transport=provider_error`. All of them ran on releases that contain #22546. Thus the earlier `budget_exceeded` refusal is fixed, and this refusal is the next one. **Expected behavior** The read-only inventory runs Git with the same guard settings that normal capture gets. Normal capture keeps `process.env` for Git, so the guard is configured there. A Git workspace that normal capture could save passes the inventory. **Steps to reproduce** 1. In a Cloud sandbox, put the storage guard first on `PATH`. Set its three settings in the sandbox environment (the image sets them for the sandbox process tree). 2. Run `readonlyWorkspaceInventoryScript()` on a Git workspace. 3. On `master`, the script exits 1 with `remote_workspace_readonly_capture_unsafe`. With this change, it returns the inventory. **Relevant logs or output** `paperclip_git_storage_limit: Git's storage guard is unavailable or misconfigured; Git did not complete.` The guard writes this message when its settings are missing. ## What Changed - `readWorkspaceInventory` copies the three guard settings from `process.env` into its Git environment when they are set. It copies no other variable. The Git isolation settings do not change. - When Git fails and the guard wrote a `paperclip_git_storage_limit:` line, the inventory reports `remote_workspace_readonly_capture_git_storage_limit` for a free-space, inode or growth refusal. It reports `remote_workspace_readonly_capture_git_storage_guard_unavailable` for any other guard refusal. All other Git failures still report `remote_workspace_readonly_capture_unsafe`. - The sandbox script passes these two fixed tokens through, the same as the budget token. It still writes no error text or paths. - `captureReadOnlyWorkspaceArchive` records them as `reason=git_storage_limit` and `reason=git_storage_guard_unavailable`. - The sandbox command filter (`READONLY_INVENTORY_FAILURE`) forwards the two new tokens. Without this, `command()` drops them and the fallback records `reason=operation_failed`. ## Verification - New `remote-workspace-readonly-inventory-git-guard.test.ts`: it puts a stand-in guard on `PATH` that behaves like the sandbox guard. All 3 tests fail on `master` with `remote_workspace_readonly_capture_unsafe`. All 3 pass with this change. - New case in `remote-workspace-readonly-capture-cause.test.ts`: a guard refusal of `ls-files` is recorded as `stage=inspect reason=git_storage_limit` before any transfer. I could not run this case locally because the sandbox has no full dependency install. CI verifies it. - Real guard check: I ran the inventory script from `master` and from this branch on a real 857 MB Paperclip workspace (18,849 entries). It ran through the actual sandbox guard, with the sandbox's own settings in the environment. `master` refused the workspace with `remote_workspace_readonly_capture_unsafe`. This branch returned the inventory. - A strict TypeScript check of the changed inventory module passes. CI runs the full typecheck. ## Risks - Low risk. Only the three guard settings are added to the Git environment. Git still runs with no system or global configuration, no hooks, no optional locks and no lazy fetch. - The guard still applies its free-space floor. Below the floor, it refuses `ls-files`. Thus a Git workspace with an untracked `node_modules` or virtual environment can still fail the fallback when free space is below the floor. The recorded cause now shows `reason=git_storage_limit` for that case, so a follow-up can use real evidence. - Outside a guarded sandbox, the settings are not set and nothing changes. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), with tool use and code execution in a Paperclip agent sandbox. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: paperclipbugbot <356415228+paperclipbugbot@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>canary/v2026.1127.0-canary.868600 |
||
|
|
635ed5a364 |
fix(skills): start skill package transfer deadlines after the I/O queue admits them (#22615)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - Before a run starts, Paperclip copies each selected skill version
from skill package storage into a local cache.
> - Skill package reads share small I/O queues for each process. Each
queue has 2 active permits and 32 waiting slots.
> - Each read started its 180-second deadline before it waited for a
permit. A read that waited behind other transfers used up its deadline
in the queue.
> - On a busy host, a run then failed before its agent started with
"Failed to materialize the selected skill version: The operation was
aborted due to timeout". The next run did the same cold read and failed
the same way.
> - This pull request starts each transfer deadline when the queue
grants the permit.
> - The benefit is that a cold skill read under load waits for its turn
and then gets its full transfer deadline.
## Linked Issues or Issue Description
**What happened?**
A staging host had a burst of 21 run failures in 15 minutes. All runs
were in one company, and each failed with "Failed to materialize the
selected skill version: The operation was aborted due to timeout". The
runs woke at the same time after a provider usage limit reset. The skill
cache was cold.
**Expected behavior**
A run that waits for a skill package I/O permit gets the full 180-second
deadline for its own transfer. Time spent in the queue must not count
against that deadline.
**Steps to reproduce**
1. Make the skill package cache cold for three companies.
2. Stall the archive reads of two companies, so that they hold both
storage permits.
3. Resolve the runtime skills of the third company. Its reads now wait
in the queue.
4. Wait longer than the transfer deadline, then release the stalled
reads.
5. On `master`, the third company's skill resolves as missing with the
timeout message. Its own transfer would take milliseconds.
**Paperclip version or commit**
`master` at
nightly/v2026.1127.0-nightly.0
canary/v2026.1127.0-canary.868500
|
||
|
|
dadbc495b3 |
feat(ui): move the connection page to the Plugins design (#23029)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The Plugins page is where a person connects tools to agents and sets what those tools can do > - #22869 and #23005 moved Browse, the plugin page, and Reviews to the Plugins marketplace design > - The connection page that opens after a successful connection kept the old design and an old side rail > - A person who connects a plugin lands on a page that does not look like the page they came from, and the plugin page does not show a clear way back to it > - This pull request applies the plugin page design to the connection page and adds a Settings button to each account row on the plugin page > - The benefit is one consistent path: Plugins, then the plugin, then the account settings ## Linked Issues or Issue Description Refs #22869, #23005 **What existing behavior does this improve?** The connection page at `/apps/:connectionId/permissions` and `/apps/:connectionId/review`, and the account rows on the plugin page. **Subsystem affected** UI, Plugins (Apps catalog) pages. **Current behavior** - The connection page shows a second side rail with "All connectors", Permissions, and Review. - The page uses a left-aligned column, ruled dividers, bordered chips, and raw palette colors for the status badge. - The plugin page opens the connection page only from the account name and the "⋯" menu. **Proposed behavior** - The connection page has no second rail. It shows a back link to the plugin, the header, and Permissions and Review as tabs in the page. The Review tab shows the count of waiting items. - The page uses the centered column, the quiet section labels, and the rounded grouped surfaces of the plugin page. - The Read and Write action groups are grouped cards. The control that sets all actions is in the card header. - Each account row on the plugin page has a Settings button that opens the connection page. - The breadcrumb reads Plugins, plugin, account. **Reason and benefit** The page after a connection matches the plugin page. A person can go from the plugin to its account settings and back with one click. **Breaking changes** None. The routes, the labels that assistive technology reads, and the permission logic do not change. ## What Changed - `Layout.tsx`, `Layout.production.tsx`: connection routes no longer mount `AppDetailSidebar`. The page for an app that is not connected keeps its rail. - `AppDetail.tsx`: new page shell, a restyled `AppDetailHeader`, an exported `ConnectionBackLink`, and `ConnectionTabs` with the review count. The status badge uses status tokens. - `IdentitiesSection.tsx`, `PermissionsPanel.tsx`, `AgentConnectionAccess.tsx`: quiet labels and grouped surfaces. No logic changes. - `Browse.tsx`: a Settings button on each account row that is not a draft. - `AiConnectionPoolConnector.tsx`: a "Plugins" back link, because the rail that held it is gone. - `replay-masking.test.tsx`, `connection-pools.spec.ts`: updated for the new header class and the new back link. ## Verification - `cd ui && pnpm typecheck`: pass. - `pnpm run check:token-gates`: all gates clean. - `node scripts/check-query-error-rendering.mjs`: 0 findings. - `npx vitest run` on the 11 test files that import the changed components: 732 passed, 1 skipped. - `npx playwright test --config tests/e2e/playwright.config.ts tests/e2e/connection-reviews.spec.ts tests/e2e/apps-prosumer-mcp-flow.spec.ts tests/e2e/applications-crud.spec.ts`: 9 passed, 1 skipped. - Manual check in a local instance, dark theme, with a Context7 connection: the Permissions tab, the Review tab, and the Settings button on the plugin page. - Not run: `tests/ai-connections-app/connection-pools.spec.ts`. Not checked in the browser: the GitHub repositories block, the reconnect banner, the light theme, and narrow widths. ## Risks - Low. The change is presentation only for the sections, and the routes are the same. - The connection pool page lost the rail. Its only way back is now the "Plugins" back link and the breadcrumb. - The page for an app that is not connected still has the old rail. This is a known inconsistency. > 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 Fable 5.2 (`claude-fable-5-2`) in Claude Code, with tool use, code execution, and a browser preview. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>canary/v2026.1126.0-canary.868400 |
||
|
|
1480f716c9 |
test(recovery): pin the 7-day window for chat setup failures; reattach listSuspects docs (#23063)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The assigned-work sweep now continues a blocked chat-channel task whose latest run failed in setup before provider work (#23059) > - Review on #23059 left three non-blocking points: the 7-day run-age limit had no test, the `listSuspects` doc comment was separated from its function, and the rule has SQL and TypeScript twins > - This pull request adds the missing boundary test and restores the doc placement > - The benefit is that widening or removing the age limit now fails a test, and the code reads as it did ## Linked Issues or Issue Description Refs #23059, #23051 **Describe the bug** Review follow-up, no user-visible bug. The 7-day limit on how old a setup failure may be for a chat task to continue automatically had no test, so a regression that widened or removed it would pass. The `listSuspects` doc comment was split from `listSuspects` by a new helper. **Steps to reproduce** 1. Remove the run-age condition from `latestRunFailedBeforeProviderWork` and `chatFailedBeforeProviderWork`. 2. The existing tests still pass. **Expected behavior** A test fails when the 7-day limit is removed. ## What Changed - `assigned-work-invariant.test.ts`: a recently blocked chat task whose setup failure ended 8 days ago is not a sweep suspect and is judged a conversation wait. The test helper takes an optional `blockedAgoMs` so the block can be recent while the run is old. - `assigned-work-sweep.ts`: the `listSuspects` pre-filter doc comment sits directly on `listSuspects` again; the SQL predicate's comment names its TypeScript twin and the test that covers both. ## Verification - `assigned-work-invariant.test.ts`: 35/35 pass. With the age condition removed from both twins, the chat setup-failure test fails (checked), then passes again with it restored. - Server typecheck is clean. ## Risks - Test and comment changes only; no behavior change. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, 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 - [ ] 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.1126.0-canary.868300 |