mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-05 06:03:51 +01:00
dfe392dada69838da3d7c33a0ef00d7e4cfc60f3
8927
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
dfe392dada |
fix(ui): include task identifier in browser tab title (#14212)
## Thinking Path Paperclip's task breadcrumbs already carry identifiers, while browser tab titles omit them. Showing a valid identifier before the task name makes tabs easier to distinguish. Preserve existing titles for missing, blank, or duplicate identifiers. ## Linked Issues or Issue Description - Fixes #13615. - Refs #10933, which added identifiers to visible task breadcrumbs. - Refs #14583. This branch reuses the existing test-only CI repair by itsjeremyjohnson and Codex, preserving its authored commit and attribution. ## What Changed - Show task titles as `IDENTIFIER — Name` when the breadcrumb has a nonblank identifier. - Preserve the existing title when the identifier is missing, blank, or equals the label. - Cover task/identifier/company changes, empty breadcrumbs, and duplicate identifiers. - Merge current master and keep its expanded clipboard-feedback test unchanged. The earlier #14583 repair remains credited in history. The net change against master is limited to the two title files. ## Verification Integration base: `b110271c9b2fd6dd5a1beb119e7f0663385df8b9`. Current head: `5fd1105c78d16418876b70921cca97a836359da6`. Its merge parents are the previous PR head and the integration base above. - macOS arm64, official Node 24.21.0, Vitest 5.0.3, original current Vitest config/setup, one worker, 512 MiB heap: **16/16 passed** in BreadcrumbContext and ProjectWorkspaceSummaryCard. - The same tests against master's original title implementation produced **14 passed / 2 failed**. Both failures concern the missing identifier in the helper and live document title. The candidate passes both. This comparison keeps the same dependencies and test bytes. - Master's clipboard regression remains byte-for-byte unchanged. Its four text/icon controls and 1499ms-visible/1500ms-expired checks pass. - All four current token gates passed across 1,416 files. `git diff --check` passed. The exact committed tree matches the tested candidate. The net diff from the integration base contains only the two BreadcrumbContext files. - The diagnostic dependency environment uses 170 exact packages from the unchanged current lockfile. It reuses 156 packages from the prior integrity-checked cache and verifies registry and archive integrity for 14 added versions. No lifecycle scripts or dependency overrides ran. This is a minimal test environment, not a full workspace installation. - Checks for this new head are pending. The prior [workflow 39381608779](https://github.com/paperclipai/paperclip/actions/runs/39381608779) passed all 48 jobs at `574f0c9`, with 54 successful and two skipped checks. That result and the old Greptile 5/5 are historical; they do not validate this integration. - Full-workspace typecheck, build, backend and browser acceptance were not repeated locally on this integration. The current local environment covers the affected regressions. Full repository checks remain for upstream CI. The original failed clipboard CI attempt is retained in history. Its exact Ubuntu timing cause was not independently reproduced locally. No assertion, workflow or gate was disabled. The upstream-expanded test now replaces our imported test diff while preserving its authored history. ## Risks The application change affects tab text for task breadcrumbs with a valid identifier. Master now contains a broader workspace clipboard-feedback regression. This merge keeps that file exactly as master. The imported #14583 commits and original attribution remain in branch history. No clipboard production code changes. Historical real-backend browser acceptance at `4040c564` remains historical only. Authentication, multi-user permissions, agent execution and other browser engines were outside that acceptance. Maintainer review and checks for the new head remain pending. ## Model Used OpenAI Codex, GPT-6 family, assisted with implementation, tests, repository inspection and GitHub checks. The exact served model ID, context window and reasoning settings were not exposed. The reused test repair retains the AI disclosure and authorship recorded in #14583. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Codex <codex@openai.com> |
||
|
|
d939c64a6b |
fix(opencode): keep the text-first answer when only the completion call is written as text (#23806)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - The Paperclip runner drives OpenCode models and asks again when a
turn ends without a final answer
> - The second request asks for a plain-text answer first, then the
`paperclip_finish` call
> - DeepSeek v4.1 flash sometimes sends that answer and then writes
`paperclip_finish` as DSML text, not as a real tool call
> - The runner discards the full reply when it finds tool-call text, so
it also discards the answer it asked for, and the turn fails with
`opencode_empty_response`
> - This pull request keeps that answer when the only text call after it
is the completion call
> - The benefit is that a turn that already did its work ends with an
answer, not a failed run and a full retry
## Linked Issues or Issue Description
Refs #21361
Refs #21761
**What happened?**
After real tool work, a reviewer agent on DeepSeek v4.1 flash
(OpenRouter) ended its turn with a tool call written as text. The runner
sent two corrections. For the second correction, the model wrote a
correct plain-text answer, a blank line, and then `paperclip_finish` as
DSML text. The runner discarded the full reply and failed the turn with
`opencode_empty_response` ("after two corrections"). The work was
already done. In one run, the model had published a PR review. In a
different run, it had posted a GitHub reply. The automatic retry then
ran the full session again. This occurred three times on staging in
three weeks, and two of the three were on the same day.
**Expected behavior**
The second correction asks for exactly this shape: an answer, then the
completion call. When the completion call is the only text call, the
runner should keep the answer. A completion call starts no work, so the
answer cannot describe an action that did not occur.
**Steps to reproduce**
1. Start an OpenCode turn that does tool work and then sends an empty
reply two times.
2. For the text-first correction, send `Here is the actual final
answer.` followed by a DSML `paperclip_paperclip_finish` call as text.
3. Before this change, the turn fails with `opencode_empty_response`.
The new `tool-work-text-finish-markup` case in `empty-response.test.ts`
does these steps.
**Paperclip version or commit**
`master` at
|
||
|
|
df371acc77 |
fix(recovery): give fresh runs a grace period before the issue-terminal sweep (#13883)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The control plane keeps issue ownership and run liveness in separate rows, and a recovery sweep reconciles them. > - That sweep can terminalize a `running` heartbeat row on two authorities: a dead process, or a terminal issue above a live row. > - The issue-terminal authority infers orphanhood from the issue status alone. It does not observe the run. > - A reassignment hand-off satisfies that inference while it is healthy: one request sets the issue to `done` and reassigns it, so the receiving agent's run starts while the issue is momentarily terminal and still holds the lock columns. > - The sweep then kills a run that is seconds old and releases the checkout it just acquired. > - This pull request requires the row to have stayed `running` for 60 seconds before the issue-terminal authority applies. > - The benefit is that a reassignment hand-off completes instead of failing with an ownership conflict on a checkout that returned 200. ## Linked Issues or Issue Description No public GitHub issue exists for this bug. Related pull requests: - Refs #13271. That pull request makes a live in-memory executor authoritative over both authorities. It fixes the case where one run sets its own issue terminal and keeps writing. It does not close the window this pull request closes. See "Relationship to #13271" below. **What happened?** An agent set an issue to `done` and reassigned it in the same `PATCH`. The server started the receiving agent's run. The issue was still terminal and still held `checkout_run_id` and `execution_run_id`. The stale-lock sweep read the terminal issue as proof that the new run was orphaned. The sweep marked the run terminal after about 700 ms and cleared the lock columns. The receiving agent had already received `200` from its checkout. Every later status write from that agent failed with an ownership conflict. **Expected behavior** The sweep must not terminalize a run that is seconds old on the strength of the issue status alone. A run that just acquired a checkout must keep it. **Steps to reproduce** 1. Assign an issue to agent A and let its run check the issue out. 2. Send one `PATCH` that sets the issue to `done` and reassigns it to agent B. 3. Let the server start agent B's run. The issue still holds both lock columns. 4. Run the stale issue-lock sweep inside the first seconds of that run. 5. See the sweep mark agent B's run `succeeded` with error code `orphaned_running_run_issue_terminal`. 6. Send a status write from agent B. See the ownership conflict. **Paperclip version or commit** `master` at `60c7c9cd1`. **Deployment mode** Self-hosted server with PostgreSQL. The defect is in the shared run lifecycle. It is not specific to an adapter. ## What Changed - Added `ISSUE_TERMINAL_MIN_RUN_AGE_MS` (60 seconds) to `server/src/services/recovery/service.ts`. - Suppressed the issue-terminal authority in `terminalizeOrphanedRunningRun` while the run row is younger than that age, and logged a warning when the suppression fires. - Left the process-death authority unchanged, so a dead process is still swept immediately at any run age. - Made the two reuse-lease tests seed an aged run row, because an orphan is by definition a row that stayed `running`. - Added a test for the reassignment hand-off. It asserts that the fresh run survives and that both lock columns survive. - Added a test for a fresh run with a dead recorded pid. It asserts that the sweep still terminalizes the run as `interrupted` and still clears the locks. ## Relationship to #13271 #13271 moves the `liveRunExecutions` check to an early return, so it covers both authorities. That is a good change and this pull request composes with it. It does not cover this window, for two reasons. 1. The run row reaches `running` before the execution registers itself. `activeRunExecutions.add(run.id)` runs inside the execution body, after awaited database work. A sweep that fires in that gap sees no live execution. The run also has no recorded pid yet, so the process-death authority stays silent by design. The issue-terminal authority is the only one left, and it fires. 2. `activeRunExecutions` is a module-scope `Set`. It is per server process. A sweep on one process cannot see an execution owned by another. The grace period covers both, because run age is in the row itself. ## Verification - `node scripts/run-vitest-stable.mjs server/src/__tests__/recovery-stale-issue-lock-sweep.test.ts` is the target suite. I could not run it in my environment: the suite needs embedded PostgreSQL, and my sandbox has no host for it. I ask CI to be the check here. Please do not merge on a red run. - I did verify the guard logic directly. I extracted the compiled guard and drove it against seven cases: a 700 ms run under a `done` issue, a 59 s run, a 61 s run, a one-hour run under a `cancelled` issue, a row with no usable timestamp, an ISO string timestamp, and a null issue status. All seven matched the intended outcome, and the warning fired only on the three suppressed cases. - I traced the single call site. `sweepStaleIssueLocks` builds `runRows` with `db.select()` and no projection, so `run.createdAt` is always present at run time. There is no other caller. - Reviewers can reproduce the bug with the six steps above. The new hand-off test fails on `master` and passes with this change. ## Risks Low, and the direction of the failure is the safe one. - A genuinely orphaned run now keeps its lock for up to one extra sweep tick. The sweep is periodic, so the next tick clears it. Nothing is stranded. - The guard fails open. If the row carries no usable timestamp, the sweep behaves as it does today. - The process-death authority is untouched. A hard crash is still reaped at once. - Two existing tests changed their fixture, not their assertions. They still assert that the sweep terminalizes the run and clears the lock. - The 60 second value is a constant, so an operator who needs a different window changes one line. ## Model Used Claude Opus 4.7 (`claude-opus-4-7`) by Anthropic, through Claude Code with tool use and extended thinking. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [ ] I have run tests locally and they pass — the suite needs embedded PostgreSQL, which my environment cannot start. See Verification. - [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 — pending the first CI run - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups — pending review - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Builder <builder@nublo.net> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
67e6a6aa2a |
fix(plugins): bridge issue.child_created activity to issue.created plugin event (#13728)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Plugins subscribe to core domain events such as `issue.created` through the `events.subscribe` capability > - Issues created through `POST /issues/:id/children` or accepted-plan decompositions only log the `issue.child_created` activity action, and that action was not in the plugin event bridge in `activity-log.ts` > - Subscribers to `issue.created` therefore never observe child issues, so plugin workflows that track every new issue silently miss decompositions > - This pull request maps `issue.child_created` to the `issue.created` plugin event type > - The benefit is that plugin subscribers observe every new issue through one event type, and the bridged payload matches a top-level creation because the activity row already carries `entityType: "issue"` and the new child issue id ## Linked Issues or Issue Description Fixes: #13466 ## What Changed - Added `issue_child_created: "issue.created"` to `ACTIVITY_ACTION_TO_PLUGIN_EVENT` in `server/src/services/activity-log.ts`, with a comment explaining why the bridge is safe (same entity shape as top-level creation) - Added `server/src/__tests__/activity-plugin-event-bridge.test.ts` covering: - `issue.child_created` is bridged to `issue.created` with the child issue id as the event entity - a native `issue.created` action still passes through unchanged - unmapped actions still emit no plugin event ## Verification ```sh ./node_modules/.bin/vitest run server/src/__tests__/activity-plugin-event-bridge.test.ts ``` All 3 tests pass against an embedded Postgres instance. Also ran `git diff --check`. ## Risks Low risk. The change only adds a mapping entry; no existing activity action is remapped or removed. Plugins that already handle `issue.created` will now also receive child creations. The activity details payload carries an extra `parentId` field for child creations, which additive subscribers should tolerate. No migration or schema change. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected — check the roadmap first. See `CONTRIBUTING.md`. ## Model Used OpenAI Codex (GPT-5, coding-agent mode, repository tool use) — assisted with root-cause analysis, the mapping change, and the new test file. ## 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: 馨冉 <xinxincui239@gmail.com> |
||
|
|
f530a7b167 |
Keep pause status inline and ease the agent character into sleep (#23662)
## Thinking Path
> - Paperclip helps people manage AI agents at work.
> - The agent overview shows the agent name and runtime status.
> - A pause or resume adds a status row and moves the name.
> - The name should stay in place while the agent changes state.
> - This change places the status beside the name and crown.
## Linked Issues or Issue Description
**Subsystem affected**
Agent detail header.
**Current behavior**
Pause and resume add a line of detail below the harness. The title moves
when that line appears.
**Proposed behavior**
Keep the title steady. Show progress beside the crown and keep the
paused state visible until the user resumes the agent.
## What Changed
- Resize and fade the pill with a fixed left edge. Respect reduced
motion.
- Blend the header character into its sleeping pose over 160 ms when the
agent reaches **Paused**. Keep its assigned colors and show the
onboarding sleep marks. Wake the character when resuming begins.
- Show the new pose immediately when the user requests reduced motion.
- Preserve lifecycle error details and retry controls.
- Add a development preview that lets reviewers try both transitions
without changing an agent.
## Verification
- Open an agent overview in development with `?preview=pause`. Select
**Preview pause**, wait for **Paused**, then select **Preview resume**.
- Chromium confirmed the full cycle and the 240 ms resize duration.
- Chromium confirmed that the character uses the same palette when
sleeping and awake.
- All 36 focused tests passed in four Vitest files on commit
|
||
|
|
845ca8506a |
test(server): drain structured issue route work before teardown (#23813)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Issue routes can wake an assigned agent in the background. > - The structured issue parity suite uses those real routes and a temporary database. > - It could stop that database while route-triggered work was still active. > - The resulting unhandled database error failed source verification after test assertions passed. > - This pull request drains that work after each test and checks quiescence. > - Database teardown now starts only after the suite's background work settles. ## Linked Issues or Issue Description **What happened?** [Cloud readiness run 47456696780, attempt 2](https://github.com/paperclipai/paperclip/actions/runs/47456696780/job/145473729239) reported 1,562 tests passed and three skipped in server shard 13/20, then failed on an unhandled PostgreSQL `read ECONNRESET`. The error came from type discovery and was reported while `canonical-issue-structured-parity.test.ts` was running. This cancelled [image run 47456696824](https://github.com/paperclipai/paperclip/actions/runs/47456696824). **Expected behavior** The fixture must settle route-triggered wakeups and executions before it resets data or stops PostgreSQL. **Steps to reproduce** On master `83f10b968dba1cb0300f216cabce3a5924f5d3c8`, add the quiescence assertion from this diff without the drain. Run `PAPERCLIP_VITEST_RETRY=0 pnpm exec vitest run server/src/__tests__/canonical-issue-structured-parity.test.ts --maxWorkers=1`. The assertion failed locally with three active executions and one pending wake. The old teardown also logged queries against a closed connection. ## What Changed - Await the existing heartbeat drain after each test. - Assert zero active executions and pending wakes before the fixture can continue or stop its database. - Keep the route, channel isolation, schema validation, and authorization checks in place. ## Verification - Red: the cleanup assertion failed with `activeRuns: 3`, `pendingWakes: 1`, and `quiescent: false`. - Green: both tests passed after the drain, with retries disabled and no unhandled errors. - Test budget and `git diff --check` passed. - Final PR head `f4679f12c299ff7718112f5d368fce907d1d0f3a`: 64 checks passed, seven skipped, no pending or failed checks; GitHub reports no merge conflicts. [Greptile rated it 5/5](https://github.com/paperclipai/paperclip/pull/23813#issuecomment-7429108337), with no review threads or follow-ups. - The first server typecheck found stale local Plugin SDK declarations that omitted `runtime_updating`. The value already exists in SDK source. Rebuilt the Plugin SDK and shared package; the final server typecheck passed, and both focused tests passed again with retries disabled. - `pnpm verify --explain` conservatively retained 2,009 of 2,372 test files. Required CI will provide that broad coverage. - Recovery: [exact-source verification attempt 3](https://github.com/paperclipai/paperclip/actions/runs/47456696780/job/145482927885) passed for master `83f10b968dba1cb0300f216cabce3a5924f5d3c8`. [Image attempt 2](https://github.com/paperclipai/paperclip/actions/runs/47456696824/job/145483491486) then published the AMD64/ARM64 manifest as `ghcr.io/paperclipai/paperclip:sha-83f10b9`, digest `sha256:9c23177cbe9744eded163c56bc88904aa0901442fe9932b6ea5cf329f143c66e`. All publication gates remained in place. This establishes operational recovery; resolving the cleanup race requires this change. ## Risks - Low risk. Only test fixture cleanup changes. Production code and database behavior stay as they are. - The drain can settle work that the route started before the HTTP response. A future unfinished execution fails the quiescence assertion instead of leaking into database teardown. - No documentation change is needed because the application contract does not change. ## Model Used - OpenAI `gpt-6.1-sol`, through the Codex harness in T3 Code, with xhigh reasoning effort and shell tools. The context window size is not exposed. ## 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.1205.0-nightly.0 canary/v2026.1205.0-canary.892200 |
||
|
|
83f10b968d |
build(deps): bump actions/dependency-review-action from 5.0.0 to 5.0.1 (#22594)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 5.0.0 to 5.0.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/dependency-review-action/releases">actions/dependency-review-action's releases</a>.</em></p> <blockquote> <h2>v5.0.1</h2> <p>Minor update:</p> <ul> <li>Better error information from the compare endpoint (<a href="https://github.com/ahpook"><code>@ahpook</code></a>)</li> <li>Many dependency updates</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/dependency-review-action/commit/bbc44d14a204704ccc493733616cd1e93a0321ec"><code>bbc44d1</code></a> Merge pull request <a href="https://redirect.github.com/actions/dependency-review-action/issues/1188">#1188</a> from actions/v501</li> <li><a href="https://github.com/actions/dependency-review-action/commit/295c48fd7d5199433e846423e06c02691a162f77"><code>295c48f</code></a> Set up files for 5.0.1 release</li> <li><a href="https://github.com/actions/dependency-review-action/commit/977bcd13d3eb1fbb591c288db1115cffba6b06c9"><code>977bcd1</code></a> Merge pull request <a href="https://redirect.github.com/actions/dependency-review-action/issues/1185">#1185</a> from actions/dependabot/npm_and_yarn/fast-xml-parser...</li> <li><a href="https://github.com/actions/dependency-review-action/commit/61842ba809cdbb8c0307f3388a74db8ffff254d1"><code>61842ba</code></a> Merge pull request <a href="https://redirect.github.com/actions/dependency-review-action/issues/1182">#1182</a> from actions/ahpook/555-api-error-handling</li> <li><a href="https://github.com/actions/dependency-review-action/commit/4a8ea4ac762bd60977046709e47e32f7efe958f2"><code>4a8ea4a</code></a> Merge pull request <a href="https://redirect.github.com/actions/dependency-review-action/issues/1186">#1186</a> from actions/dependabot/npm_and_yarn/minor-updates-a...</li> <li><a href="https://github.com/actions/dependency-review-action/commit/c33d34643dda810d719146b811c53e546128b71c"><code>c33d346</code></a> Bump the minor-updates group across 1 directory with 3 updates</li> <li><a href="https://github.com/actions/dependency-review-action/commit/bc6b60f898530d498df031176316afa44ddf0762"><code>bc6b60f</code></a> Merge pull request <a href="https://redirect.github.com/actions/dependency-review-action/issues/1183">#1183</a> from actions/dependabot/github_actions/github/codeql...</li> <li><a href="https://github.com/actions/dependency-review-action/commit/a0e662b13d69052d77249d8b201248fd4b90e054"><code>a0e662b</code></a> Merge pull request <a href="https://redirect.github.com/actions/dependency-review-action/issues/1184">#1184</a> from actions/dependabot/npm_and_yarn/minor-updates-1...</li> <li><a href="https://github.com/actions/dependency-review-action/commit/dea7fcdcea402571207cc0b9994b228434c76745"><code>dea7fcd</code></a> Merge pull request <a href="https://redirect.github.com/actions/dependency-review-action/issues/1151">#1151</a> from actions/dependabot/npm_and_yarn/babel/core-7.29.7</li> <li><a href="https://github.com/actions/dependency-review-action/commit/f0c4183490714aa3aac7f3c90b8429dac8fa25f0"><code>f0c4183</code></a> Bump fast-xml-parser from 5.10.1 to 5.12.0</li> <li>Additional commits viewable in <a href="https://github.com/actions/dependency-review-action/compare/a1d282b36b6f3519aa1f3fc636f609c47dddb294...bbc44d14a204704ccc493733616cd1e93a0321ec">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
bc526683c2 |
fix(github-chat): fix initial repository import and verify UX states (#23760)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - The GitHub Code Review Bot setup wizard registers a GitHub App,
discovers its installation repositories, imports initial repository
selections, and verifies access before activation.
> - When a user or agent saves review configuration on a draft before
installing the GitHub App, the wizard skipped initial repository import
because it required `saved.revision === 0`, leaving enabled GitHub
repositories disabled in Paperclip and showing a misleading "Enable at
least one repository from the App installation." error.
> - The wizard also closed initial repository import prematurely when
GitHub returned zero repositories, failed to refresh repositories on
retry, treated removed installations (HTTP 404) as generic 422 failures
and transient repository-sync errors as empty installations, omitted the
direct GitHub App installation link on verification errors, and kept
showing "Checking GitHub access…" while idle on a failed check.
> - This pull request decouples initial repository import from review
configuration revision, recovers verifying endpoints stuck with a
pending initial import, maps removed installations and transient
repository sync errors to structured verification check codes with
validated GitHub URLs, and updates the setup verify screen to show clear
error states, accurate paired links/labels, and active retry feedback.
> - The benefit is that pre-configured GitHub review bots connect
cleanly when the App is installed, and operators get accurate error
diagnostics, direct GitHub installation and Access settings links, and
clear retry feedback when setup checks fail.
## Linked Issues or Issue Description
**What happened?**
During GitHub Code Review Bot setup
(`/apps/chat/connect?provider=github&purpose=chat&resume=...`), the
verify step failed with "Enable at least one repository from the App
installation." even when one repository was already enabled on the
GitHub App installation. The verify screen also kept displaying
"Checking GitHub access…" when idle, did not link to the GitHub App
installation URL, and did not clearly explain whether the problem was on
GitHub or in Paperclip Access settings.
**Expected behavior**
Installing the GitHub App with one or more repositories enabled should
import and enable those repositories during initial setup even if custom
review configuration was saved earlier, while preserving that saved
configuration. When verification genuinely fails for missing
repositories, missing permissions, removed/suspended installations, or
transient GitHub repository sync errors, the screen should stop polling,
replace the checking indicator with a clear error card, pair each GitHub
link with an accurate label, link to Paperclip Access settings, and show
active checking feedback only while a retry or refetch is running.
**Steps to reproduce**
1. Create a GitHub Code Review Bot draft and save custom review
configuration (`PUT /api/chat-endpoints/:id/github/configuration`),
incrementing configuration revision to `1`.
2. Register and install the GitHub App on GitHub with one repository
selected, verify webhook delivery, and link a GitHub identity.
3. Resume
`/apps/chat/connect?provider=github&purpose=chat&resume=<endpointId>`.
4. Observe that `POST /api/chat-endpoints/:id/github/setup` leaves the
repository disabled, marks `initialRepositoriesImported: true` while
leaving `initialRepositoryImportPending: true`, and returns `state:
"verify"` with "Enable at least one repository from the App
installation." and no GitHub installation link.
**Paperclip version or commit**
Reproduced on `master` at commit `e2e2265085`.
**Deployment mode**
Self-hosted server
**Agent adapter(s) involved**
Not adapter-specific (core bug)
## What Changed
- Extract initial GitHub repository import eligibility/transition logic
into `server/src/services/chat-github-initial-import.ts` and decouple
initial repository import in `server/src/services/chat-github-wizard.ts`
from `saved.revision === 0` so pre-saved review configuration no longer
blocks enabling repositories granted during initial App installation,
while keeping `saved.revision === 0` strictly for default review
configuration writes.
- Recover verifying endpoints left in the prior half-state
(`initialRepositoriesImported: true` with
`initialRepositoryImportPending: true` and `repositorySelectionSaved`
unset) without re-enabling repositories after an explicit user save
(`repositorySelectionSaved: true`).
- Keep `initialRepositoryImportPending` open when GitHub returns zero
repositories during initial import
(`server/src/services/chat-github-wizard.ts` and
`server/src/services/chat-channels/resource-reconciliation.ts`), refresh
repository inventory on wizard retry when no enabled available
repository exists, and track transient repository-sync errors so failed
`/installation/repositories` refreshes skip initial import and emit
`repositories_sync_failed` instead of misreporting
`no_installation_repositories`.
- Map HTTP 404 on `/app/installations/:id` in
`server/src/services/chat-github-management.ts` to
`installation_missing` + `managementUrl` (keeping 401/403/5xx and
transient failures separate), and enforce `!permissionsOk` precedence
(`permissions_required`) over cached repository state.
- Preserve `setup.github.managementUrl` and sibling setup fields via
atomic `jsonb_set` in
`server/src/services/chat-channels/github/app-setup.ts`.
- Centralize strict GitHub URL validation
(`safeGitHubInstallationManagementUrl`, `safeGitHubAppInstallUrl`,
`safeGitHubAppUrl`) and structured `GitHubVerificationCheckCode` values
(including `repositories_sync_failed`) in
`packages/shared/src/types/github-app-setup.ts` and
`packages/shared/src/index.ts`, with OpenAPI schema updates in
`server/src/routes/openapi.ts` and UI API types in
`ui/src/api/githubChat.ts`.
- Extract `deriveGitHubVerifyView`, `shouldPollGitHubVerify`, and
`<GitHubVerifyStatus />` into
`ui/src/pages/apps/chat/GitHubVerifyStatus.tsx` and simplify
`ui/src/pages/apps/chat/GitHubChatSetup.tsx` so verification failures
stop 5-second background polling, pair every external GitHub link with
an accurate label (including `installation_missing` fallback to
`managementUrl`), show active checking feedback only while
retrying/refetching, and link to Paperclip Access and Connection
settings.
- Add unit, integration, and UI tests in
`server/src/services/chat-github-initial-import.test.ts`,
`server/src/services/chat-github-management.test.ts`,
`server/src/__tests__/chat-channels/github-setup-and-access.integration.test.ts`,
`ui/src/pages/apps/chat/GitHubVerifyStatus.test.ts`, and
`ui/src/pages/apps/chat/GitHubChatSetup.test.tsx`.
- Update `tests/runner-e2e/source-sdk-public-inputs.json` for the shared
type and helper exports.
## Verification
Tested on Linux through revision `9a5a949098`:
- Red-green TDD proofs:
- Pre-saved review configuration and stuck verifying endpoint recovery
(`server/src/__tests__/chat-channels/github-setup-and-access.integration.test.ts`):
confirmed both failed before the wizard fix (`Received: "verify"`,
`Expected: "connected"`) and passed after.
- Removed installation HTTP 404 (`installation_missing` +
`managementUrl`) and `!permissionsOk` precedence
(`server/src/services/chat-github-management.test.ts` + integration
test): confirmed red before fix, green after.
- Transient `/installation/repositories` 503 failure with empty cache
and valid permissions (`repositories_sync_failed`, followed by
successful retry -> `connected`) and UI `installation_missing` fallback
label (`ui/src/pages/apps/chat/GitHubVerifyStatus.test.ts`,
`GitHubChatSetup.test.tsx`,
`github-setup-and-access.integration.test.ts`): confirmed red before
fix, green after.
- Server unit & OpenAPI tests on `9a5a949098`:
- `pnpm --filter @paperclipai/server exec vitest run
src/services/chat-github-management.test.ts
src/services/chat-github-initial-import.test.ts` (47/47 passed: 39
management + 8 initial-import).
- `pnpm --filter @paperclipai/server exec vitest run
src/__tests__/openapi-routes.test.ts` (59/59 passed).
- Server integration tests (`c1f234335f`; full suite running in CI on
merged head `9a5a949098`):
- `pnpm --filter @paperclipai/server exec vitest run
src/__tests__/chat-channels/github-setup-and-access.integration.test.ts
-t "recovers from an empty initial GitHub repository inventory|keeps
explicitly disabled repositories disabled|imports GitHub App
installation repositories even when review configuration was
pre-saved|recovers a verifying endpoint whose
initialRepositoriesImported|returns installation_missing with
managementUrl when the GitHub installation is removed|surfaces a
retryable repositories_sync_failed check"` (6/6 passed).
- UI tests & typecheck on `9a5a949098`:
- `pnpm --filter @paperclipai/ui exec vitest run
src/pages/apps/chat/GitHubChatSetup.test.tsx
src/pages/apps/chat/GitHubVerifyStatus.test.ts
src/pages/apps/chat/chat-ui-contract.test.ts` (27/27 passed) and
`ui/src/lib/analytics/replay-masking.test.tsx` (236/236 passed).
- `pnpm --filter @paperclipai/shared build && pnpm --filter
@paperclipai/shared typecheck && pnpm --filter @paperclipai/ui
typecheck` (passed).
- `node scripts/check-token-gates.mjs` — zero violations in touched
files.
- Release registry check on `9a5a949098`:
- `node tests/runner-e2e/source-sdk-public-inputs.mjs
|
||
|
|
ff591b7d28 |
docs: add ERR_PNPM_LOCKFILE_CONFIG_MISMATCH troubleshooting note (#13690)
<!-- Write all pull request text in Simplified Technical English (ASD-STE100): short sentences, one instruction per sentence, simple approved vocabulary, and the active voice. --> ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Its `pnpm-lock.yaml` can drift out of sync with `package.json` for short windows after a merge, tracked in the recurring issue #10393. > - A contributor who clones `master` during that window gets `ERR_PNPM_LOCKFILE_CONFIG_MISMATCH` on a fresh, unmodified checkout, with no signal that this is a known platform issue and not their own mistake. > - Two examples happened within the same day (#13683, #13645) where contributors reacted to this error by hand-fixing and committing a `pnpm-lock.yaml` diff in a normal PR, which `pr.yml` then hard-fails, wasting their time twice. > - This pull request adds a short troubleshooting entry to `CONTRIBUTING.md` that names the known issue, tells the contributor how to unblock themselves safely, and tells them explicitly not to commit the lockfile diff themselves. > - The benefit is fewer confused first-time contributors and fewer accidental lockfile-diff PRs that `pr.yml` rejects. ## Linked Issues or Issue Description Refs #13689 Refs #10393 #13689 documents a fresh occurrence of the drift this note is about (`postgres@3.4.9` / `patchedDependencies` mismatch after #13643 merged), with two ready fixes (#13645, #12115) still needing a maintainer merge. #10393 is the long-running parent issue for the underlying lockfile-drift pattern. This PR does not fix the drift itself — it only makes the failure mode legible to the next contributor who hits it while a fix is in flight. ## What Changed - `CONTRIBUTING.md`: added a "Troubleshooting: `ERR_PNPM_LOCKFILE_CONFIG_MISMATCH` on a fresh clone" entry under "Tests Must Pass", explaining that a frozen-install failure on an untouched `master` checkout is usually #10393-class drift, not a local problem, with three concrete next steps (check for an existing report/refresh PR, safely unblock locally without committing the lockfile, or file a new bug report with the exact manifest field and merge SHA). ## Verification - Docs-only change; no build or test surface affected. - Rendered the added Markdown locally to confirm the list and links format correctly. - Cross-checked the guidance against `pr.yml`'s actual behavior and against `commitperclip`'s feedback on #13683 (`"You have changes to pnpm-lock.yaml — pr.yml will hard-fail this PR ... The lockfile is regenerated automatically by the refresh bot on a schedule"`), so the "do not commit the lockfile yourself" instruction matches what the bot already enforces. ## Risks Low risk. Documentation-only change, one file, no code or workflow behavior affected. Worst case is a wording nit in review. ## Model Used Claude Sonnet 5 (Anthropic), model id `claude-sonnet-5`, standard reasoning mode, with tool use (repo research via `gh`, local diff/patch construction). ## 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 (docs-only; no tests apply) - [ ] 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: Claude Sonnet 5 <noreply@anthropic.com> |
||
|
|
8abbf84fc7 |
fix(ui): stop coalescing native runner turns across consecutive agent replies (#23799)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Agent chats and task threads assemble settled runs and reply bubbles through `TaskChatThread` and `ui/src/components/task-chat/transcript-adapter.ts`. > - Native Paperclip Runner turns set `standaloneHeader: true` and render an open chronological timeline (`beforeTurn`) above their reply bubble, including provider progress commentary such as "I'll check...". > - `coalesceSettledTurns` was designed for legacy collapsed "Worked" footers and merged back-to-back same-agent turns across intermediate agent bubbles, including native `standaloneHeader` turns and cross-task `send_chat_message` updates. > - When an agent completed several consecutive automated runs without an intervening user message, every earlier run's progress commentary moved off its original reply and piled up above the newest reply, making the commentary list stick to the bottom of the chat. > - `attachSettledTurns` also attached settled turns to any preceding same-agent bubble without checking anchor ownership, allowing unanchored native turns or turns with their own `finalResponse` to attach above an earlier reply or cross-task message. > - This pull request stops `coalesceSettledTurns` from merging `standaloneHeader` turns (and stops legacy coalescing across `fast_response` and `chatMessage` bubbles) and enforces explicit `anchorCommentId` ownership checks in `attachSettledTurns`. > - The benefit is that each native runner turn keeps its own commentary and timeline on its own reply bubble, while legacy collapsed footer coalescing keeps its existing behavior. ## Linked Issues or Issue Description **What happened?** In Agent Chat (and any task thread with consecutive native Paperclip Runner runs from the same agent), when an agent runs several times in a row without an intervening user message (for example, consecutive automated follow-up wakes and cross-task `send_chat_message` updates), every prior run's provider progress commentary (such as "I'll check the latest result...") is removed from its original reply and stacked together above the newest reply bubble. Whenever a new run finishes, the accumulated commentary block moves down again to the newest reply, making earlier "I'll check..." messages appear sticky at the bottom of the chat. **Expected behavior** Each native Paperclip Runner turn keeps its own chronological timeline and progress commentary attached only to its own reply bubble (or stays standalone in chronological order when unanchored). Earlier runs' commentary never accumulates or moves onto later replies. **Steps to reproduce** 1. Open a persistent Agent Chat or task thread for an agent running on the native Paperclip Runner with a provider that emits progress commentary (`channel: "progress"`). 2. Let the agent complete two or more consecutive runs without an intervening user message (for example, automated task-completion wakes with optional cross-task `send_chat_message` updates in between), with their settled transcripts loaded. 3. Observe that the earlier reply loses its own commentary and the newest reply renders every prior run's commentary stacked above its body. **Paperclip version or commit** Reproduced on `master` (commit `306437a2a5`). **Deployment mode** Self-hosted server ## What Changed - Require `anchorCommentId: string | null` on `SettledTurnMergeMeta` in `ui/src/components/task-chat/transcript-adapter.ts`, and populate it from `TaskChatThread` (`ui/src/components/TaskChatThread.tsx`) and `ui/src/components/design-sandbox/settled-preview-reply.ts`. - Update `coalesceSettledTurns` in `ui/src/components/task-chat/transcript-adapter.ts` so `standaloneHeader` (native Paperclip Runner) turns never coalesce across runs or replies, and so legacy turn coalescing stops at `origin: "fast_response"` and cross-task `chatMessage` bubbles. - Update `attachSettledTurns` in `ui/src/components/task-chat/transcript-adapter.ts` so turns carrying `finalResponse` never attach to a preceding bubble, cross-task `chatMessage` bubbles never accept an attached turn, and `standaloneHeader` turns attach only when `meta.anchorCommentId === prev.id`. - Add red-then-green regression tests in `ui/src/components/task-chat/transcript-adapter.test.ts` and `ui/src/components/TaskChatThread.test.tsx` covering consecutive native runner turns, interleaved cross-task `chatMessage` bubbles, `fast_response` boundaries, unanchored/mismatched `standaloneHeader` turns, and `finalResponse` turns. ## Verification - Confirmed red before the fix and green after the fix: - `pnpm vitest run ui/src/components/task-chat/transcript-adapter.test.ts ui/src/components/TaskChatThread.test.tsx` (failed 3 unit tests + 1 component test before the fix; passed after the fix). - `pnpm vitest run ui/src/components/task-chat/ ui/src/components/TaskChatThread.test.tsx ui/src/pages/IssueDetail.agentChatPanel.test.tsx` (30 test files passed, 962 passed, 1 skipped on latest head `13e71a2e58`). - `pnpm --filter @paperclipai/ui typecheck` (passed with 0 errors on latest head `13e71a2e58`). ## Risks Low risk. Legacy collapsed-footer turns (`standaloneHeader` falsy) keep their existing back-to-back coalescing behavior across consecutive replies from the same agent. Native `standaloneHeader` turns now remain scoped to their own reply bubble or chronological slot instead of merging across turns. ## Model Used - Google Gemini (Antigravity, high reasoning effort, with code inspection, file editing, test execution, and API diagnostics). ## 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 - [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> |
||
|
|
f23af2e079 |
Fix user attribution for agent lifecycle verification (#23800)
## Thinking Path > - Paperclip manages work for AI agents. > - An agent must pass execution checks before it can run work. > - Personal AI accounts require the identity of the responsible user. > - An environment change could start those checks without a user identity. > - The manual connection test still passed because it used the signed-in user. > - This pull request records the configuring user and repairs missing identity on an authorized retry. ## Linked Issues or Issue Description **What happened?** An agent could pass its manual connection test and stay paused after an environment change. Background verification had no responsible user and rejected access to the selected personal AI account. Retry now repeated the same failure. **Expected behavior** Verification started by a configuration change uses the configuring user. An authorized retry can repair an older operation that has no responsible user. Existing account sharing and task access checks still apply. **Steps to reproduce** 1. Use an agent with a personal AI connection and no saved lifecycle user or company default responsible user. 2. Move the agent to an environment that requires setup. 3. Run its manual connection test. The test passes under the signed-in user. 4. Observe failed background verification. Retry now does not repair the missing identity. **Paperclip version or commit** Reproduced on base commit `f0d4f6c3eb2e931f2f7a3e8b426f964aeb54aeee`. **Deployment mode** Authenticated hosted server. The local regression uses disposable PostgreSQL databases on macOS arm64, Node 25.6.1, and pnpm 9.15.4. ## What Changed - Record the authenticated responsible user when a configuration change starts a new lifecycle operation. Include the verified human context for an agent acting on behalf of a user. Keep the prior identity for changes without that context. - Pass the authenticated board identity to the existing retry command. Fill only missing responsibility; preserve an operation's recorded owner. - Start a new operation when repairing a missing identity. Repeat the host check under that identity. A prior attempt cannot complete the replacement operation. - Extend the lifecycle owner suites to cover human and delegated configuration attribution, retry repair, existing owners, active leases, readiness, and request-body spoofing. The existing board, agent, and company access checks remain covered. The lifecycle module owns the repair. Its internal store contract now accepts the authenticated retry identity. The routes supply those values after their existing authorization checks. No new API field, migration, provider policy, or credential permission is added. ## Verification - Before the fix, focused regressions failed in four cases: configuration attribution, board retry attribution, and retry identity repair with and without a lease. - The three owner suites passed all 141 tests after the fix. The final retry suite passed all 27 tests, including rejection of a stale host completion after identity repair. - Server typechecking passed with `node scripts/typecheck-layers.mjs` after the Runner and SDK build prerequisites. An initial test-only type error was corrected with the lifecycle operation type. - `pnpm verify --explain` returned exit 2 because the internal port type lies outside the resolved runtime test graph. Required CI will supply the listed broad typecheck, test, build, and end-to-end coverage. No full local suite pass is claimed. - Test budget, module boundaries, runtime push guard, whitespace, and local secret/PII checks passed. - CI found one stale mocked retry expectation in `agent-cross-tenant-authz-routes.test.ts`. It now checks the authenticated board user as well as the agent ID. All 18 tests in that suite pass locally. The interrupted native-runner CI job was stopped by a runner shutdown; the new revision will rerun CI. - Greptile reviewed the final `e5701b3584a57bbdde269b60439c561acca1f9b1` revision at 5/5. There are no unresolved review threads. - GitHub CI passed on `e5701b3584a57bbdde269b60439c561acca1f9b1`: all 68 reported checks are green, including typecheck, build, native Runner, serialized server, general tests, and end-to-end shards. [CI run](https://github.com/paperclipai/paperclip/actions/runs/47452634326). The initial canceled Runner attempt and stale mock failure are superseded by this successful run. - Hosted acceptance remains pending deployment of the reviewed revision. No live provider call is made by the regression tests. ## Risks - Identity repair does not change credential sharing. Verification still fails if the responsible user lacks access to the selected account. - An identity repair starts a replacement operation and fences any old lease. Existing plugin and host work must pass under that operation before readiness. - No schema or migration changes. Background retry behavior without an explicit user keeps the saved identity. ## Model Used - OpenAI `gpt-6.1-sol`, through the Codex harness in T3 Code, with xhigh reasoning and terminal tool access. 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> |
||
|
|
bf49fce70f |
chore(lockfile): refresh pnpm lockfiles (#23802)
## Thinking Path > - Paperclip uses a dependency lock for reproducible builds. > - Dependency changes on master need matching lock entries. > - Paid eval reports also pin a reviewed offline correction. > - Reports must install before paid model work starts. > - This automated PR keeps the lock and report proof together. ## Linked Issues or Issue Description **What happened?** Dependency manifests on master changed after the last committed lock refresh. **Expected behavior** Frozen installs must match those manifests. Eval reports must retain matching offline lock proof. **Steps to reproduce** Run a frozen install before and after this lock refresh. ## What Changed - Refresh the dependency lock from the manifests on master. - Refresh the sandbox provider lockfiles from their manifests on master. - Include the matching offline report correction and hashes. - Resync the SDK public source proof's lock pins from the refreshed lock. ## Verification - Pinned pnpm resolution completed with lifecycle scripts disabled. - The report proof refresh accepted the reviewed committed baseline. - The workflow rejected changes outside the lock and report proof files. ## Risks The lockfile bot merges this PR without CI or review when it verifies every added version on npm and all versions outside the harness allowlist are at least 3 days old. Otherwise the PR waits for a maintainer, and the daily refresh tries again. The bot merges only the exact commit this workflow generated from manifests already reviewed on master. Unknown report lock baselines remain blocked. This update changes no permissions or paid enable gates. ## Model Used None — generated by pnpm and the deterministic report-lock updater. ## Checklist - [x] Thinking path and problem description included - [x] Generated lock and matching report proof included - [x] Release-age gate decides between bot merge and maintainer review Co-authored-by: lockfile-bot <lockfile-bot@users.noreply.github.com>canary/v2026.1205.0-canary.891600 |
||
|
|
627e1be76d |
fix(db): give each database address time for a retransmitted SYN (#23784)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - The server reads and writes all state through one postgres.js pool
in `packages/db`.
> - Sentry recorded a production query failure. Every address of the
database host failed to connect: `connect ETIMEDOUT` on three IPv4
addresses and `ENETUNREACH` on three IPv6 addresses.
> - Node tries the addresses of a host name in turn ("happy eyeballs").
It gives each address except the last only 250 ms. The last address was
IPv6 and this host has no IPv6 route, so it failed at once.
> - Thus the connection failed after about 750 ms. One dropped SYN was
sufficient, because Linux sends the first SYN again only after 1 s. The
30 s `connect_timeout` of postgres.js did not apply.
> - This pull request gives each address 2 s by default, so a
retransmitted SYN can get an answer.
> - The benefit is that a short network stall to the database no longer
fails queries.
## Linked Issues or Issue Description
No public GitHub issue exists. This is a bug report.
**What happened?**
A server query failed with `Failed query: select ... from "companies"
...`. The cause was an `AggregateError` with code `ETIMEDOUT`. Its
errors were `ETIMEDOUT`, `ENETUNREACH`, `ETIMEDOUT`, `ENETUNREACH`,
`ETIMEDOUT`, `ENETUNREACH`. Each `ETIMEDOUT` came from Node's
per-address attempt timer (`internalConnectMultipleTimeout`), not from
postgres.js.
**Steps to reproduce**
1. Use a database host name that resolves to IPv4 addresses and IPv6
addresses, on a machine without an IPv6 route.
2. Make the IPv4 addresses drop SYN packets for less than one second.
3. Run a query that opens a new pooled connection.
**Expected behavior**
The connection waits for a retransmitted SYN. It fails only after
`connect_timeout`.
**Actual behavior**
The connection fails after about 750 ms with `AggregateError`
`ETIMEDOUT`.
## What Changed
- `patches/postgres@3.4.9.patch`: postgres.js now calls
`socket.connect({ port, host, autoSelectFamilyAttemptTimeout })` when
the new `auto_select_family_attempt_timeout` option is set. Without the
option, the call is the same as before. The change is in both the ESM
and CJS builds.
- `packages/db/src/client.ts`: new `connectAttemptTimeoutMs` client
option and `DATABASE_CONNECT_ATTEMPT_TIMEOUT_MS` variable.
`resolveDatabaseClientOptions` sets a default of 2000 ms, so all pools
from `createDb` use it. `client.ts` was already longer than 1,000 lines.
This change adds the option next to the other driver options in that
file, because they share one parser and one mapping.
- `packages/db/src/postgres-connect-attempt-timeout.test.ts`: new
regression test. It examines the arguments that the patched driver gives
to `net.Socket.prototype.connect`.
- `packages/db/src/client-options.test.ts`: tests for the new variable,
its validation, the mapping and the default.
- `docs/deploy/database.md` and `doc/DATABASE.md`: document the new
variable.
- I did not commit `pnpm-lock.yaml`. The patch hash changes, and the
lockfile policy in `doc/ci-workflows.md` lets CI and the refresh
workflow update it.
## Verification
- Red, then green: `cd packages/db && npx vitest run
src/postgres-connect-attempt-timeout.test.ts`. Before the fix, both
tests failed. The driver called `connect(1, "127.0.0.1")` with no
options. After the fix, both tests pass.
- Focused: `npx vitest run src/postgres-connect-attempt-timeout.test.ts
src/client-options.test.ts src/postgres-connection-recovery.test.ts
src/client-disconnect-replay.test.ts src/client.test.ts
src/postgres-receive-buffer.test.ts`. Result: 6 files, 48 tests pass.
Some of these tests open real connections through the patched driver.
- `pnpm exec tsc --noEmit -p packages/db` passes.
- `pnpm verify` exits 2, because the postgres patch is a global CI
input. Required CI supplies the broad coverage.
- Manual reproduction on Node v24.23.0. A script overrides `dns.lookup`
to give the production address shape: three loopback IPv4 listeners with
full accept queues, which drop SYNs, and three unroutable IPv6
addresses. The listeners start to accept after 600 ms.
- Before: `AggregateError code=ETIMEDOUT after 764ms
inner=ETIMEDOUT,ENETUNREACH,ETIMEDOUT,ENETUNREACH,ETIMEDOUT,ENETUNREACH`.
This is the same as the production error.
- After, with the 2000 ms default: the listener accepted the client's
retransmitted SYN at 1.035 s, and the TCP connection opened. The stub
was not a Postgres server, so the query then stopped at the test's 3 s
`connect_timeout`.
## Risks
- Low risk. The option changes only how long Node waits for one address
before it tries the next one. `connect_timeout` still bounds the whole
attempt.
- If an IPv6 address comes first and drops packets without an error,
each new connection can wait up to 2 s before it tries IPv4, not 250 ms.
Operators can set `DATABASE_CONNECT_ATTEMPT_TIMEOUT_MS` lower.
- Unix-socket connections (`path`) and custom `socket` factories do not
change.
- The patch hash of `postgres@3.4.9` changes. CI resolves the lockfile
for this run, and the refresh workflow commits the new lockfile after
merge.
## Model Used
- Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, used through Claude
Code with tool use (shell, file edit and test execution).
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] 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>
|
||
|
|
bbb226dcbe |
fix(ui): hide mobile task composer and bottom nav while reading back (#23693)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The task page shows a chat thread with a pinned composer and a bottom navigation bar on mobile > - On a phone, these two bars use a large part of the screen when you read earlier messages > - The old task page hid the bottom navigation when you scrolled. The new chat thread scrolls inside its own container, so that behavior stopped > - This pull request makes the thread scroller drive the auto-hide mobile chrome again, and it also hides the composer > - The benefit is more reading space when you read back through a task, with the standard mobile scroll-to-dismiss behavior ## Linked Issues or Issue Description **Is your feature request related to a problem?** On mobile, the task chat page keeps the composer and the bottom navigation on screen at all times. When you scroll up to read earlier messages, these bars cover a large part of the screen. **Describe the solution you'd like** When you scroll the thread away from the latest message, the composer and the bottom navigation slide out of view. When you scroll back toward the latest message, or reach it, they slide back. When the keyboard is open, the composer stays on screen. **Describe alternatives you've considered** Hide only the bottom navigation. This gives less reading space and does not match common mobile chat apps. ## What Changed - `useMobileNavVisibility` also tracks nested scroll containers that have `data-mobile-chrome-scroll="bottom"`. It measures distance from the bottom of the thread, so the resting zone is the latest message. It ignores the viewport growth that occurs when the composer collapses, so the bars do not flicker. An open keyboard keeps the chrome visible. - `TaskMessageScroller` sets the marker attribute on the thread scroller. - `Layout` and `Layout.production` publish `data-mobile-nav` on `#main-content`. - `index.css` slides the composer dock out with a negative bottom margin and removes the bottom padding while the chrome is hidden. The motion uses the existing mobile nav motion tokens. Reduced motion makes the change instant. - `TaskChatComposerDock` measures its height on mobile as well as in the coordinator layout. The wheel forwarding stays coordinator-only. - New unit tests: `ui/src/hooks/useMobileNavVisibility.test.tsx`. - New Storybook stories: `Tasks and conversations/Task creation and lifecycle/Task chat/Mobile chrome auto-hide` (interactive, reading back, heading back), with play assertions. ## Verification - `npx vitest run ui/src/hooks/useMobileNavVisibility.test.tsx ui/src/lib/mobile-nav-scroll` passes (11 tests). - `npx vitest run ui/src/components/Layout.mobile.test.tsx ui/src/components/TaskChatThread.test.tsx ui/src/hooks/useMobileVisualViewport.test.tsx` passes (446 tests). - I ran the three stories in Storybook at 390×844. Reading back gives `data-mobile-nav="hidden"`, the nav has `data-visible="false"`, and the dock is hidden. Heading back restores all three. - Manual: open a long task on a phone, scroll up, and confirm both bars slide away. Then scroll down and confirm they return. ## Risks - Low risk. The change applies only on mobile when a task chat shell is present. Desktop and the coordinator layout keep their current behavior. - Physical iPhone touch acceptance is still needed. Momentum scroll and rubber-band behavior can differ from the browser test. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), with tool use and code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a484eb7bf8 |
build(deps): bump novita-sandbox from 1.0.3-b2 to 2.1.5 in /scripts/typecheck-sandbox-providers (#22599)
Bumps [novita-sandbox](https://novita.ai/sandbox) from 1.0.3-b2 to 2.1.5. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
f0d4f6c3eb |
Remember model and effort in the task composer (#23698)
## Thinking Path > - Paperclip manages work for AI agents. > - People use the new-task composer to select an agent and its run settings. > - The composer remembers the last agent. A new draft opens with the agent's default model. > - People who use a different model must select it again. > - This change remembers the selected model and effort for the agent in that company. > - The next draft can use those settings as soon as the agent is selected. ## Linked Issues or Issue Description **What happened?** The new-task composer forgot the selected model when the next draft opened. It could restore an effort without restoring the model that went with it. **Expected behavior** The next new-task draft for the same agent starts with the last selected model and effort. Reset to agent default clears both choices. **Steps to reproduce** 1. Open the new-task composer and select an agent. 2. Select a different model and change the effort. 3. Close the composer and open a fresh task for the same agent. Check the model and effort. **Paperclip version or commit** Base commit: `3f882fc5895072e9a63e46df0eb0e1dad75f092b`. **Deployment mode** The regression runs in the UI component test environment. The browser preference is available in all deployment modes. ## What Changed - Save the model and effort when a person changes either value in the new-task picker. Store them in the current browser for the company, agent, and harness. - Restore the model and effort together. Keep explicit draft and task settings when present. - Share explicit effort choices and resets with conversation composers. A new-task composer uses the company-wide effort when the selected agent has no saved choices and its model supports that effort. - Keep the saved effort while model discovery is pending. When discovery confirms support, record the validated model for the next draft. A late result applies only to the draft settings that were waiting for it and preserves newer saved choices. - Cover fresh drafts, agent changes, explicit draft settings and inherited overrides, incomplete model catalogs, and reset. ## Verification - The regressions failed when a fresh composer forgot the model, when conversation composers lost the shared effort preference, and when selecting a model during discovery cleared that preference. - A reload before discovery reproduced effort loss after the initial draft had restored the effort. The regression now passes. - All 190 tests passed across the task composer, composer run settings, and recent selections suites on `d155e3e5489f8635b97e746b2d86b208ae30ed49`. - UI typecheck passed after the plugin SDK build supplied its generated declarations. - `pnpm verify` stopped before test selection because the workspace Git storage guard could not run Git. The three focused Vitest files ran directly. - GitHub CI passed on the same revision, including typecheck, build, verification, and end-to-end tests. [CI run](https://github.com/paperclipai/paperclip/actions/runs/47260521316) - The merge with master keeps recent-assignee ordering and composer preferences. All 193 focused tests and UI typecheck passed on `d8dca2d2ca6535dcab1bc2ebf2cf4c9926b37664`. GitHub CI and review are pending for this revision. ## Risks - The preference is local to the browser. If browser storage is unavailable, the composer uses the agent and draft settings. - Model access and support remain subject to validation when a run starts. ## Model Used - OpenAI GPT-6 Codex coding agent with terminal and GitHub tool access. ## 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 - [x] My branch name describes the change and contains no internal task ID - [x] I have run focused tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have documented the behavior in this PR - [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.1205.0-canary.891200 |
||
|
|
1bbf734ce6 |
fix(connections): avoid timeouts when saving agent access (#23790)
## Thinking Path > - Paperclip manages agents and the connections they can use. > - A connection's Permissions page saves its actions and agent audience together. > - The save checks the saved profile, its agent targets, and related accounts. > - Those checks repeat database reads for each target and action. They also expand the same profile for each related account. > - On a large company, the request can time out before it reaches the save transaction. > - This change bounds that work and keeps the existing permission decisions and reauthorization boundaries. ## Linked Issues or Issue Description **What happened?** Adding an agent to an existing connection leaves the page at “Saving…” until the request fails. Refreshing shows the old audience. The browser reproduction ended with HTTP 502 at the five-minute request deadline. **Expected behavior** Save an authorized agent-audience change and return the saved permissions without repeated checks across the full company and catalog. **Steps to reproduce** Use a company with many agents, several accounts under one application, and an existing connection profile with many catalog entries. Add an agent on the connection's Permissions page. The new regression covers 40 additional agents, three accounts, and 50 actions through the assembled server and real PostgreSQL. GitHub searches found no duplicate fix. ## What Changed - Share membership and grant reads inside one authorization check. Retain the existing two-second age limit. Close the scope before the handler runs and start a fresh scope for each reauthorization. - Resolve catalog references and canonical agent target IDs in batches. Keep the ordinary target lookup outside the check scope and for other UUID spellings. Continue to decide permissions for every target. - Keep the already checked profile in each related account's permission scope without expanding that profile again. Continue to check changed profiles, gateway bindings, and the referenced accounts. - Add a save regression with SQL-count bounds and a subsequent grant-revocation refusal. Cover nested, completed, and failed authorization-check scopes. ## Verification - `cd server && pnpm run typecheck` — passed, including the test-tree layers. Repeated successfully after rebasing onto current `master`. - `cd server && pnpm exec vitest run src/__tests__/connection-management.integration.test.ts src/__tests__/connection-management-delegated-policy.integration.test.ts src/__tests__/connection-management-gateway-rules.integration.test.ts src/__tests__/connection-management-delegated-tests.integration.test.ts src/__tests__/connection-management-providers.integration.test.ts src/__tests__/connection-management-gateways.integration.test.ts src/__tests__/authorization-request-reads.test.ts` — 7 files and 110 tests passed. - After rebase, repeated both `connection-management.integration.test.ts` and `authorization-request-reads.test.ts` on head `fc8b3ecf16cc`: 2 files and 31 tests passed. The 110-test run above preceded the rebase. - Red/green: the new HTTP regression first failed on 2,218 membership reads. It now saves the requested audience, retains all 50 actions, meets the query bounds, and refuses the next request after its grant scope is restricted. - Read-only replay of the affected authorization path completed with the fix. No tenant database rows were changed by the replay. - `node scripts/check-test-budget.mjs --files server/src/__tests__/connection-management.integration.test.ts server/src/__tests__/authorization-request-reads.test.ts` — passed. - `git diff --check` and Gitleaks scan of the diff — passed. The diff was also checked for private identifiers and personal data. - `pnpm verify` selected 2,008 test files through the shared authorization dependencies. That broad local run was stopped; it is not a pass. The focused suites and server typecheck above passed. Required CI must supply the broad checks on this revision. - Final head `fc8b3ecf16cc`: [CI run](https://github.com/paperclipai/paperclip/actions/runs/47445309988) passed, including typecheck, build, all general and serialized server shards, native Runner checks, and all end-to-end shards. [Greptile review](https://github.com/paperclipai/paperclip/pull/23790#issuecomment-7426956976) scored 5/5 with no actionable issues or unresolved threads. GitHub reports the branch mergeable with a clean merge state. - The fix has not been deployed. A live browser save and refresh on the new release remain to be verified after deployment. ## Risks No schema, API, or deployment-policy change. Shared authorization code is affected. Reuse is limited to one check with the existing age limit; each pre-write reauthorization reads fresh facts. The related-account checks still include profile IDs in their permission scopes. Existing delegated, scoped-grant, company-isolation, and gateway tests pass. Revert this commit to roll back. ## Model Used OpenAI GPT-6.1 Sol (`gpt-6.1-sol`) through Codex in T3 Code, with xhigh reasoning 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 (the public contract is unchanged; the internal boundaries and validation are recorded above) - [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> |
||
|
|
ab79cb9cdd |
fix(heartbeat): wait for an updating runtime before workspace setup fails (#23779)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Before a run starts its agent, Paperclip prepares the task workspace through a workspace provider plugin > - A hosted agent computer can apply an update. While it updates, it finishes its running tasks and refuses new workspaces > - The provider can only report this refusal as a generic `remote_incomplete` failure. Setup retries that failure two times in about 90 seconds (#23764), but an update can wait for running tasks for an hour > - So each new task on that computer fails setup, reports an error, and stops, although it only had to wait > - This pull request adds the closed provider reason `runtime_updating` and a separate wait lane for it. Setup holds the run and retries the same workspace every 2 minutes for up to 1 hour. The wait does not use the failure retry budget, and Paperclip does not report the run as a failure while the wait continues > - The benefit is that new tasks wait for an updating agent computer and then start, instead of failing ## Linked Issues or Issue Description Refs #23764, #23362 **What happened?** A hosted agent computer refused every new workspace preparation while it applied an update and finished its long running tasks. The provider reported each refusal as `remote_incomplete`. Setup failed each new run. Every retry of the same workspace failed the same way, and each failure was reported to error tracking. On one staging stack this happened 34 times in two hours, for two agents. **Expected behavior** A provider can say that the selected runtime is updating. Setup then holds the run and retries the same workspace after the update. The retry does not spend the failure budget. Paperclip reports the failure only if the wait ends without success. **Steps to reproduce** 1. Start a legacy run whose workspace preparation calls a workspace provider plugin. 2. Have the provider reject preparation because its runtime is updating. Before this change, the only fitting reason is `remote_incomplete`. 3. Setup records `workspace_storage_incomplete` and retries two times (30 s and 60 s). Then the task stops and the failure is reported, while the runtime is still updating. **Paperclip version or commit** `master` at `30334c1f03`. **Deployment mode** Hosted (Paperclip Cloud agent computers). A self-hosted workspace provider can use the same reason. ## What Changed - `packages/plugins/sdk/src/workspace-operation-error.ts`: add the closed reason `runtime_updating` ("the selected runtime is applying an update and refuses new workspaces until it finishes"). - `server/src/services/workspace-provider-failure.ts`: give `runtime_updating` a fixed, retryable message. Map it to the new setup code `workspace_runtime_updating`. Add `WORKSPACE_RUNTIME_UPDATING_RETRY` (reason `runtime_update_wait`, 30 attempts, 2 minutes apart). Add the code to `WORKSPACE_STORAGE_RETRY_CODES`, so the existing deferred error report also covers it. - `server/src/services/heartbeat/run-completion.ts` and `heartbeat/retries.ts`: schedule a failed pre-dispatch `workspace_runtime_updating` run with the wait lane, and use the lane's budget in `failedRunRetryBudgetSpent`. This is the same pattern as `runner_revision_mismatch`. - `server/src/services/execution-recovery-attempt.ts`, `modules/run-dispatch/domain/wake-context.ts`, `task-interruption-presentation.ts`: `runtime_update_wait` is an uncharged preparation wait. An answered interaction keeps its continuation through the wait, and the task shows a wait, not a failure. - `failed-preparation-retry.ts`, `legacy-execution-recovery.ts`, `recovery/service.ts`, `agent-task-run-telemetry.ts`: treat `workspace_runtime_updating` like the other transient workspace preparation codes. - `recovery/stranded-notice.ts`: add a notice for a wait that ended without success ("Agent computer was still updating"). ## Verification - Red before the change (test files only, source reverted): 9 new tests fail in `workspace-provider-failure.test.ts`, `execution-recovery-attempt.test.ts`, `heartbeat/retries.test.ts`, `heartbeat/run-completion.test.ts` and `run-failure-report-sandbox-resume.test.ts`. - `pnpm verify` did not run: its workspace link repair failed for `plugin-orchestration-smoke-example`, before test selection. The SDK change also affects many packages, so CI supplies the broad coverage. - Green after the change: the same 5 files pass (267 tests). Related files also pass: `task-interruption-automatic-path`, `task-interruption-query`, `wake-context`, `stranded-notice-remote-workspace-environment`, `task-interruption-presentation` (181 tests); `agent-task-run-telemetry`, `legacy-continuation-authority`, `heartbeat-retry-scheduling` (179 tests); plugin SDK `workspace-operation-error`, `workspace-provider` (20 tests). - `pnpm --dir server typecheck` and `pnpm --filter @paperclipai/plugin-sdk typecheck`: pass (server typecheck run with `PAPERCLIP_TYPECHECK_LOW_MEMORY=1` because of a local memory limit). - CI supplies the full suite. - Review follow-up (`cf73701742`, `d7540263bd`): update waits keep their count in `executionRetryAccounting` (`runtimeUpdateWaits`) across other retry lanes. An answered interaction whose update wait runs out is escalated like an exhausted storage wait. The pinned SDK input registry is refreshed. The two new tests failed before the fix and pass after it. `execution-recovery-attempt`, `heartbeat/retries`, `workspace-provider-failure` and `run-failure-report-sandbox-resume` pass (83 tests). `heartbeat/run-completion` and `modules/wake-queue` pass (577 tests). `tests/runner-e2e/source-sdk-public-inputs` passes (13 tests). `pnpm --dir server typecheck` passes. ## Risks - Low risk. No schema, migration, API route or wire protocol shape change. The reason set is closed and validated on both sides. An older Core that receives `runtime_updating` treats it as an unknown provider failure, as before. - A provider must not send `runtime_updating` before the new SDK is available to it. The SDK constructor rejects an unknown reason, so a provider update has to follow this change. - The wait is a bounded scheduled retry after a real refusal, not idle polling: at most 30 retries in one hour per waiting run. Each retry is one workspace preparation call. When the wait ends without success, the run is reported and the task shows a named notice with a Retry action. - Only legacy runs that fail before provider dispatch use the lane. Started and native runs keep `setup_failed`. ## Model Used - Anthropic Claude Opus 5.5 (`claude-opus-5-5`), via Claude Code with tool use (code search, file edits, shell, local test execution, GitHub CLI). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: paperclipbugbot <356415228+paperclipbugbot@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
14f23fef03 |
fix(plugins): offer direct Buffer setup when Composio has no sign-in link (#23782)
## Thinking Path > - Paperclip helps people manage AI agents for work. > - Plugins lets people connect tools to their agents. > - Some tool connections use the Composio gateway. > - Buffer requires a custom OAuth app in the Composio project that serves the session. > - When that gateway returns no sign-in link, Plugins can help the user open Buffer's own MCP setup. > - This pull request opens the existing connection form with the Buffer name and endpoint filled in. ## Linked Issues or Issue Description **What happened?** Plugins showed a generic error when Composio returned no Buffer sign-in link. **Expected behavior** The user can open the direct Buffer setup from the error. For other apps, the user can open Composio's app settings. **Steps to reproduce** In Plugins, select Buffer and choose a saved Composio gateway without a configured Buffer OAuth app. Select Continue. **Additional context** [Buffer's MCP setup](https://developers.buffer.com/guides/integrations/other-ai-tools.html) accepts a Buffer API key. [Composio's Buffer setup](https://composio.dev/toolkits/buffer) requires a custom OAuth app. [Composio auth configs belong to one project](https://docs.composio.dev/kb/guide/dashboard-auth-configs-navigation). Related prior work: Refs #19408. ## What Changed - Return a machine-readable code when Composio returns no sign-in link. - Offer the direct Buffer MCP form with its official address. Offer a link to Composio app settings for other toolkits. - Clear the old sign-in link when the user requests a new one. Keep the link if the completion check fails. - Document the setup options. Refresh the shared SDK test input pins. ## Verification - Reproduced the missing-link API response with an embedded database and a Composio response fixture. The new test failed on the old server. - Passed 13 focused tests across the Composio route, Plugins setup dialog, and the MCP URL prefill flow. The replacement-link test reproduced the stale link before the fix. A second test checks that the sign-in link stays available after a failed completion check. - Sent an unauthenticated MCP initialize request to Buffer's documented endpoint and confirmed that it requires authentication. A real Buffer consent or API-key test needs a Buffer account with access. ## Risks - Low risk. The new action opens the existing MCP setup page. The user chooses the credentials and access before Paperclip creates the connection. - A valid Composio sign-in link still takes the user through Composio. ## Model Used - OpenAI GPT-6 (Codex), with repository, test, and GitHub 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 described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links - [x] My branch name describes the change - [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 <noreply@paperclip.ing> |
||
|
|
4ba596d268 |
fix(slack): recognize pre-pool Cloud stacks in managed Slack setup (#23783)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - The Slack chat connector supports managed one-click setup on
Paperclip Cloud instances when
`PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` is set.
> - `createSlackManagerGrants` checked only `getCloudRuntimeIdentity()`
to detect a Cloud instance.
> - Pre-pool Cloud stacks have `isCloudManagedInstance() === true` (the
canonical Cloud predicate used by `/api/health`) but do not have a
persisted warm-pool runtime identity, so `getCloudRuntimeIdentity()`
returns `null`.
> - As a result, `/api/companies/:companyId/chat-slack/setup-options`
returned `defaultMethod: "automatic"` and `managedAvailable: false` on
those stacks, hiding managed Slack setup.
> - This pull request checks `Boolean(getCloudRuntimeIdentity()) ||
isCloudManagedInstance()` in `manager-grants.ts` and adds unit tests for
pre-pool Cloud stacks, self-hosted instances, and disabled flags.
> - The benefit is that managed Slack setup works consistently across
all Paperclip Cloud stacks while self-hosted instances remain completely
excluded.
## Linked Issues or Issue Description
**What happened?**
On a Paperclip Cloud stack without a warm-pool runtime identity record,
`GET /api/companies/:companyId/chat-slack/setup-options` returns
`{"defaultMethod":"automatic","managedAvailable":false,"workspaces":[]}`
even when `enableChatConnectors` is enabled,
`PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` is set, and the Cloud
Connector Broker advertises `slack.manager`.
**Expected behavior**
Any Paperclip Cloud stack where `isCloudManagedInstance()` is `true`,
`PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true`, and Cloud Connector Broker
credentials are present should select `defaultMethod: "managed"` and
query the broker for `slack.manager` availability. Self-hosted instances
must continue to stay on `defaultMethod: "automatic"`.
**Steps to reproduce**
1. Run a Paperclip Cloud stack that sets
`PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN` (or `PAPERCLIP_MANAGED_CONFIG`)
without a persisted warm-pool `cloud-runtime-identity/v1` row.
2. Enable `enableChatConnectors` and set
`PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` with valid
`PAPERCLIP_CLOUD_CONNECTOR_*` credentials.
3. Call `GET /api/companies/:companyId/chat-slack/setup-options`.
Observe `defaultMethod: "automatic"` and `managedAvailable: false`.
**Paperclip version or commit**
`306437a2a5` (and `7e025ae65f`)
## What Changed
- Updated `server/src/services/connectors/slack/setup/manager-grants.ts`
to compute `const isCloud = Boolean(getCloudRuntimeIdentity()) ||
isCloudManagedInstance();` instead of relying only on
`getCloudRuntimeIdentity()`.
- Added
`server/src/services/connectors/slack/setup/manager-grants.test.ts`
verifying that:
- Pre-pool Cloud stacks (`isCloudManagedInstance()` true, no runtime
identity) select `defaultMethod() === "managed"` when
`PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true`.
- Self-hosted instances stay on `"automatic"` even if
`PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` is set.
- Cloud stacks stay on `"automatic"` when
`PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED` is not `"true"`.
## Verification
- `pnpm --filter @paperclipai/server exec vitest run
src/services/connectors/slack/setup/manager-grants.test.ts
src/__tests__/slack-development-manager.test.ts` — 11/11 passed.
- `pnpm --filter @paperclipai/server typecheck` — passed with 0 errors.
## Risks
- Low risk: `isCloudManagedInstance()` is already the canonical Cloud
predicate across the server (including `/api/health`). Self-hosted
instances never set `PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN` or
`PAPERCLIP_MANAGED_CONFIG`, and managed Slack setup still requires
`PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` plus valid
`PAPERCLIP_CLOUD_CONNECTOR_*` credentials and an active broker
`slack.manager` profile.
## 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
- [ ] 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
|
||
|
|
054b4e1395 |
fix(ui): remove the Needs you description from the Inbox header (#23781)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The Inbox shows the decisions that need a person, in the "Needs you" folder > - The Inbox header shows a line under the folder tabs: "Review open requests and decide what happens next." > - This line does not give new information. It adds noise to the header. > - This pull request removes that line from the "Needs you" folder only > - The benefit is a cleaner Inbox header. Waiting and History keep their helpful descriptions. ## Linked Issues or Issue Description **Is your feature request related to a problem? Please describe.** The Inbox header shows the text "Review open requests and decide what happens next." under the folder tabs. The text repeats what the "Needs you" tab already says. **Describe the solution you'd like** Remove the text from the "Needs you" folder. Do not show an empty paragraph. **Describe alternatives you've considered** Remove the descriptions of all folders. We did not do this, because the Waiting and History descriptions explain what those folders contain. ## What Changed - `CoordinatorNeedsYou.tsx`: the "Needs you" folder has no description. The description field is now optional, and the header shows the paragraph only when the folder has a description. - `CoordinatorNeedsYou.toolbar.test.tsx`: the test checks that "Needs you" shows no description and that "Waiting" still shows its description. ## Verification - `cd ui && npx vitest run src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx` — 13/13 pass. - Red-green: with the old component, the new assertion fails (`expected 'Review open requests and decide what …' to be null`). With the fix, it passes. - `cd ui && npx tsc --noEmit -p .` reports no errors in the changed files. ## Risks - Low risk. This is a text-only UI change in one component. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), via 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 - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: devinfoley <139239+devinfoley@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>canary/v2026.1204.0-canary.890700 |
||
|
|
ca0d650f8c |
build(deps-dev): bump vitest from 4.1.12 to 5.1.2 in /scripts/typecheck-sandbox-providers (#22600)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 4.1.12 to 5.1.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/vitest-dev/vitest/releases">vitest's releases</a>.</em></p> <blockquote> <h2>v5.1.2</h2> <h3> 🐞 Bug Fixes</h3> <ul> <li>Report global setup errors instead of "no test files" - by <a href="https://github.com/jszumski"><code>@jszumski</code></a> and <strong>Claude Opus 5.5</strong> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12031">vitest-dev/vitest#12031</a> <a href="https://github.com/vitest-dev/vitest/commit/b7572c1e6"><!-- raw HTML omitted -->(b7572)<!-- raw HTML omitted --></a></li> <li>Warn when projects attach the same file - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12043">vitest-dev/vitest#12043</a> <a href="https://github.com/vitest-dev/vitest/commit/5f8847345"><!-- raw HTML omitted -->(5f884)<!-- raw HTML omitted --></a></li> <li><strong>browser</strong>: <ul> <li>Don&<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/39">#39</a>;t fail trace when locator has no match for non-playwright providers - by <a href="https://github.com/hi-ogawa"><code>@hi-ogawa</code></a> and <strong>Claude Opus 5.5</strong> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11975">vitest-dev/vitest#11975</a> <a href="https://github.com/vitest-dev/vitest/commit/f05003327"><!-- raw HTML omitted -->(f0500)<!-- raw HTML omitted --></a></li> <li>Save failure screenshots per instance - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12042">vitest-dev/vitest#12042</a> <a href="https://github.com/vitest-dev/vitest/commit/e0e8e0000"><!-- raw HTML omitted -->(e0e8e)<!-- raw HTML omitted --></a></li> <li>Mock assets and computed dynamic imports - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11954">vitest-dev/vitest#11954</a> <a href="https://github.com/vitest-dev/vitest/commit/c6ad97dec"><!-- raw HTML omitted -->(c6ad9)<!-- raw HTML omitted --></a></li> </ul> </li> <li><strong>cli</strong>: <ul> <li>Disallow --changed in vitest related - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12038">vitest-dev/vitest#12038</a> <a href="https://github.com/vitest-dev/vitest/commit/b3a803b1f"><!-- raw HTML omitted -->(b3a80)<!-- raw HTML omitted --></a></li> </ul> </li> <li><strong>coverage</strong>: <ul> <li>Prevent duplicate metrics caused by source map end column differences - by <a href="https://github.com/AriPerkkio"><code>@AriPerkkio</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12040">vitest-dev/vitest#12040</a> <a href="https://github.com/vitest-dev/vitest/commit/45d199c58"><!-- raw HTML omitted -->(45d19)<!-- raw HTML omitted --></a></li> </ul> </li> <li><strong>deps</strong>: <ul> <li>Update all non-major dependencies - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12050">vitest-dev/vitest#12050</a> <a href="https://github.com/vitest-dev/vitest/commit/ff6b4275f"><!-- raw HTML omitted -->(ff6b4)<!-- raw HTML omitted --></a></li> </ul> </li> <li><strong>mocker</strong>: <ul> <li>Transform a factory-mocked module once - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12027">vitest-dev/vitest#12027</a> <a href="https://github.com/vitest-dev/vitest/commit/8b0ca603a"><!-- raw HTML omitted -->(8b0ca)<!-- raw HTML omitted --></a></li> </ul> </li> <li><strong>pool</strong>: <ul> <li>Handle failed forks worker start on bun - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12039">vitest-dev/vitest#12039</a> <a href="https://github.com/vitest-dev/vitest/commit/4aec89426"><!-- raw HTML omitted -->(4aec8)<!-- raw HTML omitted --></a></li> </ul> </li> <li><strong>snapshot</strong>: <ul> <li>Remove new snapshots of a failed retry - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12052">vitest-dev/vitest#12052</a> <a href="https://github.com/vitest-dev/vitest/commit/2123874a4"><!-- raw HTML omitted -->(21238)<!-- raw HTML omitted --></a></li> </ul> </li> <li><strong>ui</strong>: <ul> <li>Ensure <code>detailsPosition: bottom</code> for auto-opened trace view - by <a href="https://github.com/hi-ogawa"><code>@hi-ogawa</code></a> and <strong>Claude Opus 5.5</strong> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12016">vitest-dev/vitest#12016</a> <a href="https://github.com/vitest-dev/vitest/commit/366ac633b"><!-- raw HTML omitted -->(366ac)<!-- raw HTML omitted --></a></li> </ul> </li> </ul> <h3> 🏎 Performance</h3> <ul> <li>Read external source maps once per run - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12106">vitest-dev/vitest#12106</a> <a href="https://github.com/vitest-dev/vitest/commit/b5a553395"><!-- raw HTML omitted -->(b5a55)<!-- raw HTML omitted --></a></li> <li><strong>expect</strong>: Reuse the key array in deep equality - by <a href="https://github.com/camc314"><code>@camc314</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12104">vitest-dev/vitest#12104</a> <a href="https://github.com/vitest-dev/vitest/commit/f88ab6cc3"><!-- raw HTML omitted -->(f88ab)<!-- raw HTML omitted --></a></li> <li><strong>mocker</strong>: Find dynamic imports with es-module-lexer - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/12028">vitest-dev/vitest#12028</a> <a href="https://github.com/vitest-dev/vitest/commit/5812ec58f"><!-- raw HTML omitted -->(5812e)<!-- raw HTML omitted --></a></li> </ul> <h5> <a href="https://github.com/vitest-dev/vitest/compare/v5.1.1...v5.1.2">View changes on GitHub</a></h5> <h2>v5.1.1</h2> <h3> 🚀 Features</h3> <ul> <li><strong>cache</strong>: Add fs module cache env variables - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11859">vitest-dev/vitest#11859</a> <a href="https://github.com/vitest-dev/vitest/commit/708c05da0"><!-- raw HTML omitted -->(708c0)<!-- raw HTML omitted --></a></li> </ul> <h3> 🐞 Bug Fixes</h3> <ul> <li>Rerun on file changes after a config restart - by <a href="https://github.com/magurotuna"><code>@magurotuna</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11772">vitest-dev/vitest#11772</a> and <a href="https://redirect.github.com/vitest-dev/vitest/issues/11829">vitest-dev/vitest#11829</a> <a href="https://github.com/vitest-dev/vitest/commit/289caab9c"><!-- raw HTML omitted -->(289ca)<!-- raw HTML omitted --></a></li> <li>Avoid leaking the context expect - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11845">vitest-dev/vitest#11845</a> <a href="https://github.com/vitest-dev/vitest/commit/3c967a7b7"><!-- raw HTML omitted -->(3c967)<!-- raw HTML omitted --></a></li> <li>Report fixture teardown errors once - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11857">vitest-dev/vitest#11857</a> <a href="https://github.com/vitest-dev/vitest/commit/6b167eb79"><!-- raw HTML omitted -->(6b167)<!-- raw HTML omitted --></a></li> <li>Improve diffs for asymmetric matchers - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11855">vitest-dev/vitest#11855</a> <a href="https://github.com/vitest-dev/vitest/commit/86775420f"><!-- raw HTML omitted -->(86775)<!-- raw HTML omitted --></a></li> <li>Apply --shard before the test run starts - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11846">vitest-dev/vitest#11846</a> <a href="https://github.com/vitest-dev/vitest/commit/e5c80b775"><!-- raw HTML omitted -->(e5c80)<!-- raw HTML omitted --></a></li> <li>Reset local expect state between retries for <code>expect.assertions/hasAssertions</code> - by <a href="https://github.com/hi-ogawa"><code>@hi-ogawa</code></a> and <strong>Claude Opus 5.5</strong> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11900">vitest-dev/vitest#11900</a> <a href="https://github.com/vitest-dev/vitest/commit/50dcdb373"><!-- raw HTML omitted -->(50dcd)<!-- raw HTML omitted --></a></li> <li>Sort test files before the seeded shuffle - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11926">vitest-dev/vitest#11926</a> <a href="https://github.com/vitest-dev/vitest/commit/3aa3045a9"><!-- raw HTML omitted -->(3aa30)<!-- raw HTML omitted --></a></li> <li>Tear down fixture contexts one at a time - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11956">vitest-dev/vitest#11956</a> <a href="https://github.com/vitest-dev/vitest/commit/5712b5fd2"><!-- raw HTML omitted -->(5712b)<!-- raw HTML omitted --></a></li> <li>Count merged errors in the error divider - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11955">vitest-dev/vitest#11955</a> <a href="https://github.com/vitest-dev/vitest/commit/4bc4f86e8"><!-- raw HTML omitted -->(4bc4f)<!-- raw HTML omitted --></a></li> <li>Match <code>-</code> and <code>.</code> in <code>noExternal</code> wildcards - by <a href="https://github.com/hi-ogawa"><code>@hi-ogawa</code></a> and <strong>Claude Opus 5.5</strong> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11978">vitest-dev/vitest#11978</a> <a href="https://github.com/vitest-dev/vitest/commit/efba8cbfe"><!-- raw HTML omitted -->(efba8)<!-- raw HTML omitted --></a></li> <li>Give each test attempt a new <code>signal</code> - by <a href="https://github.com/sheremet-va"><code>@sheremet-va</code></a> in <a href="https://redirect.github.com/vitest-dev/vitest/issues/11998">vitest-dev/vitest#11998</a> <a href="https://github.com/vitest-dev/vitest/commit/77a306757"><!-- raw HTML omitted -->(77a30)<!-- raw HTML omitted --></a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/vitest-dev/vitest/commit/a718e12109d7b98bac10c9f376dfeb6fe1ec309f"><code>a718e12</code></a> chore: release v5.1.2 (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12109">#12109</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/5f8847345ccae6a45b180599ab3c6b528985b9f1"><code>5f88473</code></a> fix: warn when projects attach the same file (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12043">#12043</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/b5a553395132d0f61b0c03377055e12700db456a"><code>b5a5533</code></a> perf: read external source maps once per run (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12106">#12106</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/b3a803b1ff134c198f0c00a7e05ce34ae40df7d2"><code>b3a803b</code></a> fix(cli): disallow --changed in vitest related (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12038">#12038</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/4aec89426c93b7a0e5627ae5ee32701f3a817ffe"><code>4aec894</code></a> fix(pool): handle failed forks worker start on bun (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12039">#12039</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/b7572c1e61fe52dfc0271408b67a02d240dbc535"><code>b7572c1</code></a> fix: report global setup errors instead of "no test files" (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12031">#12031</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/0c418880a48f220d89a56763fcc13373446f39ed"><code>0c41888</code></a> refactor: simplify console task id lookup (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12009">#12009</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/161e25f663a838f6a30890f8a6827ff83ff1b3c7"><code>161e25f</code></a> chore: release v5.1.1 (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12004">#12004</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/9b87492f77992bcff4356afa4dad91028964c2c1"><code>9b87492</code></a> fix: throw timeout error classes instead of Error (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/12003">#12003</a>)</li> <li><a href="https://github.com/vitest-dev/vitest/commit/77a306757d6291a0ce6f6adb7142e39886f08ffe"><code>77a3067</code></a> fix: give each test attempt a new <code>signal</code> (<a href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11998">#11998</a>)</li> <li>Additional commits viewable in <a href="https://github.com/vitest-dev/vitest/commits/v5.1.2/packages/vitest">compare view</a></li> </ul> </details> <br /> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
039e4c0a57 |
fix(native): stop paperclip_block from reassigning tasks and audit assignee changes (#23780)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Native Paperclip Runner agents report blockers with `paperclip_block`, which includes a descriptive `blocker.owner` field (`kind` and `name`). > - PR #22962 made `paperclip_block` reassign `issue.assigneeAgentId` whenever `blocker.owner` named another company agent, including when the task was only waiting on a durable dependency (`durable_dependency_blocker_bound`). > - That collided directly with Paperclip's own execution prompt (which instructs agents waiting on a child or prerequisite task to call `set_dependencies` and then `paperclip_block` naming the dependency's agent), silently transferred task ownership with no return path, could cross multi-user AI credential boundaries, and omitted the assignee change from the `issue.updated` activity record. > - This pull request stops `paperclip_block` from reassigning tasks at all, preserves the original assignee on dependency-gated blocks, guides agents toward explicit delegation/reassignment tools (`create_task` + `set_dependencies`, `reassign_task`, `handoff_case`) at report time when no dependency exists, and records assignee field changes in native `issue.updated` activity details. > - The benefit is that waiting on a dependency resumes the original owner cleanly, ownership transfers stay explicit and auditable, and native assignee changes (such as configured review stages) appear in task activity receipts. ## Linked Issues or Issue Description Refs #22962, #21265, #22140, #22438. **What happened?** When an agent linked a prerequisite task via `set_dependencies` and followed the execution prompt by calling `paperclip_block` with the prerequisite's agent as `blocker.owner`, `status-arbiter.ts` emitted `handoffAgentId` and `status-decision-committer.ts` permanently overwrote `issue.assigneeAgentId` to that other agent. The same silent reassignment also occurred on non-dependency `current_track` and `task_wide` blocks naming another agent. Because `status-decision-committer.ts` did not record `previousAssigneeAgentId` / `assigneeAgentId` in `issue.updated` details, the assignee change was invisible in task history, and handing a task to an agent bound to another user's unshared AI credential caused repeated `ai_connection_credential_not_shared` wake failures. **Expected behavior** `blocker.owner` in `paperclip_block` is descriptive and never silently reassigns a task: - On dependency-gated blocks (`durable_dependency_blocker_bound`), the reporting agent remains `assigneeAgentId` and `unblockDescriptor.owner` so dependency completion wakes the original owner. - On non-dependency blocks naming another agent, report-time feedback rejects the report with actionable guidance pointing to `create_task` + `set_dependencies`, `reassign_task` (or `handoff_case`), or `blocker.owner.kind: "user"`. If such a report still reaches finalization, it stays blocked for `"board"` without changing `assigneeAgentId` or waking the other agent. - Whenever any committed native status decision changes `assigneeAgentId` or `assigneeUserId` (for example when starting a configured review stage), the `issue.updated` activity row records `previousAssigneeAgentId`, `assigneeAgentId`, `previousAssigneeUserId`, `assigneeUserId`, and `changes`. **Steps to reproduce** 1. Create two agents in one company (Agent A and Agent B), an upstream task assigned to Agent B, and a parent task assigned to Agent A. 2. Link the upstream task as a dependency of the parent task (`blocks`). 3. Have Agent A call `paperclip_block` with `blocker.owner: { kind: "agent", name: "<Agent B>" }`, then finalize Agent A's run. 4. Observe on `master` that the parent task's `assigneeAgentId` is silently overwritten from Agent A to Agent B with no assignee-change fields in the `issue.updated` activity log. ## What Changed - **`server/src/services/native-runtime/status-arbiter.ts`**: - Remove `handoffAgentId`, `blockerHandoffLocked`, and `resolveBlockerHandoff` so `paperclip_block` never reassigns tasks. - On `durable_dependency_blocker_bound`, keep `unblockDescriptor.owner` on `{ agentId: input.agentId }` whenever `blocker.ownerKind === "agent"` (including another agent or an unresolved/deprecated agent label), while preserving named human/board owners (`#22438`). - On non-dependency `task_wide` and `current_track` blocks naming another agent, bind `unblockDescriptor.owner` to `"board"` without reassigning, waking the other agent, or re-waking the reporting agent. - **`server/src/services/native-runtime/native-completion-feedback.ts`**: - Check dependency readiness (memoized per call) before validating `blocker.owner.kind === "agent"`: allow dependency-gated blocks naming the dependency's agent descriptively, and reject non-dependency blocks naming another or unknown agent with actionable guidance pointing to `create_task` + `set_dependencies`, `reassign_task` / `handoff_case`, or `blocker.owner.kind "user"`. - **`server/src/services/native-runtime/native-run-finalizer.ts` & `server/src/services/native-runtime/status-decision-committer.ts`**: - Remove blocker-owner handoff checks and `assigneeAgentId` handoff patching during finalization and commit. - Record `previousAssigneeAgentId`, `assigneeAgentId`, `previousAssigneeUserId`, `assigneeUserId`, and `changes` on native `issue.updated` activity events whenever a committed native status decision changes the task assignee. - **Cleanup**: - Remove unused `server/src/services/native-runtime/blocker-owner-handoff.ts` and `server/src/modules/external-agents/run-authorizer.ts` (and its export from `server/src/modules/external-agents/index.ts`). - **Tests**: - Update `server/src/services/native-runtime/status-arbiter.test.ts` and `server/src/__tests__/native-status-arbiter-corpus.test.ts` to cover dependency-gated owner preservation (including chat-bound tasks and unmatched agent labels) and non-dependency rejection + board fallback without reassignment. - Extend `server/src/services/native-runtime/native-execution-policy-review-stage.test.ts` to verify `issue.updated` activity details record assignee transitions for both human and agent configured review stages. ## Verification - **RED-before-fix (on base `c5a705ce92`)**: - `pnpm --filter @paperclipai/server exec vitest run src/services/native-runtime/status-arbiter.test.ts` -> 3 failed | 31 passed (34) (failed because `handoffAgentId` and `{ agentId: "reviewer" }` were emitted on dependency and non-dependency blocks). - **GREEN after fix**: - `pnpm --filter @paperclipai/server exec vitest run src/services/native-runtime/blocker-owner.test.ts src/services/native-runtime/evidence-classifier.test.ts src/services/native-runtime/status-arbiter.test.ts` -> 48 passed (48). - `pnpm --filter @paperclipai/server exec vitest run --hookTimeout=120000 src/services/native-runtime/native-execution-policy-review-stage.test.ts` -> 16 passed (16). - `pnpm --filter @paperclipai/server exec vitest run --hookTimeout=120000 src/__tests__/native-status-arbiter-corpus.test.ts -t "rejects a non-dependency|keeps accepting a human-owned|preserves the original assignee on a dependency-gated"` -> 5 passed (5 selected; 169 skipped). - `pnpm --filter @paperclipai/server exec vitest run --hookTimeout=120000 src/services/native-runtime/native-agent-blocker.integration.test.ts` -> 17 passed (17). - `pnpm --filter @paperclipai/server typecheck` -> PASS across all 7 layers. - `node scripts/check-module-boundaries.mjs` -> PASS. - `node scripts/check-test-budget.mjs --base origin/master` -> PASS (113 nightly suites validated, 3 test file(s) checked). - `pnpm --filter @paperclipai/server exec vitest run ../tests/runner-e2e/chat-catalog-domains/internal-timeline-native-milestone.test.ts` -> 33 passed (33). - **CI & Reviews on final head `d7c54badca`**: - GitHub Actions PR workflow run [`47436506671`](https://github.com/paperclipai/paperclip/actions/runs/47436506671): `ci / verify` PASS, `ci / e2e` PASS, all 84 checks green/neutral (including Socket Security, Superagent Security Scan, and Snyk). - Greptile Review: `5/5` (zero open comments); Ponytail Paperclip Review: `5/5`; Feynman Nuclear Review: `5/5`. ## Risks - **Intentional behavior change from #22962**: Agents that previously relied on `paperclip_block` naming another agent without a dependency to silently reassign a task will now receive actionable report-time feedback directing them to `create_task` + `set_dependencies` or `reassign_task` (and any already-saved result reaching finalization will fall back to `"board"` without reassigning). - **Upgrade safety**: Existing `chat-control-recovery-stop.ts` read-only ancestry checks for historical `bind_blocker` wakes are preserved. Self-owned blocker continuations (#22140) and named human blocker routing (#22438) are preserved unchanged. - No database schema changes or migrations. ## Model Used - Google Gemini (Antigravity, high reasoning mode with code execution 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> |
||
|
|
306437a2a5 |
fix(ui): support rich list editing and keyboard handling in all composers (#23766)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Users write instructions, replies, and chat messages in the UI composers (`TaskChatComposer`, `IssueChatComposer`, `CommentThread`, `ChatComposer`, and `MarkdownEditor`). > - Enter now submits messages by default and Shift+Enter inserts a newline. > - In rich editors, Shift+Enter inserted a soft `<br>` line break instead of a new paragraph or list item, which blocked markdown list shortcuts and stopped bulleted and numbered lists from continuing. > - Inside lists, Tab inserted a literal tab character when the caret was not at column 0, Shift+Tab triggered work-mode cycling in `TaskChatComposer` instead of dedenting, and removing a parent item left orphaned nested lists. > - Plain-text textarea composers (`ChatComposer` and the `MarkdownEditor` raw fallback) also lacked list continuation, Tab indent, Shift+Tab dedent, and Backspace marker removal. > - This pull request adds unified rich and plain-text list keyboard handling and nested list styling across all composers. > - The benefit is smooth creation, continuation, deletion, indentation, and dedentation of bulleted, numbered, and checklist items in every composer. ## Linked Issues or Issue Description No pre-existing public GitHub issue was found after searching open issues and PRs. **What happened?** When a composer uses Enter to submit and Shift+Enter to insert a newline, typing `- ` or `1. ` after a newline does not start a rich list because Shift+Enter inserts a soft `<br>` break inside the same paragraph. Inside an existing list, Shift+Enter inserts a `<br>` inside the same `<li>` instead of adding the next list item. Pressing Tab mid-item inserts a tab character instead of indenting, pressing Shift+Tab inside `TaskChatComposer` cycles work mode instead of dedenting the list item, and plain-text textarea composers provide no list keyboard shortcuts. **Expected behavior** In every composer, users can start bulleted and numbered lists after a newline, add new list items with the active newline shortcut (Shift+Enter in Enter-to-submit mode, Enter in Cmd/Ctrl+Enter mode), indent with Tab, dedent or un-list with Shift+Tab, and delete or exit list items cleanly with Backspace or an empty-item newline. **Steps to reproduce** 1. Open any Enter-to-submit composer (for example, the task composer, new task modal, comment composer, or board chat). 2. Type a line of text, press Shift+Enter, and type `- first item`. 3. Press Shift+Enter to add a second item, Tab to indent, Shift+Tab to dedent, and Backspace to remove the bullet. **Paperclip version or commit** `master` (`62821e8766`) **Deployment mode** Local dev (pnpm dev) ## What Changed - Added `ui/src/lib/list-editing.ts` (`listEditingPlugin`, `registerListEditingCommands`, `isSelectionInsideList`) for MDXEditor/Lexical composers: - Maps Shift+Enter to `INSERT_PARAGRAPH_COMMAND` when `submitKey === "enter"` so markdown list shortcuts work after newlines, list items continue cleanly, and empty list items dedent or exit. - Preserves Shift+Enter as a soft line break when `submitKey === "mod-enter"` and reacts dynamically if the preference changes. - Handles Tab indent and Shift+Tab dedent (or lift to paragraph at top level) from any caret offset inside a list item, snaps original indent depths so multi-level Shift+Tab dedents each selected item by one level, and prevents orphaned nested lists when indenting the first item or removing/exiting a parent item. - Added `ui/src/lib/textarea-list-editing.ts` (`applyTextareaListKeyDown`, `isTextareaSelectionInList`) for plain-text textarea composers: - Continues unordered, ordered (with sibling renumbering), and checklist lines on Shift+Enter (or Enter in `mod-enter` mode), dedents/exits empty list lines, indents with Tab, dedents/un-lists with Shift+Tab, and cleans list markers on Backspace. - Wired `listEditingPlugin` and `applyTextareaListKeyDown` into `ui/src/components/MarkdownEditor.tsx` (rich mode and raw fallback textarea), preserved Shift+Tab for dedent while autocomplete is open, cleared the mount-reset flag on Tab/Shift+Enter, and treated rendered `<li>` nodes as meaningful editor content. - Updated `ui/src/components/task-chat/TaskChatComposer.tsx` so Shift+Tab defers to list dedent when the selection is inside a list and still cycles work modes outside lists. - Wired `applyTextareaListKeyDown` into `ui/src/components/ChatComposer.tsx`. - Added nested bullet (`disc`, `circle`, `square`) and ordered (`decimal`, `lower-alpha`, `lower-roman`) marker styles and suppressed markers on Lexical's nested-list wrapper `<li>` elements in `ui/src/index.css`. - Added real-Lexical, textarea, `ChatComposer`, `MarkdownEditor`, and `TaskChatComposer` tests. ## Verification - Verified post-rebase on commit `62821e8766`: - `pnpm vitest run ui/src/lib/list-editing.test.ts ui/src/lib/textarea-list-editing.test.ts ui/src/components/ChatComposer.test.tsx ui/src/components/MarkdownEditor.test.tsx ui/src/components/task-chat/TaskChatComposer.test.tsx` — 5 test files, 300 tests passed. - `pnpm --filter @paperclipai/ui typecheck` — passed. - `pnpm --filter @paperclipai/ui build` — passed (verified prior to rebase on identical code; CI supplies full typecheck, build, and test coverage on `62821e8766`). - `node scripts/check-forbidden-tokens.mjs` — passed. - `node scripts/local-verify.mjs --explain` — exited 2 because `ui/src/index.css` is a broad input; CI supplies the full suite. ## Risks - Low risk. Changes are scoped to UI composer keyboard handlers and `.paperclip-mdxeditor-content` list CSS rules. - Outside lists, Tab and Shift+Tab retain their existing behavior (including Shift+Tab work-mode cycling in `TaskChatComposer`). - In `mod-enter` mode (document editors and legacy composer submit mode), plain Enter remains the paragraph/list key and Shift+Enter remains a soft break. ## Model Used - Google Gemini (Antigravity agent, high reasoning mode, 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 - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>canary/v2026.1204.0-canary.890400 |
||
|
|
5e59737ef3 |
feat(ui): request missing plugins from catalog search (#23777)
## Thinking Path > - Paperclip helps people manage AI agents and their work. > - Operators search the Plugins catalog for tools their agents need. > - An empty search offers only a way to clear the query. > - Operators can now use the search term to request the missing tool. > - Each submission creates a backlog task that the company can track. ## Linked Issues or Issue Description **Subsystem affected** Plugins catalog search. **Problem or motivation** An operator who cannot find a tool must leave the catalog to write a request. **Proposed solution** Add a primary request button beside Clear search. Open a form with the search term as its editable name. ## What Changed - Collect an optional website and notification email. Save the request as a company backlog task and show its identifier. - Capture `plugin_request_submitted` after a successful save. Include the source and flags for website presence and email opt-in. - Add a test that submits the form and checks the saved fields, confirmation, and event count. ## Verification - Run `node_modules/.bin/vitest run ui/src/pages/apps/RequestPluginDialog.test.tsx ui/src/lib/analytics/product-analytics-events.test.ts`. All three tests passed locally. The query error policy check reported zero findings. - A manual worktree submission produced one PostHog event with both flags true. - [Final CI run](https://github.com/paperclipai/paperclip/actions/runs/47424073788) passed the required verification and end-to-end gates on `e749348c05`. ## Risks The optional email becomes visible to people who can read the company task. The form records the notification preference. Email delivery requires a future integration. ## Model Used OpenAI GPT-6 via Codex, with local code execution and browser 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 - [ ] 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.1204.0-canary.890300 |
||
|
|
a62aa6a85f |
build(deps-dev): bump wrangler from 4.164.0 to 4.170.0 in /scripts/typecheck-sandbox-providers (#22601)
Bumps [wrangler](https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler) from 4.164.0 to 4.170.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cloudflare/workers-sdk/releases">wrangler's releases</a>.</em></p> <blockquote> <h2>wrangler@4.170.0</h2> <h3>Minor Changes</h3> <ul> <li> <p><a href="https://redirect.github.com/cloudflare/workers-sdk/pull/16678">#16678</a> <a href="https://github.com/cloudflare/workers-sdk/commit/7d57524dd15a711a4ad7ce24e631a61c6af2ba2a"><code>7d57524</code></a> Thanks <a href="https://github.com/mglewis"><code>@mglewis</code></a>! - Add local development support for <code>/cdn-cgi/image/</code> URL transformations</p> <p>When <code>images.url_transformations</code> (or <code>images.urlTransformations</code> in <code>cloudflare.config.ts</code>) is enabled, Miniflare now handles <code>/cdn-cgi/image/<options>/<source></code> requests locally before they reach your Worker. Requests return a 404 when URL transformations aren't enabled for the Worker, and a 403 when the source image isn't allowed by <code>allowed_origins</code>. Transforms use the same low-fidelity Sharp-backed mock as <code>cf.image</code> fetches, so only resize, rotate, format conversion and a small set of options are applied.</p> <p>This is a change in behaviour: previously <code>/cdn-cgi/image/</code> requests were passed through to the Worker during local development.</p> <p>Requests made through <code>SELF</code> in <code>@cloudflare/vitest-plugin</code> bypass Miniflare's routing and are not intercepted.</p> </li> <li> <p><a href="https://redirect.github.com/cloudflare/workers-sdk/pull/17266">#17266</a> <a href="https://github.com/cloudflare/workers-sdk/commit/b9bb1b0764a1330b3df612352e17f494b702ac8d"><code>b9bb1b0</code></a> Thanks <a href="https://github.com/apps/dependabot"><code>@dependabot</code></a>! - Support Analog 3 in <code>wrangler setup</code></p> <p>Configure Analog’s standalone Nitro Vite plugin for Cloudflare Workers. Both <code>wrangler setup</code> and <code>create-cloudflare</code> configure the Minimal starter as a static site. Analog 2 projects continue to use the Nitro options on the Analog Vite plugin. Projects using native Nitro 3 (<code>nitro/vite</code>) should use Nitro’s generated Wrangler configuration instead.</p> </li> </ul> <h3>Patch Changes</h3> <ul> <li> <p><a href="https://redirect.github.com/cloudflare/workers-sdk/pull/17258">#17258</a> <a href="https://github.com/cloudflare/workers-sdk/commit/e96e5082112b14cc7e35197d7a098bd217bb74ba"><code>e96e508</code></a> Thanks <a href="https://github.com/irvinebroque"><code>@irvinebroque</code></a>! - Show the plan-specific Time Travel retention window in <code>wrangler d1 time-travel restore --help</code></p> <p>Previously, the <code>--timestamp</code> description said every database keeps 30 days of history, but databases on Workers Free only keep 7 days. The help text now lists the window for each plan. The error for a timestamp older than 30 days now lists both windows too.</p> </li> <li> <p><a href="https://redirect.github.com/cloudflare/workers-sdk/pull/17284">#17284</a> <a href="https://github.com/cloudflare/workers-sdk/commit/5b6e6bf27a5f3e2d5e16c09b7185f906bc55e7b4"><code>5b6e6bf</code></a> Thanks <a href="https://github.com/apps/dependabot"><code>@dependabot</code></a>! - Update <code>DEFAULT_COMPAT_DATE</code> to 2026-11-29</p> <p>Use the bundled workerd release's compatibility date by default when scaffolding new projects or when no compatibility date is configured.</p> </li> <li> <p><a href="https://redirect.github.com/cloudflare/workers-sdk/pull/17284">#17284</a> <a href="https://github.com/cloudflare/workers-sdk/commit/5b6e6bf27a5f3e2d5e16c09b7185f906bc55e7b4"><code>5b6e6bf</code></a> Thanks <a href="https://github.com/apps/dependabot"><code>@dependabot</code></a>! - Update dependencies of "miniflare", "wrangler"</p> <p>The following dependency versions have been updated:</p> <table> <thead> <tr> <th>Dependency</th> <th>From</th> <th>To</th> </tr> </thead> <tbody> <tr> <td><code>@cloudflare/workers-types</code></td> <td>^5.20261127.1</td> <td>^5.20261129.1</td> </tr> <tr> <td>workerd</td> <td>1.20261127.1</td> <td>1.20261129.1</td> </tr> </tbody> </table> </li> <li> <p><a href="https://redirect.github.com/cloudflare/workers-sdk/pull/17211">#17211</a> <a href="https://github.com/cloudflare/workers-sdk/commit/b91cef97e6a7472839a1291569c32c353ccef18e"><code>b91cef9</code></a> Thanks <a href="https://github.com/jamesopstad"><code>@jamesopstad</code></a>! - Keep remote bindings working after a failed change to the account or API token is reverted</p> <p>Previously, changing the account ID or API token to credentials that failed to start a remote session (for example, a malformed account ID) disposed the existing session first. Reverting the change then reused that disposed session, so remote bindings stayed offline until the development server was restarted. The existing session is now disposed only once its replacement is ready, so it keeps working if the new credentials fail to start a session.</p> </li> <li> <p><a href="https://redirect.github.com/cloudflare/workers-sdk/pull/17217">#17217</a> <a href="https://github.com/cloudflare/workers-sdk/commit/fd544927145d481921d4f48ebb6e69ab20bf6c12"><code>fd54492</code></a> Thanks <a href="https://github.com/irvinebroque"><code>@irvinebroque</code></a>! - Emit explicit removal warnings for removed <code>type</code> and <code>zone_id</code> configuration fields</p> <p>Legacy Wrangler v3 <code>type</code> and <code>zone_id</code> fields now emit explicit removal warnings with migration guidance instead of being flagged as unexpected fields with a misleading "Try upgrading Wrangler" hint.</p> </li> <li> <p><a href="https://redirect.github.com/cloudflare/workers-sdk/pull/17244">#17244</a> <a href="https://github.com/cloudflare/workers-sdk/commit/a33256830dc008a2b20195d9c08c95a46fa60eb7"><code>a332568</code></a> Thanks <a href="https://github.com/dario-piotrowicz"><code>@dario-piotrowicz</code></a>! - Explain where misplaced fields belong in <code>cloudflare.config.ts</code> validation errors</p> <p>Errors for top-level fields such as <code>accountId</code> placed under <code>worker</code> now explain that they belong at the top level. Worker fields placed at the top level also include a hint to move them inside <code>worker</code>.</p> </li> <li> <p>Updated dependencies [<a href="https://github.com/cloudflare/workers-sdk/commit/7d57524dd15a711a4ad7ce24e631a61c6af2ba2a"><code>7d57524</code></a>, <a href="https://github.com/cloudflare/workers-sdk/commit/5b6e6bf27a5f3e2d5e16c09b7185f906bc55e7b4"><code>5b6e6bf</code></a>, <a href="https://github.com/cloudflare/workers-sdk/commit/5b6e6bf27a5f3e2d5e16c09b7185f906bc55e7b4"><code>5b6e6bf</code></a>, <a href="https://github.com/cloudflare/workers-sdk/commit/7d57524dd15a711a4ad7ce24e631a61c6af2ba2a"><code>7d57524</code></a>, <a href="https://github.com/cloudflare/workers-sdk/commit/fd544927145d481921d4f48ebb6e69ab20bf6c12"><code>fd54492</code></a>, <a href="https://github.com/cloudflare/workers-sdk/commit/2a10aff2cd185bc8eaca6e15f555fe579f7747c1"><code>2a10aff</code></a>]:</p> <ul> <li><a href="mailto:miniflare@5.20261129.0-beta">miniflare@5.20261129.0-beta</a></li> <li><code>@cloudflare/workers-utils</code><a href="https://github.com/0"><code>@0</code></a>.60.0</li> </ul> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cloudflare/workers-sdk/commit/b1e0183c6755fc52e9a09739ddf768d582cd4e99"><code>b1e0183</code></a> Version Packages (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17276">#17276</a>)</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/bc09bb3b603bc1087481732988f66f38d951a048"><code>bc09bb3</code></a> [autoconfig] Support Next.js static exports on the OpenNext path (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17288">#17288</a>)</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/7d57524dd15a711a4ad7ce24e631a61c6af2ba2a"><code>7d57524</code></a> [miniflare] Add local development support for /cdn-cgi/image/ URL transformat...</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/e96e5082112b14cc7e35197d7a098bd217bb74ba"><code>e96e508</code></a> [wrangler] Show plan-specific D1 Time Travel retention in restore help (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17258">#17258</a>)</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/2639ba3ec26713d2f04b6cab33a0c7dca5b423b7"><code>2639ba3</code></a> [workers-sdk] Preserve shared remote session tests and auth test cleanup (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17">#17</a>...</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/b5929df1feb943d438f7ac75c9b91f9c1c98ea67"><code>b5929df</code></a> Version Packages (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17232">#17232</a>)</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/7072797d13393c4f431c7c797f851f67442bd2ee"><code>7072797</code></a> [autoconfig] Scaffold project files for cf setup (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17164">#17164</a>)</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/370ea36c3b25414b7ee521238db8cbd54e19e522"><code>370ea36</code></a> Version Packages (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17152">#17152</a>)</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/6bd30e3953f90d745b9fdf3464279b7267ca5231"><code>6bd30e3</code></a> [wrangler] Revert lazy remote-only binding login (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17223">#17223</a>)</li> <li><a href="https://github.com/cloudflare/workers-sdk/commit/e351be9ab21247e6e6e7dbc81b148f17368a7ac1"><code>e351be9</code></a> Prefer <code>CLOUDFLARE_ACCOUNT_ID</code> to the configured <code>accountId</code> (<a href="https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler/issues/17205">#17205</a>)</li> <li>Additional commits viewable in <a href="https://github.com/cloudflare/workers-sdk/commits/wrangler@4.170.0/packages/wrangler">compare view</a></li> </ul> </details> <br /> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>canary/v2026.1204.0-canary.890200 |
||
|
|
955501a75a |
fix(ui): do not render fast_response comments as New session markers (#23778)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Agent Chat renders conversation comments through `commentsToTaskChatItems` in the task-chat UI adapter. > - Fast-response acknowledgements (added in #15748) store `conversationSessionGeneration` on `issue_comments` (including `0`) to track which session they belong to. > - The UI adapter treated any comment with `conversationSessionGeneration != null` as a `/new` session-start divider. > - As a result, fast-response acknowledgements disappeared and rendered as "New session · Earlier messages and files are still available." dividers even when the user never ran `/new`. > - This pull request narrows session-start marker detection so only non-fast-response comments with `conversationSessionGeneration > 0` render as session-start dividers. > - The benefit is that fast-response acknowledgements display as agent bubbles while real `/new` resets keep their session divider. ## Linked Issues or Issue Description Refs #15748 **What happened?** In Agent Chat, when Experimental Fast Responses is enabled, sending a normal message causes a "New session · Earlier messages and files are still available." divider to appear immediately after the user message, even though the user never sent `/new` and the conversation session generation stayed at `0`. **Expected behavior** Fast-response acknowledgements render as normal `fast_response` agent bubbles. Only `/new` session-reset boundary comments render as "New session" dividers. **Steps to reproduce** 1. Enable Experimental Fast Responses on an instance and configure a fast-response model. 2. Open an Agent Chat thread and send a normal message (not `/new`). 3. Observe that the `origin: "fast_response"` acknowledgement comment has `conversationSessionGeneration: 0` (or the current generation `>= 1`) and renders as a "New session" marker instead of the acknowledgement text. **Paperclip version or commit** Reproduced on `master` (commit `314bc70c1`). **Deployment mode** Self-hosted server ## What Changed - Export `isConversationSessionStartComment` in `ui/src/components/task-chat/task-chat-adapter.ts`, requiring `comment.origin !== "fast_response"` and `typeof comment.conversationSessionGeneration === "number" && comment.conversationSessionGeneration > 0`. - Use `isConversationSessionStartComment` in `commentsToTaskChatItems` (`ui/src/components/task-chat/task-chat-adapter.ts`) and in `isHistoricalNotice` (`ui/src/components/task-chat/status-relevance.ts`). - Add regression unit tests in `ui/src/components/task-chat/task-chat-adapter.test.ts` covering `fast_response` comments in generation `0` and generation `1`, real `/new` session boundaries in generation `1`, and non-reset generation-`0` comments. ## Verification - Verified red before the fix and green after the fix with `pnpm vitest run ui/src/components/task-chat/task-chat-adapter.test.ts ui/src/components/task-chat/status-relevance.test.ts ui/src/components/TaskChatThread.test.tsx` (3 test files passed, 469 passed, 1 skipped). - Verified UI typecheck with `pnpm --filter @paperclipai/ui typecheck` (passed). ## Risks Low risk. Only `/new` boundary comments ever stamp a positive `conversationSessionGeneration` on a non-`fast_response` comment (`issues.conversationSessionGeneration` starts at `0` and `/new` increments it before writing the boundary comment). Existing `fast_response` rows already stored in Postgres immediately render properly with no migration required. ## Model Used Google Gemini (Antigravity, medium reasoning effort, with code execution, file editing, and read-only 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 - [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> |
||
|
|
ee05db9e16 |
fix(budgets): add Anthropic rate cards with family-max fallback and surface paused-agent budget notices (#23658)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Cost accounting prices Anthropic token receipts against rate cards
so budget policies can track spend and enforce hard stops
> - `anthropic-pricing.ts` only had rate cards for `claude-sonnet-5` and
`claude-opus-5-5`, so newer shipped models such as `claude-fable-5-2`
settled as `unpriced`
> - Because budget policies default to `unpriced_usage_policy =
"block"`, creating a spend cap on an agent that ran an unpriced model
immediately triggered a budget hard stop even when observed spend was
far below the limit
> - Meanwhile, the chat thread notice for a budget-paused agent had no
action link and did not state that messages sent while paused will not
receive a reply, and the budget incident card did not clearly explain
unpriced-usage stops or what "Keep paused" does
> - This pull request adds rate cards for shipped Anthropic models with
a conservative family-maximum fallback for uncataloged models, clarifies
the paused-agent chat notice and unpriced budget incident card, and adds
Storybook coverage
> - The benefit is that budget caps track current and future Anthropic
models accurately without false unpriced-usage lockouts, and operators
immediately see why an agent is not replying and where to resolve it
## Linked Issues or Issue Description
**What happened?**
When an agent ran a shipped Anthropic model missing from `RATE_CARDS`
(such as `claude-fable-5-2`), its usage receipts settled with
`costStatus: "unpriced"`. Creating a budget policy (which defaults to
`unpriced_usage_policy: "block"`) immediately fired a hard-stop incident
and paused the agent even when known spend was well below the limit. In
the task chat thread, the paused-agent banner gave no link to the
agent's budget page and did not clearly warn that new messages would not
trigger replies; on the budget incident card, the unpriced-usage stop
looked like a regular spend-limit alert and dismissing it via "Keep
paused" left the agent paused with no clear explanation.
**Expected behavior**
Shipped Anthropic models should have explicit rate cards, and
uncataloged models in a known Claude family (`fable`, `mythos`, `opus`,
`sonnet`, `haiku`) should fall back conservatively to the most expensive
rate card in that family rather than settling as unpriced. When an agent
is paused in chat, the notice should clearly state that messages will
not get a reply until the agent is resumed and provide a direct "Review
budget" link for budget pauses. Unpriced-usage budget stops should
clearly explain why work stopped and that "Keep paused" dismisses the
alert without resuming work.
**Steps to reproduce**
1. Run an agent on `claude-fable-5-2` using direct Anthropic API billing
so usage receipts settle as `unpriced`.
2. Add a monthly budget policy (e.g. $1,000) on that agent.
3. Observe an immediate hard-stop budget incident pausing the agent
despite low observed spend.
4. Return to the agent's chat thread and observe the paused banner lacks
a budget link and does not clearly state that new messages will not get
a reply.
## What Changed
- `server/src/services/anthropic-pricing.ts`: Added explicit standard
API rate cards for shipped Anthropic models (`claude-fable-5-2`, `5-1`,
`5`; `claude-mythos-5-2`, `5-1`, `5`; `claude-opus-5-5`, `5`, `4-8`,
`4-7`, `4-6`, `4-5`; `claude-sonnet-5-5`, `5`, `4-6`, `4-5`;
`claude-haiku-5-5`, `4-5`), normalized optional `[1m]` suffixes, and
added a dynamic family-maximum fallback (`FAMILY_MAX_RATE_CARDS`) so any
uncataloged model in a known Claude family conservatively uses the
highest rate in that group with explicit provenance.
- `server/src/services/anthropic-pricing.test.ts`: Added unit tests
covering `claude-fable-5-2` (including `[1m]`), `claude-sonnet-5-5`,
`claude-haiku-4-5`, family-maximum fallbacks across all five Claude
families, and preserving unknown/non-Anthropic models as unpriced.
- `ui/src/components/IssueChatThread.tsx`: Updated
`IssueAssigneePausedNotice` to state clearly that messages sent while
paused will not get a reply, distinguish budget pauses in the title, and
render a direct "Review budget" link to `${agentUrl(agent)}/budgets`.
- `ui/src/components/BudgetIncidentCard.tsx`: Clarified unpriced-usage
hard stops (`unpriced usage stop`, known spend vs. limit, and why
unpriced usage blocked work) and added a muted note beside "Keep paused"
explaining that dismissing the alert keeps the scope paused.
- `ui/src/components/PausedBudgetNotices.test.tsx`: Added focused jsdom
unit tests for `IssueAssigneePausedNotice` (budget pause link and manual
resume action) and `BudgetIncidentCard` (unpriced-usage hard-stop copy).
-
`ui/storybook/stories/budgets-costs/paused-agent-chat-notice.stories.tsx`:
Added production-component Storybook stories (`BudgetPausedInChat`,
`BudgetPausedWithUnpricedIncident`, `ManuallyPausedInChat`) with
interaction tests.
## Verification
- `pnpm vitest run server/src/services/anthropic-pricing.test.ts
ui/src/components/PausedBudgetNotices.test.tsx`: 2 test files, 30 tests
passed.
- `pnpm --filter @paperclipai/server typecheck`: passed.
- `pnpm --filter @paperclipai/ui typecheck` (including `node
../scripts/storybook-catalog.mjs`): passed.
- Verified all three new Storybook stories interactively in a browser
against local Storybook (`http://localhost:6006`) with zero runtime
errors and passing Storybook play assertions.
- `pnpm verify` exited 2 due to pre-existing untracked local files;
relying on required CI for full-repo coverage.
## Risks
- Low risk. Existing rate cards for `claude-sonnet-5` and
`claude-opus-5-5` keep their exact rates and versions. Family-maximum
fallbacks are intentionally conservative upper bounds and are labeled in
`pricingProvenance.evidence` as estimates rather than invoices.
- Existing already-settled `unpriced` cost events in databases are not
retroactively rewritten; this prevents new runs on shipped or future
Claude-family models from settling as unpriced.
## Model Used
- Google Gemini (Gemini 4 Neon Medium via Antigravity), with file
editing, terminal execution, browser verification, and web search 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
- [ ] 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>
|
||
|
|
4da93d2f26 |
build(deps): bump tar from 7.5.22 to 7.5.23 in /scripts/typecheck-sandbox-providers (#22602)
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.22 to 7.5.23. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/isaacs/node-tar/commit/eb92e178af52cd191d48eb70a846f61cc4dade1b"><code>eb92e17</code></a> 7.5.23</li> <li><a href="https://github.com/isaacs/node-tar/commit/158f51dce6790f37ddcd384567486c7c90c9ac0c"><code>158f51d</code></a> publish via OIDC</li> <li>See full diff in <a href="https://github.com/isaacs/node-tar/compare/v7.5.22...v7.5.23">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~GitHub%20Actions">GitHub Actions</a>, a new releaser for tar since your current version.</p> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
cfb3158d52 |
feat(codex-models): read the Codex CLI models cache for ChatGPT-auth installs (#13134)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The `codex_local` adapter has a model picker. `loadCodexModels()` in `server/src/adapters/codex-models.ts` fills it from two sources: the OpenAI models API (only when an `OPENAI_API_KEY` resolves) and a static array shipped with the adapter. > - Most Codex users authenticate the CLI with a ChatGPT account. Those installs have no API key, so the picker always shows the static array, which changes only when Paperclip cuts a release. The Refresh button re-reads the same array and changes nothing, which reads as a broken control. > - The Codex CLI already maintains an authoritative catalog for these installs at `$CODEX_HOME/models_cache.json`, refreshed from the ChatGPT backend during normal use. > - This pull request reads that cache as the no-API-key discovery source, filters it to entries the CLI marks `visibility: "list"`, and merges it with the static fallback through the existing dedupe/merge helpers. > - The benefit is that a model the user's Codex install can already run appears in the picker without a Paperclip release, and internal slugs such as `gpt-reserve` stay out of the catalog. ## Linked Issues or Issue Description Fixes: #13126 Refs: #1317 (the user-facing report of the same root cause) ## What Changed - `server/src/adapters/codex-models.ts`: added `readCodexModelsCache()`, which reads `$CODEX_HOME/models_cache.json` (default `~/.codex/models_cache.json`), keeps entries with `visibility === "list"` and a non-empty `slug`, uses `display_name` as the label (falling back to the slug), and returns `[]` when the file is missing, unreadable, malformed, or lists nothing usable. - `loadCodexModels()`: when no OpenAI API key resolves, the result is now `mergedWithFallback(readCodexModelsCache())` instead of the static array alone. The API-key path is unchanged. - Added `server/src/adapters/codex-models.test.ts` with 6 tests: missing cache file, visibility filter (internal slugs excluded), missing display name, malformed JSON, non-array `models` payload, and empty/missing slugs. ## Verification - `npx vitest run server/src/adapters/` — 49 tests pass (6 new). - `tsc --noEmit` in `server/`: no errors in the changed files (the only errors are pre-existing missing `@paperclipai/paperclip-runner` vendor types that require the `prepare:runner-vendor` build step, also present on a clean master checkout). - Manual check against a real cache file: with `codex-cli 0.153.4` and a ChatGPT-authenticated install, the picker catalog grows from the 13 static entries to include the CLI's current list entries with their display names. ## Risks Low risk. The change only affects the no-API-key path and is additive: the static fallback still merges in, so no model id offered today disappears. Labels for cache-listed models change from the bare slug to the CLI's display name (ids, which agent config persists, are unchanged). The cache file is read with a try/catch, so a corrupt or unreadable file degrades to today's behavior. No new network calls, credentials, or auth surface. ## Model Used Codex (OpenAI Codex CLI, gpt-5-codex, agentic coding with tool use; the models_cache.json schema was verified against a live Codex install; change and tests authored with AI assistance) ## 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: 馨冉 <xinxincui239@gmail.com>canary/v2026.1204.0-canary.889800 |
||
|
|
9d1ac1f188 |
fix(acpx): tag mid-stream transport stalls as transient_upstream so bounded retry arms (#12491)
## Thinking Path > The ACPX engine reports a mid-stream transport stall and a hard provider capacity cap under one code, `acpx_turn_failed`, but they want opposite retry semantics. Because the engine never persists `errorFamily`, the heartbeat bounded-retry ladder never arms for transport stalls (issue #11257). This classifies the two at the adapter, tagging stalls `transient_upstream` while leaving the capacity-cap subclass on its `provider_quota` path. ## Linked Issues or Issue Description Fixes #11257. Searched the open PR list — no existing PR adds ACPX transport-stall errorFamily classification. ## What Changed Rebased onto the new terminal-failure classification (`terminalFailureClassification` + per-adapter `classifyTerminalSessionFailure`). The adapter classifiers (`classifyClaudeTerminalSessionFailure`, `classifyCodexTerminalSessionFailure`) only cover `access` and provider-quota `limit` failures, so a mid-stream stall is still left with no `errorFamily` on `master`. - **`classifyAcpxTurnFailureErrorFamily(error, terminalSessionFailure?)`** (pure, exported): returns `"transient_upstream"` only for the transport-stall signature. Capacity/quota wording vetoes first, and an `access` / `limit` terminal-session category is never relabelled. - **Engine wiring**: used as a fallback **after** `classifyToolDefinitionFailure` and the adapter classifier — `terminalFailureClassification ?? fallback`. Adapter labels always win; `errorCode` stays `acpx_turn_failed`. The family flows through the existing `classifiedFailure` path into the top-level result and `resultJson`. No server change. ## Verification - `pnpm exec vitest run packages/adapter-utils/src/acpx-engine/execute.test.ts` — 232 passed, including: stall/cap/unrelated unit cases, two remote-harness runs (stall → `transient_upstream`, session cap → none), and three `classifyTerminalSessionFailure` cases (unclaimed stall → `transient_upstream`; adapter `provider_quota` wins over the fallback; unclaimed `limit` failure with stall wording stays unlabelled). - `vitest run packages/adapters/claude-local packages/adapters/codex-local` — green. - `tsc --noEmit` — `packages/adapter-utils` and `server` 0 errors. ## Risks - Text-based classification: an unmatched reword is a safe false-negative (preserves today's no-retry). A stall surfacing as a thrown error rather than a failed terminal is a follow-up. ## Model Used - Claude Opus 4.8 (Anthropic), via Claude Code with 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` URLs) - [x] My branch name describes the change and contains no internal ticket id - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s cc @cryppadotta @devinfoley — rebased onto the new `terminalFailureClassification` scheme; CI and Greptile are green, ready for review. |
||
|
|
eeb91a8b28 |
build(deps-dev): bump @cloudflare/workers-types from 5.20261117.1 to 5.20261120.1 in /scripts/typecheck-sandbox-providers (#22603)
Bumps [@cloudflare/workers-types](https://github.com/cloudflare/workerd) from 5.20261117.1 to 5.20261120.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cloudflare/workerd/releases">@cloudflare/workers-types's releases</a>.</em></p> <blockquote> <h2>PGO profiles</h2> <p>The profiles that optimize the Linux release builds (build/pgo/README.md). Don't delete them: build/pgo/profile.json names one of them, as may older commits that are built again.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/cloudflare/workerd/commits">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
38dc3b96ef |
fix(ui): remove monitor reply-wake copy and vertically center Check now (#23763)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - The task detail view renders two monitor surfaces
(`IssueMonitorBanner` and `IssueMonitorComposerStrip`) when a task waits
for a scheduled monitor check or scheduled retry.
> - The composer monitor strip displayed a default helper line ("Sending
a reply wakes the agent now — before the scheduled check.") below the
header row.
> - That helper line added unnecessary copy and pushed the `Check now`
button upward, leaving it off-center inside the card, while
`IssueMonitorBanner` inherited top alignment (`sm:items-start`) from
`InlineBanner`.
> - This pull request removes the default reply-wake copy, computes the
remaining specialized hints in `buildMonitorSurfaceCopy`, places them
inside the left column of the flex row, and vertically centers the
`Check now` button on both monitor surfaces.
> - The benefit is a cleaner monitor card with a vertically centered
primary action across all waiting states.
## Linked Issues or Issue Description
**What existing behavior does this improve?**
The task detail monitor card above the reply composer
(`IssueMonitorComposerStrip`) and the pinned monitor banner
(`IssueMonitorBanner`) in `ui/src/components/IssueMonitorBanner.tsx`.
**Subsystem affected**
ui/ — React + Vite board UI
**Current behavior**
For scheduled monitors and ordinary scheduled retries,
`IssueMonitorComposerStrip` renders `"Sending a reply wakes the agent
now — before the scheduled check."` below the flex row that holds the
`Check now` button. That footer paragraph makes the `Check now` button
sit near the top of the card instead of the vertical center.
`IssueMonitorBanner` also inherits `sm:items-start` from `InlineBanner`,
which top-aligns `Check now`.
**Proposed behavior**
Remove the default `"Sending a reply wakes the agent now — before the
scheduled check."` text completely. Move the remaining specialized hints
(pull request review, workspace wait, active run wait, and AI connection
pool wait) into `buildMonitorSurfaceCopy` (`stripHint`) and render them
inside the left content column so `sm:items-center` vertically centers
`Check now` against the full card content. Override `sm:items-center` on
`IssueMonitorBanner` so `Check now` is also vertically centered in the
pinned banner.
**Reason and benefit**
Operators do not need the generic reply-wake reminder on every scheduled
monitor, and removing it eliminates unnecessary text clutter. Keeping
`Check now` vertically centered improves visual balance on both the
composer strip and the pinned banner.
**Breaking changes**
None. Existing specialized wait hints and button actions remain
unchanged.
## What Changed
- Removed the default `"Sending a reply wakes the agent now — before the
scheduled check."` copy from `IssueMonitorComposerStrip` in
`ui/src/components/IssueMonitorBanner.tsx`.
- Added `stripHint?: string` to `MonitorSurfaceCopy`, computed
state-specific strip hints directly in `buildMonitorSurfaceCopy`,
removed the now-unused write-only flags (`automaticChecksPaused`,
`executionWait`, `usageWait`), and rendered `copy.stripHint` inside the
left column of the `sm:flex-row sm:items-center sm:justify-between` row
so `Check now` / `Check status` stays vertically centered whether a
specialized hint is shown or omitted.
- Replaced per-element `mt-1.5` margin with `flex flex-col gap-1.5`
spacing on `IssueMonitorComposerStrip`.
- Added `sm:items-center` to `IssueMonitorBanner` so `InlineBanner`
vertically centers `Check now` instead of top-aligning it.
- Switched `ui/src/components/IssueMonitorBanner.test.tsx` to `jsdom`
DOM rendering and asserted the structural ancestor relationship:
specialized hint `<p>` nodes (usage wait and PR review requested) live
inside the left column whose parent is the same `sm:flex-row
sm:items-center` row as `Check now` / `Check status`, active-run monitor
states render their relocated `stripHint` copy, default scheduled
monitors and ordinary retries omit the reply-wake copy and render no
`<p>` hint, and `IssueMonitorBanner` overrides `sm:items-start` with
`sm:items-center`.
## Verification
- Ran `pnpm vitest run ui/src/components/IssueMonitorBanner.test.tsx
ui/src/lib/issue-monitor.test.tsx` on the exact tree committed in
`a4f8a78401`: 2 files, 29 tests passed (4 in
`IssueMonitorBanner.test.tsx`, 25 in `issue-monitor.test.tsx`).
- Ran `pnpm --filter @paperclipai/ui typecheck`: exited 0.
- Ran `pnpm check:tokens`: no forbidden tokens found.
- Confirmed all CI gates (including all 16 e2e shards, `ci / verify`,
`ci / Typecheck + Release Registry`, `ci / Build`, `ci / policy`) passed
on `ce42421728`; waiting for fresh CI and reviews on `a4f8a78401`.
## Risks
- Low risk. The change is scoped to layout alignment,
`buildMonitorSurfaceCopy` hint mapping, and unit tests in
`ui/src/components/IssueMonitorBanner.tsx` and
`ui/src/components/IssueMonitorBanner.test.tsx`, with no API, schema, or
behavioral changes to monitor scheduling or wakeup logic.
## Model Used
- Google Gemini (Antigravity coding agent with tool use and code
execution)
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
canary/v2026.1204.0-canary.889500
|
||
|
|
30334c1f03 |
test(cli): align chat guidance with optional company flags (#23776)
Align chat guidance with company selection from saved context. Keep the required title assertion and accept valid examples without --company-id. Verified the original failure locally, all three guidance tests after the fix, CLI typecheck, required PR CI, and Greptile 5/5 with no open findings. Co-Authored-By: Paperclip <noreply@paperclip.ing>canary/v2026.1204.0-canary.889400 |
||
|
|
c56463e6d1 |
feat(chat): use rich project selector and remove workspace option in GitHub bot settings (#23757)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - Chat connections let operators set task defaults for new
conversations, including on GitHub review bot settings and repository
access views.
> - Today, task defaults render a plain native `<select>` for projects
and expose a Workspace selector for GitHub review bots.
> - Operators expect the same searchable, rich project selector used in
the task composer, and GitHub review bot tasks should always use
isolated workspaces / project defaults without a separate workspace
override.
> - This pull request replaces the native project select in
`ChatExecutionDefaults` with `InlineEntitySelector`, hides workspace
configuration for GitHub connections and repositories, and strips GitHub
workspace overrides on the server during reads, writes, and task
creation.
> - The benefit is faster, consistent project selection across chat
connections and simpler GitHub review bot settings that enforce isolated
workspace / project defaults.
## Linked Issues or Issue Description
**What existing behavior does this improve?**
Task defaults in chat connection settings (`ChatExecutionDefaults`),
specifically for GitHub review bot connection settings and
per-repository overrides.
**Subsystem affected**
Cross-cutting (`ui/` and `server/`).
**Current behavior**
`ChatExecutionDefaults` renders a plain native `<select>` for the
default project and displays a Workspace configuration selector on
GitHub review bot settings and repository defaults. Legacy workspace
overrides saved on GitHub endpoints or repositories remain visible and
apply during task creation.
**Proposed behavior**
`ChatExecutionDefaults` uses `InlineEntitySelector` with search, recent
projects, project color icons, and private-project indicators (matching
the task composer). For GitHub review bots (`allowWorkspace={false}`),
the Workspace selector is removed, the workspace choices query is
skipped, and the server strips any workspace override on read, write,
and task creation so new tasks always use isolated workspaces / project
defaults.
**Reason and benefit**
Operators can find projects quickly with the same picker they already
know from the task composer, and GitHub review bots no longer expose a
misleading workspace override that conflicts with isolated workspace /
project defaults.
**Breaking changes**
None for non-GitHub providers (Slack, Discord, Telegram, Teams,
iMessage, Email retain their Workspace selector and stored workspace
overrides). For GitHub review bots, any previously saved workspace
override is ignored so new tasks use isolated workspaces / project
defaults; saved project defaults are preserved.
## What Changed
- Updated `ui/src/components/InlineEntitySelector.tsx` to accept
optional `id` (for `<label htmlFor>`) and `contentClassName` (to match
full-width form triggers) without changing existing callers.
- Replaced the native project `<select>` in
`ui/src/pages/apps/chat/ChatExecutionDefaults.tsx` with
`InlineEntitySelector` (searchable by project name and description,
recent project ordering, colored folder icons, private lock badges,
unavailable-project handling, and stable `projectOptions` memoization).
- Added an `allowWorkspace` prop (default `true`) to
`ChatExecutionDefaults` so non-GitHub connections keep their Workspace
selector while GitHub connections
(`ui/src/pages/apps/chat/ChatEndpointDetail.tsx`) and GitHub
repositories (`ui/src/pages/apps/chat/GitHubBotManagement.tsx`) omit
workspace configuration and skip fetching workspace choices.
- Added `normalizeChatExecutionDefaultsForProvider` and provider-aware
stripping in `resolveChatExecutionDefaults`
(`server/src/services/chat-execution-defaults.ts`) and wired it through
endpoint serialization/updates
(`server/src/services/chat-channels/endpoints.ts`), resource
reads/writes
(`server/src/services/chat-channels/resource-reconciliation.ts`,
`server/src/services/chat-channels/github/resources.ts`), and inbound
task creation (`server/src/services/chat-channels.ts`).
- Added unit and realistic-size (400-project linear read budget) tests
in `ui/src/pages/apps/chat/ChatExecutionDefaults.test.tsx`, helper tests
in `server/src/__tests__/chat-execution-defaults.test.ts`, and an
embedded-Postgres integration test in
`server/src/__tests__/chat-channels/github-setup-and-access.integration.test.ts`.
## Verification
- `npx vitest run ui/src/pages/apps/chat/ChatExecutionDefaults.test.tsx`
— passed (5 tests, including 400-project resource-mode search and
recent-ordering linear read budget).
- `npx vitest run ui/src/pages/apps/chat/chat-ui-contract.test.ts` —
passed (12 tests).
- `npx vitest run server/src/__tests__/chat-execution-defaults.test.ts`
— passed (6 tests).
- `npx vitest run
server/src/__tests__/chat-channels/github-setup-and-access.integration.test.ts
-t "strips workspace overrides"` — passed (embedded Postgres integration
test verifying read, write, and inbound task creation).
- `pnpm --filter @paperclipai/ui typecheck && pnpm --filter
@paperclipai/server typecheck` — passed (exit 0).
- `node scripts/check-module-boundaries.mjs && node
scripts/check-test-budget.mjs && node
scripts/check-query-error-rendering.mjs` — passed.
- CI run on final head `d548e20a75`:
https://github.com/paperclipai/paperclip/actions/runs/47394038195 — all
66 checks passed (Build, Typecheck + Release Registry, policy, verify,
general/serialized/runner/e2e suites, security scans).
- Greptile Review on `d548e20a75`: 5/5 confidence score with zero
unresolved comments.
## Risks
- Low risk. Existing GitHub endpoints or repositories with a legacy
`workspace` entry in `executionDefaults` now ignore that entry and use
the project default / isolated workspace behavior instead. Non-GitHub
chat connections keep existing workspace configuration unchanged.
## Model Used
- Google Gemini 4 Neon (High reasoning mode, with tool use and code
execution) via 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)
- [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>
|
||
|
|
ba1fc8884c |
fix(native-runtime): fix plugin task predecessor resume and confirmed-unavailable retirement (#23772)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The native runtime executes `per_turn` plugin Runner tasks across remote sandboxes and verifies predecessor lease authority before it reads checkpoints or resumes sessions. > - Three coupled defects in predecessor resolution and retirement caused valid follow-up and retry turns to fail with `Plugin Runner retained session is not authorized (reason: predecessor_candidate_missing)`. > - First, same-run checkpoint reads called `resolvePluginTaskResume` without `inspectCheckpoint: true`, which rejected an unsettled predecessor lease before `read_state` could re-attest its status. > - Second, cross-run checkpoint recovery skipped verified backups and refused to retire a confirmed-unavailable plugin checkpoint when prior verification returned `verified`, leaving the unretired root in place to fail launch resume. > - Third, `admission_rejected` cleared `runnerTaskIdentity` on the rejected lease but kept `runnerTaskResumeFrom`, which disqualified the original predecessor lease on retry; when clearing `runnerTaskResumeFrom`, the attempted predecessor must still be recorded inside `runnerTaskAdmissionRejection` so `materializeNativeResumeRefusedContinuation` preserves automatic fresh-session continuation. > - This pull request fixes all three paths while keeping all stop-proof, scope, and retirement fences intact, and adds red-before-fix regression tests for each case. > - The benefit is that `per_turn` plugin Runner tasks recover, retire confirmed-unavailable checkpoints cleanly, and retry or continue after admission rejection without spurious authorization failures. ## Linked Issues or Issue Description **What happened?** `per_turn` plugin Runner tasks failed on same-run recovery, cross-run confirmed-unavailable checkpoint retirement, and retry after `admission_rejected` with `Plugin Runner retained session is not authorized (reason: predecessor_candidate_missing)`. **Expected behavior** 1. Same-run checkpoint reads pass `inspectCheckpoint: true` to `resolvePluginTaskResume` so `read_state` can re-attest status on the predecessor lease. 2. Cross-run follow-ups inspect verified backups and retire finished `per_turn` plugin owners (including archiving a verified suspended `plugin-runner-state.json` receipt) when the provider confirms the prior checkpoint is stopped and unavailable. 3. `admission_rejected` clears `runnerTaskResumeFrom` alongside `runnerTaskIdentity` so a subsequent retry lease still resolves the original predecessor lease, while recording the attempted `resumeFrom` inside `runnerTaskAdmissionRejection` so `materializeNativeResumeRefusedContinuation` still schedules a fresh-session continuation. **Steps to reproduce** 1. Run a same-run plugin Runner recovery (`resume_dead_runner` or disposition retry) when the predecessor lease has `runnerTaskSessionRetained: false`; `migrateRunnerdStateRoot` calls `resolvePluginTaskResume` without `inspectCheckpoint: true` and fails with `predecessor_candidate_missing`. 2. Run a cross-run `per_turn` plugin Runner follow-up when the prior root verifies via `plugin-runner-state.json` or a verified harness backup and `read_state` confirms `executionStopped: true, sessionStateAvailable: false`; the prior root is not retired and launch resume fails with `predecessor_candidate_missing`. 3. Submit a plugin Runner task on `lease2` with `resumeFrom: "task-1"` that returns `admission_rejected`, release `lease2`, and call `resolvePluginTaskResume` for `lease3` on the same run; stale `runnerTaskResumeFrom` on `lease2` disqualifies `lease1` with `predecessor_candidate_missing`. **Paperclip version or commit** `f4baaa4f48` (`master`) **Deployment mode** Self-hosted server ## What Changed - Pass `inspectCheckpoint: true` to `resolvePluginTaskResume` in `migrateRunnerdStateRoot` (`server/src/services/native-runtime/native-session-executor.ts`) before issuing same-run `read_state`, matching `recoverPluginRunnerCheckpoint` and `environment-task-runtime.ts`. - Inspect plugin checkpoints in `recoverPluginRunnerCheckpoint` when `direct === "absent" && prior === "verified"` (verified harness backup on disk). - Allow `retireFinishedPerTurnRunnerdOwner` in `migrateRunnerdStateRoot` when `pluginCheckpointUnavailableConfirmed && verification === "verified"`, preserving all existing stop-proof, lease, journal, and recovery fences. - Accept a verified suspended `plugin-runner-state.json` receipt in `readSettledRunnerdProjection` when `options.confirmedGonePluginTask` is true, and archive `plugin-runner-state.json` alongside continuity entries in `moveNativeContinuityState` when retiring a confirmed-unavailable plugin owner. - Strip `'runnerTaskResumeFrom'` alongside `'runnerTaskIdentity'` on `admission_rejected` in `executeEnvironmentTask` (`server/src/services/environment-task-runtime.ts`), record the attempted `resumeFrom` inside `runnerTaskAdmissionRejection`, and update `materializeNativeResumeRefusedContinuation` (`server/src/services/native-runtime/native-provider-capacity-retry.ts`) to read `runnerTaskAdmissionRejection.resumeFrom` with fallback to legacy `runnerTaskResumeFrom`. - Add focused red-before-fix regression tests in `server/src/services/native-runtime/native-session-executor.test.ts`, `server/src/__tests__/environment-task-authority.integration.test.ts`, and `server/src/services/native-runtime/native-resume-refused-continuation.integration.test.ts`. ## Verification - Confirmed all 5 new regression test cases failed with `predecessor_candidate_missing` or stale `runnerTaskResumeFrom` before applying the production fixes. - Ran `pnpm --dir server exec vitest run src/services/native-runtime/native-session-executor.test.ts src/services/native-runtime/native-session-root-entries.test.ts src/__tests__/environment-task-authority.integration.test.ts` — 3 test files passed (1591 passed, 7 skipped, 0 failed). - Ran `pnpm --dir server exec vitest run src/services/native-runtime/native-resume-refused-continuation.integration.test.ts` — 1 test file passed (9 passed, 0 failed). - Ran `pnpm --dir server typecheck` — passed cleanly across all layers. ## Risks - Low risk. All existing stop-proof (`remoteExecutionHasStopped`), prior lease end (`priorRemoteSandboxLeasesEnded`), released controller lease, and settled journal fences remain enforced before any confirmed-unavailable plugin checkpoint is retired. - `plugin-runner-state.json` remains in `NATIVE_SESSION_ROOT_HELD_ENTRIES` and is only accepted and archived when `confirmedGonePluginTask` is proven true and `pluginRunnerdAuthorityLifecycle` matches the exact suspended identity with no direct `runner/runner-state.json`. - `materializeNativeResumeRefusedContinuation` falls back to legacy `runnerTaskResumeFrom` for any lease written before this change. - No database schema changes or migrations are included. ## Model Used - Google DeepMind Gemini 4 Neon (Medium reasoning budget) 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> |
||
|
|
7838a12f5c |
fix(runner): upgrade Pi to 1.7.0 for the undici and minimatch security fixes (#23430)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The experimental Paperclip Runner runs Pi from a pinned, hash-verified distribution. > - That distribution pins Pi 1.0.0, which installs undici 8.10.2. > - undici 8.12.4 fixes six advisories, including GHSA-mqg3-3v4r-cm32 (high). > - Dependabot cannot do this upgrade. The pins feed `PI_DISTRIBUTION_PINS`, the closure pins and the ACPX `commandDigest`, so a Dependabot change fails CI (#22711, #18998). > - This pull request upgrades Pi to 1.7.0 by hand under `rules/acpx-profile-identity.mdc`. > - The benefit is a Pi runtime with the undici security fixes and an unchanged trust model. ## Linked Issues or Issue Description Supersedes #22711. Supersedes #18998. **What is the problem?** The Runner Pi distribution installs undici 8.10.2. undici 8.12.4 fixes GHSA-mqg3-3v4r-cm32, GHSA-7xg3-fphp-28hg, GHSA-5rm8-gv32-r954, GHSA-9v6h-8rgp-m69f, GHSA-3g9m-rv3r-w5w2 and GHSA-r4pc-4jcp-7pqc. **Why can Dependabot not fix it?** `.github/dependabot.yml` excludes `pi-distribution` on purpose. The lock, the closure pins and the profile digest must change together. **What is the fix?** Upgrade `@earendil-works/pi-coding-agent` from 1.0.0 to 1.7.0, which pins undici 8.12.4. ## What Changed - Pin `@earendil-works/pi-coding-agent` 1.7.0. Regenerate `package-lock.json` with the pinned Node 24.21.0 and its npm 11.19.0. The lock now has 126 packages and no os/cpu-specific packages. - Pi 1.6.0 and later do not ship `npm-shrinkwrap.json`. Pi pins `brace-expansion` 5.0.12 itself. So: - Remove `patches/brace-expansion@5.0.9.patch` and its setup and build plumbing. - Replace the shrinkwrap check in `verifyLockedPiPackageGraph`. Each dependency that Pi declares must install at exactly that version. Each `undici` and `brace-expansion` copy in the lock must be the reviewed release (`PI_DISTRIBUTION_PINS.undici` 8.12.4, `braceExpansion` 5.0.12). - Pi 1.7.0 (the newest Pi) pins minimatch 11.0.3. That version has GHSA-cf2h-pxjq-68xw (high), GHSA-hqmv-qgp3-jx75 and GHSA-c859-jr93-m5j4. Add an npm override to minimatch 11.0.8, the first fixed release. `PI_SECURITY_OVERRIDES` lets the verifier accept only this override, and only while Pi pins 11.0.3. A later Pi pin change fails closed and forces a new review. - Update the three `PI_DISTRIBUTION_CLOSURE_SHA256` pins. Then regenerate the ACPX profiles (TypeScript and Rust) with `generate:acpx-profiles`. - Keep profile version 37. The `commandDigest` changes with the upstream release, so saved Pi sessions start fresh. This follows the rule. - Update the version checks in `pi-installation.ts`, the Rust fixtures (`PI_ACPX_DIGEST`), the installation-integrity fixtures (the 1.0.0 digest is now the refused prior digest), the tests, the e2e qualification ID (`pi:0.0.33:1.7.0:openrouter`) and its suite-definition hashes, and `runner-pi-capabilities.md`. ## Verification - `node scripts/materialize-pi-distribution.mjs /tmp/out` passes on linux-x64. It uses the official pinned Node archive and verifies all 126 locked packages and the new closure pin. - Darwin closure pins: the lock has no platform-specific packages. So each darwin closure is the linux-x64 closure with that target's pinned Node executable. I checked this method first: it reproduces all three Pi 1.0.0 pins exactly from a linux-x64 build of master. - `PAPERCLIP_TEST_PI_RUNTIME_ROOT=<materialized runtime> node --test test/pi-native-package-contract.test.mjs`: 15/15 pass. The test runs real Pi 1.7.0 RPC through the owned ACP/MCP bridge (hello, interleaved tools, provider errors, thinking modes, warm recovery, pending cancel, path admission, aliased MCP tools). - `node --test` for the materialize, provision, build-inputs and attestation scripts: 39/39 pass. - Vitest: `pi-installation`, `pi-provision`, `native-execution`: 132 pass, 1 skipped. `tests/runner-e2e/pi-controls-evidence.test.ts`: 72/72 pass. - `generate-acpx-profiles.mjs --check` passes. - Static review against 1.0.0: `dist/core/tools/path-utils.js` is byte-identical, the tool `path` schemas are unchanged, and the extension events that we use still exist. Unknown tools still fail closed. - Not run locally: Rust tests (no cargo here) and paid live-model qualification. CI covers Rust. Pi stays a candidate profile. ## Risks - Saved Pi Runner sessions start fresh after deploy because the `commandDigest` changes. This is the expected result of an upstream upgrade. - Pi 1.0 → 1.7 has upstream behavior changes (for example, the Azure provider rename to `azure`, and new default models). The Paperclip Pi bindings do not use `azure-openai-responses`. - A darwin closure pin can be wrong only if npm installs different bytes on macOS for a platform-neutral graph. The macOS build checks the pin and fails closed. ## 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 - [ ] 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: devinfoley <139239+devinfoley@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
596bb8a512 |
fix(native-runtime): classify exited plugin Runner on restart reattachment (#23769)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Native remote runs use restart recovery (`reattach_remote_runner`)
to reattach to an existing Runner after a Core restart or deploy
> - For `plugin_task` Runners, `verifyPluginRunnerTaskReattachment`
threw a raw `Error("Plugin Runner is not running")` when the Runner
exited before reattachment, and `migrateRunnerdStateRoot` did not wrap
that error with `withRemoteRunnerTurnProof`
> - Without a structured `RemoteRunnerRecoveryError`, the executor never
emitted `native.remote_runner_recovery_failed` and
`requestRestartInterruptedTurnRetry` could not recognize the exited
Runner, leaving the run permanently failed
> - This pull request updates `verifyPluginRunnerTaskReattachment` to
throw structured `RemoteRunnerRecoveryError` diagnostics (distinguishing
proven `executionStopped === true` exits from `probe_failed`) and wraps
the call in `migrateRunnerdStateRoot` with `withRemoteRunnerTurnProof`
> - The benefit is that stopped `plugin_task` Runners record consistent
exit diagnostics and turn-proof evidence during restart reattachment so
recovery policy can classify and retry them accurately
## Linked Issues or Issue Description
**What happened?**
When Core restarts while a `per_turn` `plugin_task` Runner is active and
the Runner exits before `reattach_remote_runner` runs,
`verifyPluginRunnerTaskReattachment` throws a raw `Error("Plugin Runner
is not running")`. The executor does not emit
`native.remote_runner_recovery_failed`, does not attach
`providerTurnIssued: false` from the controller journal, and
`requestRestartInterruptedTurnRetry` fails to recognize the exited
Runner.
**Expected behavior**
When `status.executionStopped === true`,
`verifyPluginRunnerTaskReattachment` throws a
`RemoteRunnerRecoveryError` with `stage: "process_verification"` and
`reason: "process_not_running"`, attaches best-effort redacted
exited-runner diagnostics from `read_state` when
`status.sessionStateAvailable === true`, and `migrateRunnerdStateRoot`
wraps the error with `withRemoteRunnerTurnProof(error, scoped)`. When
the status probe returns a non-status result or a non-running phase
without `executionStopped === true`, it throws
`RemoteRunnerRecoveryError` with `reason: "probe_failed"` instead of
falsely proving exit.
**Steps to reproduce**
1. Start a native run backed by a `plugin_task` Runner with a controller
journal that proves no turn was issued.
2. Restart Core and trigger `reattach_remote_runner` after the plugin
task reports `executionStopped: true`.
3. Observe that `verifyPluginRunnerTaskReattachment` throws a raw
`Error("Plugin Runner is not running")` and
`executePaperclipNativeSession` does not emit
`native.remote_runner_recovery_failed`.
**Paperclip version or commit**
`f4baaa4f48` (`master`)
**Deployment mode**
Self-hosted server
**Installation method**
Built from source (pnpm dev / pnpm build)
## What Changed
- Updated `verifyPluginRunnerTaskReattachment` in
`server/src/services/native-runtime/plugin-runner-task.ts` to:
- Throw `RemoteRunnerRecoveryError({ stage: "process_verification",
reason: "probe_failed" })` when the status probe does not return `kind:
"status"` or reports `phase !== "running"` without `executionStopped ===
true`.
- Throw `RemoteRunnerRecoveryError({ stage: "process_verification",
reason: "process_not_running", ... })` when `status.executionStopped ===
true`, attaching best-effort redacted `describeExitedRemoteRunner` and
`describeExitedRemoteRunnerReason` diagnostics from `read_state` when
`status.sessionStateAvailable === true` and the identity matches.
- Wrapped `verifyPluginRunnerTaskReattachment(...)` in
`migrateRunnerdStateRoot`
(`server/src/services/native-runtime/native-session-executor.ts`) with
`withRemoteRunnerTurnProof(error, scoped)`, matching non-plugin sandbox
reattachment.
- Added unit tests in
`server/src/services/native-runtime/plugin-runner-task.test.ts` covering
stopped tasks with and without `sessionStateAvailable`, best-effort
`read_state` failure/mismatch, and `probe_failed` responses.
- Added an integration-style executor test in
`server/src/services/native-runtime/native-session-executor.test.ts`
verifying `providerTurnIssued: false` and
`native.remote_runner_recovery_failed` emission on
`reattach_remote_runner` for a stopped `plugin_task`.
## Verification
- Verified red-before-fix failures on both new test suites (`expected
Error: Plugin Runner is not running to be an instance of
RemoteRunnerRecoveryError`).
- `pnpm --dir server exec vitest run
src/services/native-runtime/plugin-runner-task.test.ts` — 120/120
passed.
- `pnpm --dir server exec vitest run
src/services/native-runtime/native-session-executor.test.ts -t
"classifies a stopped plugin_task on reattach_remote_runner|reattaches a
surviving plugin task through its owner"` — 6/6 passed.
- `pnpm --dir server typecheck` — passed.
## Risks
- Low risk. The change is scoped to `verifyPluginRunnerTaskReattachment`
and its `plugin_task` reattachment caller in `migrateRunnerdStateRoot`.
- Any caller or log parser that previously matched the unstructured
`"Plugin Runner is not running"` string now receives the standard
`RemoteRunnerRecoveryError`
(`runner_remote_process_identity_unavailable`) used by other remote
Runner reattachment paths. No existing tests or code in the repository
matched that string.
- Terminal phases without `executionStopped === true` report `reason:
"probe_failed"` rather than `process_not_running`, preserving the
invariant that only explicit `executionStopped === true` proves the task
and descendants stopped.
## Model Used
- Google DeepMind Gemini 4 Neon (Medium reasoning budget)
## 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>
|
||
|
|
244e20a293 |
fix(server): settle prior pending_cleanup leases and recheck stopped ownership on same-run retry (#23770)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The server environment runtime and sandbox creation ownership layer coordinate plugin-task leases across same-run retries and resumptions > - Same-run plugin-task retries can fail with `setup_failed`: `Sandbox creation has already transferred ownership` in two situations > - First, `createOwnedSandbox` has a check-then-read race when the prior lease finishes releasing with a valid termination receipt between `createdSandboxStopped` and `getLeaseById` > - Second, same-run native resumption with `nativeLeaseOwner` (without `nativeRestartRecovery`) leaves `recoverPluginTask` false, and `recoverPluginTask` in `environmentRunOrchestrator` does not retry plain `pending_cleanup` plugin leases before checking `remoteExecutionHasReleased` > - This pull request closes the `createOwnedSandbox` race, enables `recoverPluginTask` for same-run `nativeLeaseOwner` resumptions, and retries prior `pending_cleanup` plugin leases before checking termination receipts > - The benefit is reliable same-run plugin-task recovery without relaxing the invariant that no second sandbox starts without a proven remote termination receipt ## Linked Issues or Issue Description **What happened?** Same-run plugin-task retries and resumptions fail with `setup_failed`: `Failed to acquire lease for environment ... (plugin): Sandbox creation has already transferred ownership`. This occurs either when a prior lease finishes releasing with a stop receipt between `createdSandboxStopped` and `getLeaseById` in `createOwnedSandbox`, or when a prior `pending_cleanup` lease is not settled during same-run recovery. **Expected behavior** When a prior lease has already stopped with a valid termination receipt, `createOwnedSandbox` re-admits the replacement operation cleanly. When a same-run native resumption runs with `nativeLeaseOwner`, `recoverPluginTask` retries prior `pending_cleanup` plugin leases; if teardown succeeds with a stop receipt, the replacement lease acquires cleanly, and if teardown fails, recovery fails closed with `native_plugin_recovery_termination_unconfirmed` without creating a second sandbox. **Steps to reproduce** 1. Run a `paperclip_runner` task on a plugin environment so an `attached` row exists in `sandbox_creation_operations`. 2. Leave the prior lease in `pending_cleanup` (or release it with a valid termination receipt between `createdSandboxStopped` and `getLeaseById`). 3. Resume or retry the same run; before this change, acquisition fails with `Sandbox creation has already transferred ownership` or fails without retrying the `pending_cleanup` teardown. **Paperclip version or commit** `f4baaa4f48` (`master`) ## What Changed - Re-check `createdSandboxStopped(db, operation)` in `server/src/services/sandbox-creation-operations.ts` when `existing && existing.status !== "active"` after `getLeaseById`, and re-admit via `admit(operation)` when the prior sandbox is proven stopped before throwing. - Enable `recoverPluginTask` in `server/src/services/heartbeat/workspace-preparation.ts` for same-run native resumptions with `runOptions.nativeLeaseOwner` when `!restartRecovery`, `!priorVerificationLease`, and `!portablePreparationLeaseId`. - Retry prior `pending_cleanup` plugin leases in `server/src/services/environment-run-orchestrator.ts` (using an atomic `pendingCleanupInFlight` claim, `retryPendingSandboxTeardown`, and `releaseLease`) before checking `remoteExecutionHasReleased`, releasing the in-flight flag on failure and failing closed with `native_plugin_recovery_termination_unconfirmed`. - Add red-before-fix regression tests in `server/src/__tests__/plugin-runner-task.integration.test.ts` and `server/src/services/heartbeat/workspace-preparation.test.ts`. ## Verification - Verified red-before-fix failures before editing production code: - `pnpm --dir server exec vitest run src/__tests__/plugin-runner-task.integration.test.ts -t "pending_cleanup|createOwnedSandbox"` (3 failed: `pending_cleanup` teardown not attempted / `native_plugin_recovery_termination_unconfirmed`, and `createOwnedSandbox` threw `Sandbox creation has already transferred ownership`). - `pnpm --dir server exec vitest run src/services/heartbeat/workspace-preparation.test.ts -t "enables recoverPluginTask"` (1 failed: `recoverPluginTask` was `false`). - Verified green-after-fix: - `pnpm --dir server exec vitest run src/__tests__/plugin-runner-task.integration.test.ts` — 12/12 passed. - `pnpm --dir server exec vitest run src/services/heartbeat/workspace-preparation.test.ts -t "enables recoverPluginTask|retired inherited runner|same-run"` — 4/4 passed. - `pnpm --dir server typecheck` — passed across all layers. ## Risks - Low risk. No database schema or API contract changes. - Preserves the fail-closed termination invariant: no second sandbox is created unless every prior lease has a proven `hasRemoteTerminationReceipt`, and concurrent cleanup attempts are fenced by `pendingCleanupAttemptId` / `pendingCleanupInFlight`. ## Model Used - Google DeepMind Gemini 4 Neon (Medium reasoning budget) 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> |
||
|
|
686215ecdb |
fix(native-runtime): wait for prior lease release and read same-lease plugin checkpoint (#23768)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The native runtime coordinates per-turn and plugin-task runner state across consecutive runs in `server/src/services/native-runtime/native-session-executor.ts`. > - A committed per-turn plugin run can finish while its async environment lease cleanup is still running, so a follow-up run hits `retirement_refused=prior_lease_active`, quarantines the scoped runner root, and fails. > - A same-run plugin-task retry that reuses the same environment lease without restart recovery also skips `read_state` when local runner authority is absent, which triggers `authority_indeterminate` and quarantines the root. > - This pull request adds a bounded wait for prior lease teardown before refusing `prior_lease_active`, skips quarantine when the prior lease stays active, and reads the plugin checkpoint on same-lease retries when local authority is absent. > - The benefit is that follow-up runs retire finished per-turn owners cleanly instead of poisoning the scoped runner root, and same-lease plugin retries verify their checkpoint instead of failing with `authority_indeterminate`. ## Linked Issues or Issue Description **What happened?** When a per-turn plugin run commits its terminal result and its async environment lease teardown is still in flight, a follow-up run fails with `runner_state_identity_mismatch: prior_owner_terminal_state_indeterminate; retirement_refused=prior_lease_active` and quarantines the scoped runner state root. On a same-run plugin-task retry that reuses the same environment lease without restart recovery, `migrateRunnerdStateRoot` skips reading the plugin runner checkpoint when local runner authority is absent, which causes `runner_state_identity_mismatch: authority_indeterminate` and quarantines the scoped root. **Expected behavior** Follow-up runs wait briefly for an in-flight prior lease release to finish and then retire the finished per-turn owner cleanly. If the prior lease remains active after the bounded wait, the run still refuses with `retirement_refused=prior_lease_active` without retiring into `continuity-breaks` and without quarantining the scoped root. Same-run plugin-task retries on the same lease read and verify the plugin checkpoint via `read_state` when local runner authority is absent and unclaimed bootstrap retry does not apply. **Steps to reproduce** 1. Commit a per-turn plugin run with a bound stop receipt while its `environment_leases` row is still `status: "active"` and `releasedAt: null`. 2. Start a follow-up run on a replacement lease before async lease teardown marks the prior lease released. 3. Observe `migrateRunnerdStateRoot` refuse with `retirement_refused=prior_lease_active` and move the scoped state root into `quarantine/`. 4. Start a same-run plugin-task retry reusing `identity.environmentLeaseId` without `restartRecovery` and without a local `runner/runner-state.json`. 5. Observe `migrateRunnerdStateRoot` throw `runner_state_identity_mismatch: authority_indeterminate` and quarantine the root. **Paperclip version or commit** `master` (`f4baaa4f48`) ## What Changed - Added `priorLeaseReleaseWait` (`5_000 ms` timeout, `100 ms` poll interval), `isPriorRemoteSandboxLeaseEnded`, and `waitForPriorRemoteSandboxLeasesToEnd` in `server/src/services/native-runtime/native-session-executor.ts`. - Updated `migrateRunnerdStateRoot` to wait for in-flight prior remote sandbox lease release when `retireFinishedPerTurnRunnerdOwner` returns `prior_lease_active`, and to retry retirement once if the prior lease ends during the wait. - Updated `migrateRunnerdStateRoot` to skip quarantining `scoped` when retirement still refuses with `prior_lease_active`, matching the existing non-quarantine behavior for `"active"` and `"unavailable"`. - Updated `migrateRunnerdStateRoot` to call `read_state` and `savePluginRunnerCheckpoint` on same-run, same-lease plugin-task retries without `restartRecovery` when `admitUnclaimedNativeBootstrapRetry` does not apply and `runnerdAuthorityLifecycle` is `"absent"`. - Kept this minimal bugfix inside `server/src/services/native-runtime/native-session-executor.ts` (which already exceeds 1,000 lines) because it modifies existing state migration and lease-retirement checks directly in their owning module without introducing a new subsystem. - Added red-then-green regression tests in `server/src/services/native-runtime/native-session-executor.test.ts` covering in-flight prior lease release, persistent unreleased prior lease (no retirement and no quarantine), and same-lease plugin checkpoint verification and mismatch rejection. ## Verification - Verified all 4 new regression tests failed before the fix (`retirement_refused=prior_lease_active`, `scoped` moved to quarantine, and `authority_indeterminate`). - Ran focused tests after the fix: - `pnpm --dir server exec vitest run src/services/native-runtime/native-session-executor.test.ts -t "handles unconfirmed plugin checkpoint status on replacement lease|retires a finished per-turn plugin owner|waits briefly for a stopped per-turn prior lease|admits only an authorized same-run plugin checkpoint|reads same-lease plugin checkpoint instead of quarantining|reattaches a surviving plugin task"` (27 passed, including existing `stopped-lease-unreleased`). - Ran server typecheck: - `pnpm --dir server typecheck` (passed). ## Risks - Low risk. The bounded wait applies only when `retireFinishedPerTurnRunnerdOwner` refuses with `prior_lease_active`, exits early when the prior lease holds the same `providerLeaseId` as the current run or no prior leases exist, and re-runs the full retirement proof before retiring. Same-lease `read_state` runs only after unclaimed bootstrap retry checks and only when local runner authority is `"absent"`, preserving fail-closed identity verification via `savePluginRunnerCheckpoint`. ## Model Used - Google DeepMind Gemini 4 Neon (Medium reasoning budget) 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> |
||
|
|
f5457565de |
fix(heartbeat): retry setup on retryable remote_incomplete workspace failures (#23764)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Before a run starts its provider, Paperclip prepares the task workspace through a workspace provider plugin using a deterministic `operationId` > - A workspace provider can fail preparation with the closed retryable reason `remote_incomplete` when a remote storage or runtime request does not finish > - Setup recorded `remote_incomplete` as a generic `setup_failed` with no bounded retry, and release recovery immediately marked the task `blocked` without retrying the same workspace or showing the workspace failure reason in the escalation notice body > - This pull request gives a fresh pre-dispatch `remote_incomplete` answer its own transient setup code, `workspace_storage_incomplete`, routes it through the bounded bootstrap retry budget (deferring Sentry reporting until the retry decision), and forwards saved `workspaceProviderFailure` details into immediate execution-path escalation notices > - The benefit is that a task retries the same workspace automatically across transient remote storage/runtime failures instead of immediately blocking for a person ## Linked Issues or Issue Description Refs #23362, #19249 **What happened?** When a workspace provider returned the closed retryable reason `remote_incomplete` (`"Workspace storage operation is incomplete; retry the same workspace"`) during workspace bootstrap (`executionRecovery: { kind: "bootstrap", providerWorkStarted: false }`), `failRunSetup` recorded `errorCode: "setup_failed"` and scheduled no retry. Immediately after, `releaseIssueExecution` treated `setup_failed` as non-retryable continuation failure and marked the task `blocked` with a generic notice that omitted the workspace failure reason. **Expected behavior** When a legacy run fails before provider dispatch with a retryable `remote_incomplete` workspace provider answer, setup must classify it as `workspace_storage_incomplete` and schedule a bounded bootstrap retry of the same workspace (matching `workspace_storage_pending` and `plugin_worker_unavailable`). Sentry must report only when no retry is scheduled or retries are exhausted, and immediate execution-path escalation notices must include the bounded `workspaceProviderFailure` message when present. **Steps to reproduce** 1. Start a legacy run whose workspace preparation calls a workspace provider plugin. 2. Have the provider reject preparation with `PluginWorkspaceOperationError("remote_incomplete")`. 3. Before this fix, `failRunSetup` writes `errorCode: "setup_failed"`, schedules no bounded retry, and `releaseIssueExecution` immediately blocks the task. **Paperclip version or commit** Reproduced on `master` (`01ecbadbf1`). **Deployment mode** Self-hosted server and managed plugin workspace environments (`authenticated` and `local_trusted`). ## What Changed - `server/src/services/workspace-provider-failure.ts`: add `WORKSPACE_STORAGE_INCOMPLETE_CODE` (`workspace_storage_incomplete`) and `findWorkspaceStorageIncompleteFailure` matching `kind === "provider" && reason === "remote_incomplete"`. - `server/src/services/heartbeat/run-completion.ts`: map a fresh pre-dispatch legacy `remote_incomplete` failure (with no native session or runner instance) to `workspace_storage_incomplete`, route it through `scheduleBoundedRetryForRun` (keeping accepted interaction retries owned by the interaction lane), and defer Sentry reporting via `workspaceStorageIncompleteRetry`. - `server/src/services/failed-preparation-retry.ts`, `server/src/services/heartbeat/retries.ts`, `server/src/services/legacy-execution-recovery.ts`, `server/src/services/recovery/service.ts`, `server/src/services/agent-task-run-telemetry.ts`: handle `workspace_storage_incomplete` alongside `workspace_storage_pending`. - `server/src/services/recovery/stranded-notice.ts` & `server/src/services/heartbeat.ts`: add a stranded escalation notice for `workspace_storage_incomplete` and pass `workspaceProviderFailure: readWorkspaceProviderFailure(input.runRow.resultJson)` into `buildImmediateExecutionPathRecoveryNoticeSeed`. - `server/src/services/run-failure-diagnostics.ts` & `server/src/services/run-failure-report.ts`: add `workspaceStorageIncompleteRetry` deferred Sentry reporting handshake. - Add red-then-green regression tests in `run-completion.test.ts`, `workspace-provider-failure.test.ts`, `run-failure-report-sandbox-resume.test.ts`, and `heartbeat-retry-scheduling.test.ts`. ## Verification - Red before the fix: - `pnpm --dir server exec vitest run src/services/heartbeat/run-completion.test.ts -t "incomplete workspace storage"` failed on the `fresh` scenario with `errorCode: "setup_failed"` instead of `"workspace_storage_incomplete"`. - Green after the fix: - Focused `run-completion.test.ts`, `run-failure-report-sandbox-resume.test.ts`, `workspace-provider-failure.test.ts`, `agent-task-run-telemetry.test.ts`, `heartbeat-retry-scheduling.test.ts` (`bootstrap retries across restart`), and `pnpm --dir server typecheck` all pass. ## Risks - Low risk. No database schema, API route, or plugin wire protocol changes. - Retry applies only before provider dispatch on a legacy run with no native session or runner instance, bounded by the existing bootstrap retry budget (2 retries). Started and native runs keep `setup_failed` with no automatic retry. - Every workspace preparation call carries a deterministic `operationId` derived from workspace ID, generation, and operation payload, and `remote_incomplete` is explicitly marked `retryable: true` for the same workspace. ## Model Used - Google DeepMind Gemini 4 Neon (Medium reasoning budget), via Antigravity with tool use (code search, file edits, local test execution, and GitHub CLI). ## 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> |
||
|
|
638530f273 |
fix(cli): support all release channels in update (#11795)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The managed CLI lets operators follow a release channel during updates > - Paperclip publishes stable, beta, nightly, and canary channels > - The update command only let users select stable or canary > - A default update also changed recorded beta and nightly installs to stable > - This pull request adds all four channels to the update command and update notice > - The benefit is that each managed install stays on the channel that the operator selected ## Linked Issues or Issue Description **What happened?** `paperclipai update` only accepted `--latest` and `--canary`. It did not accept `--beta` or `--nightly`. A default update mapped every recorded channel except canary to `latest`. The update notice used the same two-channel rule. **Expected behavior** The command must accept all four published channel selectors. A default update must use the moving channel in the install manifest. The update notice must check the same channel. **Steps to reproduce** 1. Record `beta` or `nightly` as the managed install channel. 2. Run `paperclipai update` without a channel flag. 3. Observe that the command resolves `paperclipai@latest` instead of the recorded channel. **Paperclip version or commit** Commit `e1ce7a553c280ef3d2b9ed99e0149afc23b14275`. **Deployment mode** This bug is not specific to a deployment mode. **Installation method** Managed CLI install. **Additional context** The managed update workflow was added in #10045. I found no duplicate issue or pull request for this channel gap. ## What Changed - Added `--beta` and `--nightly` to `paperclipai update` and `paperclipai upgrade`. - Expanded the install manifest channel type and kept the recorded moving channel during a default update. - Made update notices use the recorded channel and made the notice cache channel-aware. - Added regression tests and updated the channel, CLI, and installation documents. ## Verification - `pnpm exec vitest run cli/src/__tests__/update-command.test.ts cli/src/__tests__/update-notice.test.ts` — 2 files and 18 tests passed. - `pnpm --filter paperclipai typecheck` passed. - `pnpm --filter paperclipai build` passed. - `pnpm paperclipai update --help` showed `--latest`, `--beta`, `--nightly`, and `--canary`. ## Risks - Low risk. The change adds accepted manifest values and command flags. Existing latest, canary, and pinned installs keep their current behavior. - Old notice cache files have no channel field. They remain valid for the latest channel and refresh for other channels. > 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 - OpenAI Codex, GPT-5 family. The runtime does not expose the exact deployment ID or context window. The agent used reasoning, repository tools, shell execution, and test execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] 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: Dev Agent <dev@paperclip.ing> Co-authored-by: Paperclip <noreply@paperclip.ing> Co-authored-by: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com> |
||
|
|
f4baaa4f48 |
fix(pi-local): respect message roles in transcripts (#11781)
## Thinking Path > - Paperclip manages AI agents and shows their run transcripts > - The Pi local adapter converts Pi JSON stdout events into transcript entries > - Pi emits `message_end` events for user, assistant, and tool-result messages > - The parser marked text from every `message_end` event as assistant output > - This made the wake payload look like assistant output and repeated tool results > - This pull request maps user messages to user entries and ignores other non-assistant messages > - The benefit is correct speaker attribution without a change to assistant output ## Linked Issues or Issue Description Fixes: #11780 ## What Changed - Read `message.role` before creating transcript entries. - Render user messages as user entries. - Ignore tool-result and unsupported roles in `message_end`. - Add regression tests for user, assistant, tool-result, and unsupported roles. ## Verification - `pnpm exec vitest run packages/adapters/pi-local/src/ui/parse-stdout.test.ts --config packages/adapters/pi-local/vitest.config.ts` — 4 tests passed. - `pnpm --filter @paperclipai/adapter-pi-local typecheck` — passed. - `pnpm --filter @paperclipai/adapter-pi-local build` — passed. - `pnpm -r typecheck` — passed. - `pnpm build` — passed. - `pnpm test:run` — 4,498 tests passed, 30 failed, and 5 skipped. The failures are in unrelated server suites on macOS. They cover `/tmp` and `/private/tmp` path differences, workspace runtime checks, and test port allocation. The Pi parser regression tests passed again after the full run. ## Risks Low risk. This change only affects Pi `message_end` transcript classification. Assistant text and thinking output stay the same. > 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 OpenAI Codex with a GPT-5-based model. The session used reasoning, tool use, and code execution. The exact model ID and context window were 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 - [ ] 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 |
||
|
|
655d6c9d8e |
fix(cli): make -C/--company-id optional on client commands enforced via resolveCommandContext (#11601)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - The `paperclipai` CLI is how humans and other agents drive Paperclip
from a terminal or script
> - Many `client/*` command files declare `-C, --company-id` with
`.requiredOption(...)`, so commander aborts argument parsing before the
command's action ever runs
> - Every one of those same actions calls `resolveCommandContext(opts, {
requireCompany: true })`, which already resolves the company id from
`--company-id` -> `PAPERCLIP_COMPANY_ID` -> the context profile, and
throws a clear error only when all three are empty
> - So a command like `agent list` fails immediately on a bare parse
error even when the caller has `PAPERCLIP_COMPANY_ID` exported or a
context profile set, while a sibling command like `issue list` (no
`requiredOption`) works fine from the same environment — same resolver,
inconsistent enforcement point
> - This pull request replaces `.requiredOption("-C, --company-id <id>",
...)` with `.option(...)` at every site backed by
`resolveCommandContext(..., { requireCompany: true })`, leaving
`requireCompany: true` untouched so the resolver still enforces the
requirement, just with its existing, more informative error message
> - The benefit is that `--company-id` behaves consistently across every
client command: env var and context-profile fallback always work, and
the error message when nothing is set comes from one place instead of
commander's generic "required option not specified"
## Linked Issues or Issue Description
No public GitHub issue exists for this yet, so following the Enhancement
proposal template inline:
**What existing behavior does this improve?**
The `-C, --company-id` option on CLI client commands under
`cli/src/commands/client/`.
**Subsystem affected**
Unsure / cross-cutting within the CLI — this is not one of the listed
subsystems (server/, ui/, packages/db, packages/shared,
packages/adapters, packages/plugins); it is
`cli/src/commands/client/**`.
**Current behavior**
28 commands across
`cli/src/commands/client/{activity,agent,approval,company,goal,plugin,project,secrets,token}.ts`
declare `-C, --company-id` via commander's `.requiredOption(...)`.
Commander enforces that flag at argument-parse time and exits with a
generic `error: required option '-C, --company-id <id>' not specified`
before the command's action function runs — even though every one of
those actions calls `resolveCommandContext(opts, { requireCompany: true
})`, which is fully capable of resolving the company id from
`PAPERCLIP_COMPANY_ID` or the context profile. Other commands in the
same CLI (e.g. `issue list`) use `.option(...)` for the same flag and
already work from env/profile. The result is an inconsistent, confusing
failure mode depending on which command you call.
**Proposed behavior**
All 28 sites use `.option("-C, --company-id <id>", ...)` instead of
`.requiredOption(...)`. `requireCompany: true` stays in
`resolveCommandContext`, so a company id is still required end-to-end —
it can now come from `--company-id`, `PAPERCLIP_COMPANY_ID`, or the
context profile, uniformly, with one shared, descriptive error message
when none of the three are set.
**Breaking changes**
None for correctly-configured callers. A caller that relied on
commander's parse-time rejection (rather than the resolver's `Company ID
is required...` message) would see a different error message, but the
exit-code behavior (non-zero, no company id resolved) is unchanged. No
response shape, output format, or successful-path behavior changes.
## What Changed
- Replaced `.requiredOption("-C, --company-id <id>", ...)` with
`.option("-C, --company-id <id>", ...)` at all 28 call sites across
`cli/src/commands/client/activity.ts`, `agent.ts`, `approval.ts`,
`company.ts`, `goal.ts`, `plugin.ts`, `project.ts`, `secrets.ts`, and
`token.ts`.
- Left `resolveCommandContext(opts, { requireCompany: true })` unchanged
everywhere — enforcement still happens there, with its existing error
message.
- Added `cli/src/__tests__/company-id-option.test.ts`, a regression test
modelled on `auth-command-registration.test.ts` that registers every
affected command family (`company`, `issue`, `agent`, `approval`,
`activity`, `dashboard`, `feedback`, `goal`, `plugin`, `project`,
`secrets`, `token`), walks the full command tree, and asserts
`--company-id` is never `mandatory` (commander's `.requiredOption`
discriminator) and never declared more than once on the same command.
## Verification
```
$ grep -rn 'requiredOption("-C' cli/src/commands/client/
# exit code 1, no matches
```
```
$ cd cli && pnpm exec vitest run src/__tests__/company-id-option.test.ts
Test Files 1 passed (1)
Tests 2 passed (2)
```
Red on the unpatched tree (reverting only the fix files reproduces 9+
offending commands):
```
$ git stash push -- cli/src/commands/client/*.ts
$ pnpm exec vitest run src/__tests__/company-id-option.test.ts
❯ … 1 failed
AssertionError: --company-id must never be mandatory; offending commands: …
$ git stash pop
```
```
$ pnpm -C cli build
# green (tsc --noEmit at the repo root reports ~139 pre-existing errors in
# server/src/** from a missing built @paperclipai/plugin-sdk dist, present
# identically on the unpatched tree and unrelated to this diff;
# cli/src/commands/client/** itself has zero new type errors)
```
Behavioral check via `cli/src/index.ts`:
```
$ PAPERCLIP_COMPANY_ID=test-co-123 PAPERCLIP_API_KEY=fake pnpm exec tsx src/index.ts agent list --json
API error 401: Unauthorized
# past argument parsing, into an HTTP/auth error — this is the intended fix
$ pnpm exec tsx src/index.ts agent list --json --context /tmp/pc-empty-context.json
Company ID is required. Pass --company-id, set PAPERCLIP_COMPANY_ID, or set context profile companyId via `paperclipai context set`.
```
## Risks
Low risk. This only relaxes a commander-level parse constraint; the
underlying requirement (`requireCompany: true`) is untouched, so every
affected command still refuses to proceed without a resolvable company
id. The main behavioral shift is the error message and the point at
which the error surfaces (resolver instead of commander), which is
strictly more informative. No API, schema, or persisted-data changes.
## Model Used
Claude (Anthropic), Claude Opus, extended thinking / chain-of-thought
reasoning enabled, with tool use (repo grep/read/edit, test execution)
throughout implementation and 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
- [ ] 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
## Related PRs found during duplicate search
- #4276 (`feat(cli): unify issue flag matrix (A+B) — -C optional +
per-subcommand guards`) — open, overlapping intent (also makes `-C`
optional) but scoped to `issue create` only plus a separate flag-hint
feature; does not touch the other 27 sites this PR fixes. Not a
duplicate.
- #2538 (`Refine CLI company commands behavior, tests`) — open, touches
`company.ts` but for import-adapter validation, unrelated to
`--company-id` enforcement. Not a duplicate.
No exact duplicate of this PR's scope (making `--company-id` a
non-mandatory option across all 28 client-command call sites while
keeping resolver-level enforcement) was found in the open or closed PR
list.
---------
Co-authored-by: dzianisv <dzianisv@gmail.com>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com>
|
||
|
|
314bc70c1f |
docs: company-creator: resolve the import command from the checkout (#10849)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - The company-creator skill generates portable company packages that
users import into Paperclip
> - Step 6 of the skill tells the author to document the import command
in the package README
> - The documented command `paperclipai company import --from <path>`
does not work, because the CLI takes the source as a positional argument
> - Every generated README therefore ships a getting-started command
that fails on first use
> - This pull request makes the skill resolve the import entrypoint from
the checkout before it writes the README
> - The benefit is that the instruction cannot drift again, because the
skill reads the current interface instead of repeating a memorised one
## Linked Issues or Issue Description
No public issue exists for this. The problem is described below,
following the bug report template.
**What happened.** The company-creator skill tells the author to
document importing with `paperclipai company import --from <path>`. That
command fails. `cli/src/commands/client/company.ts:1401` declares
`.argument("<fromPathOrUrl>")`, and the import block declares no
`--from` option. The source is positional.
**Expected behavior.** The command written into a generated README runs
successfully.
**Steps to reproduce.**
1. Run `grep -n "company import"
.agents/skills/company-creator/SKILL.md`. The result shows the `--from`
form.
2. Run `grep -n 'command("import"' -A 12
cli/src/commands/client/company.ts`. The result shows a positional
`<fromPathOrUrl>` argument and no `--from` option.
3. Generate a company package with the skill. The README contains a
getting-started command that fails.
**Paperclip version or commit.** `master` @ `d5b9f6c`.
**Related pull requests.** These change import behaviour. None of them
corrects the skill's documented invocation, so this pull request is not
a duplicate.
Refs #10237, Refs #10245, Refs #10246, Refs #10248, Refs #7289, Refs
#4137
## What Changed
- Step 6 now tells the author to resolve the import entrypoint from the
checkout before writing the README. It greps the CLI command first, and
falls back to the `openapi.ts` HTTP route if no CLI command exists.
- The step records the currently correct positional form as an example.
- The step documents that `--include` must be passed explicitly. An
incomplete include set imports a subset and still returns success, so a
package can land with zero projects, tasks and skills and look correct.
## Verification
- Run `grep -n 'command("import"' -A 12
cli/src/commands/client/company.ts`. The output shows the positional
`<fromPathOrUrl>` argument and the supported `--include` values. This
confirms the new example.
- Run `grep -c 'company import --from'
.agents/skills/company-creator/SKILL.md`. The output is `0`. This
confirms the broken form is gone.
- This pull request changes documentation only. It touches no runtime
code path.
## Risks
Low risk. The change is Markdown only. There is no code change, no
migration, and no behavioural shift. The worst case is that the example
ages again. The new resolve-from-the-checkout instruction is designed to
prevent exactly that, because it tells the author to read the current
interface instead of copying a remembered one.
## Model Used
Claude Opus 5 (`claude-opus-5`), used through Claude Code with extended
thinking and tool use (shell commands and file edits). The corrected
invocation was derived by reading `cli/src/commands/client/company.ts`
in this checkout, not from model memory.
## 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 — not run. This pull
request changes one Markdown file and no code path.
- [ ] I have added or updated tests where applicable — no test applies
to a documentation string.
- [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 — not yet confirmed on this
commit.
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups —
currently 4/5, pending this description update.
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: emircbngl <259049573+emircbngl@users.noreply.github.com>
Co-authored-by: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com>
|
||
|
|
73c43fd443 |
test(issues): guard the blockerAttention early-warning against cancelled-child noise (#10375)
## Thinking Path > - Paperclip orchestrates AI agents in companies where no human watches the board continuously. > - `blockerAttention` is the early-warning system for blocked issues: it distinguishes a blocked issue that has a live path from one that is blocked in prose only, with no first-class blocker and therefore no wake path. > - The graph it walks is `explicit blockedBy edges ∪ non-terminal direct children`. > - #7577 correctly made cancelled direct children terminal, because a cancelled child is neither a dependency nor a source of liveness — before that fix a cancelled child pinned its parent to `needs_attention` forever, since a cancelled issue never becomes `done`. > - Two contract branches around that behaviour had no assertion in the suite, so nothing pins the signal's two ends: the pure early-warning case (blocked, zero edges) and the cancelled-child edge count in isolation. > - This PR adds those two guards. It is test-only; no behaviour changes. ## Linked Issues or Issue Description Refs #7578 (the cancelled-child defect fixed by #7577). **Issue this addresses:** the regression test added in #7577 asserts the parent is `covered`, but that parent also has two live explicit blockers holding the state up. If the cancelled-child filter regressed, the counts would change while the *state* could still look plausible in other shapes, and the case the feature exists for — a blocked issue with **no** blocker edges at all — has no assertion anywhere in the file. `unresolvedBlockerCount: 0` appears in no test today. Related PRs found while searching (neither overlaps; both touch blocker relations, not `blockerAttention` classification): #8251 (blocker summaries for legacy child blockers), #10316 (reject `done` while first-class blockers remain open). ## What Changed Two tests in `server/src/__tests__/issue-blocker-attention.test.ts`: - **`flags a blocked issue that has no blocker edges at all`** — a blocked, agent-assigned issue with no relations and no children must report `needs_attention` / `attention_required` with all four counts at 0. This is the text-only-blocked case the signal is built to catch, and it was unasserted. - **`keeps a blocked parent attention-needed when its only child was cancelled`** — a blocked parent whose sole child is `cancelled` must report `unresolvedBlockerCount: 0` and stay `needs_attention`. This pins the cancelled-child edge count on its own, without live explicit blockers masking it. No production code touched. ## Verification - `node_modules/.bin/vitest run server/src/__tests__/issue-blocker-attention.test.ts` on this branch → **26 passed**. - Control run, to prove the guards bite: reverted the #7577 filter in `listIssueBlockerAttentionMap` back to `ne(issues.status, "done")` → **2 failed / 24 passed**, both cancelled-child tests: - `ignores cancelled direct children …`: `unresolvedBlockerCount` 3 instead of 2, state `needs_attention` instead of `covered` - `keeps a blocked parent attention-needed when its only child was cancelled`: `unresolvedBlockerCount` 1 instead of 0 Restored the filter → 26 passed again. - The zero-edge test passes both before and after that revert, as intended: it is the negative control that proves the fix does not blind the detector. ## Risks - Test-only; no runtime behaviour changes, no schema or API surface touched. - The new tests use the file's existing `createCompany` / `insertIssue` helpers and fresh issue prefixes (`PBE`, `PBF`), so they do not interact with sibling cases. ## Model Used - Claude Opus 5 (1M context) via Claude Code CLI, tool-enabled; used for repository inspection, test authoring, and local vitest execution including the revert-based control run. ## 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 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 (not applicable; test-only change) - [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: AURDVIN Dev Agent <juan@rial.ch> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com>canary/v2026.1204.0-canary.888200 |
||
|
|
def3ac2e7e |
test: cover create-time issue blocker links (#10320)
## Thinking Path > - Paperclip is the control plane people use to coordinate AI-agent work. > - Issue dependencies are first-class board mechanics that must survive issue creation. > - The service layer already persists `blockedByIssueIds` transactionally and decorates create responses after #8901. > - The public create route did not have an end-to-end regression proving that contract. > - Without route-level coverage, a validator or route mapping regression could again return success while silently dropping dependency data. > - This pull request exercises the real HTTP and database path for create-time blockers. > - The benefit is an executable contract that prevents successful creates from silently losing blocker links. ## Linked Issues or Issue Description Refs #8901 Bug regression: - What happened: an issue create request containing `blockedByIssueIds` could report success while its response omitted the requested blocker relation. - Expected behavior: a successful create persists the blocker edge and returns it immediately; a subsequent read returns the same edge. - Steps to verify: create a blocker, create a blocked issue with the blocker's ID, then inspect both the `201` response and a fresh issue read. - Paperclip version/commit: regression coverage added on current `master`. - Deployment mode: local trusted integration-test environment. Related public work: - #8901 implemented create-response relation summaries. - #4099 covers blocker readback shape more broadly. ## What Changed - Added an embedded-Postgres route regression that creates an issue with `blockedByIssueIds`. - Asserted both the `201` create response and a subsequent `GET` contain the persisted blocker summary. ## Verification - `pnpm exec vitest run server/src/__tests__/issue-create-deduplication-routes.test.ts` — 9/9 passed. - `pnpm -r typecheck` — passed. - `pnpm build` — passed. - `pnpm test:run` — 2,823 passed, 1 skipped, 2 unrelated failures in `workspace-runtime.test.ts` caused by local auto-port adoption/collision behavior (`EADDRINUSE`). - `bin/ci` is absent; the repository-documented gates above were used. ## Risks Low risk. This changes test coverage only. The test uses the existing embedded-Postgres harness and does not alter production behavior. > `ROADMAP.md` contains no matching blocker/create-contract work. This is regression coverage for an existing behavior, not a new core feature. ## Model Used OpenAI Codex, GPT-5, with reasoning and repository-aware shell/code execution tools. The serving context-window size is managed by the runtime. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [ ] 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: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com> |
||
|
|
8702344284 |
Coalesce dynamic parser transcript recomputations (#9926)
## Thinking Path > - Paperclip renders agent run logs into human-readable transcripts in the board UI > - External adapters parse stdout inside a sandboxed Web Worker > - Worker parsing is asynchronous, while the transcript builder consumes cached results synchronously > - Each completed line currently notifies the registry independently and rebuilds the complete transcript > - Large JSONL runs therefore trigger thousands of redundant React updates and full-log reparses > - This pull request batches completed-line notifications to one per animation frame > - The benefit is bounded UI recomputation without changing adapter output or parser semantics ## Linked Issues or Issue Description Refs #8806. That PR fixes the worker startup failure that exposed this downstream performance problem. **What happened:** Once an external parser Worker is active, each parsed JSONL line calls the registry notifier. A captured OMP run contained 3,577 lines, so one burst could request 3,577 full transcript recomputations. **Expected behavior:** Parsed line results should populate the cache immediately, while transcript recomputation should happen at most once per browser animation frame. **Steps to reproduce:** Load an external-adapter run with thousands of JSONL stdout lines, let the Worker resolve the parse requests in one burst, and count calls to the dynamic-parser result notifier. **Version/deployment:** Reproduced against Paperclip 2026.720.0, local `paperclipai onboard` deployment, Chrome on Fedora/WSL. ## What Changed - Schedule dynamic parser result notification with `requestAnimationFrame`. - Keep a single pending frame so additional Worker results reuse it. - Add a 3,577-line regression test proving one notifier call per frame instead of one per line. ## Verification - `pnpm exec vitest run ui/src/adapters/dynamic-loader.test.ts` — 1 passed. - `pnpm --filter @paperclipai/ui typecheck` — passed. - `pnpm --filter @paperclipai/ui build` — passed (existing CSS/font/chunk-size warnings only). - Browser replay after the companion worker fix: the 3,577-line OMP run stabilized as 22 Nice transcript entries with no raw `message_update`/`toolcall_delta` rows. ## Risks - Low risk: cached parse results are unchanged; only registry notification timing changes. - Visible transcript updates may arrive up to one animation frame later. - Browsers throttle animation frames in hidden tabs, but no hidden-tab render is useful; cached results render when the tab becomes visible. > This is a tightly scoped UI performance fix. ROADMAP.md contains no overlapping planned work. ## Model Used - `sub2api-codex/gpt-5.6-sol`, tool-assisted coding and browser execution with high-reasoning workflow; context-window size was not independently verified. ## 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 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 |
||
|
|
e53cce2257 |
fix: accept nested git worktree folders for local adapters (#7957)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Local adapters such as `codex_local` need workspace validation before launching agent runs. > - The validator became too strict by requiring `.git` metadata directly inside the adapter cwd. > - Git itself treats subdirectories of a repository as valid worktree paths, and Codex can operate from those nested folders. > - Paperclip project folders can be configured as subdirectories inside a larger Git worktree. > - This pull request aligns Paperclip validation with Git's own worktree detection. > - The benefit is fewer false `workspace_validation_failed` errors while still rejecting folders outside any Git worktree. ## Linked Issues or Issue Description - Fixes: #7956 ## What Changed - Replace direct `cwd/.git` metadata checking with `git -C <cwd> rev-parse --is-inside-work-tree`. - Add regression coverage for a workspace-linked issue whose adapter cwd is nested inside a parent Git worktree. - Clean up the temporary Git fixture created by that regression test. - Preserve rejection behavior for folders that are not inside any Git worktree. ## Verification - `pnpm --filter @paperclipai/server exec vitest run src/__tests__/heartbeat-workspace-session.test.ts` - `pnpm --filter @paperclipai/server typecheck` Local validation results: - `heartbeat-workspace-session.test.ts`: 107 tests passed. - Server typecheck passed. ## Risks - Low risk. This changes validation from a stricter direct `.git` file check to Git's own worktree detection. - Requires `git` to be available for git-sensitive local adapter validation. These adapters already require Git-compatible workspaces. - Still fails closed for missing, invalid, or non-git workspace paths. > 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 Codex, GPT-5.5, with repository inspection, shell execution, local runtime validation, and focused 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 run tests locally and they pass - [x] I have added or updated tests where applicable - [x] If this change affects the UI, I have included before/after screenshots - [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: zocomputer <help@zocomputer.com> Co-authored-by: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com> |
||
|
|
42a800f0cc |
chore: fix typo cleanup across docs and worker warning (#4305)
Closes #4304 ## Thinking Path > - Paperclip is a control plane for AI-agent companies, so small wording issues in docs and operator-facing logs still shape day-to-day usability. > - This branch only touches low-level text in documentation and one server warning string. > - The problem here is narrow: several obvious typos remained in user-facing docs and a worker parse warning. > - These should be corrected without changing product behavior, API contracts, or control-plane invariants. > - This pull request applies five isolated typo fixes, keeping each file change minimal and reviewable. > - The benefit is cleaner documentation and a more polished warning message with essentially no functional risk. ## What Changed - Fixed `entreprenuer` -> `entrepreneur` in `README.md`. - Fixed `entreprenuer` -> `entrepreneur` in `cli/README.md`. - Fixed `browseable` -> `browsable` in `doc/CLIPHUB.md`. - Fixed `clonable` -> `cloneable` in `doc/plans/2026-02-16-module-system.md`. - Fixed `unparseable` -> `unparsable` in the worker parse warning string in `server/src/services/plugin-worker-manager.ts`. ## Verification - Ran `pnpm -r typecheck`. - Re-checked the touched files with `typos` review workflow. ## Risks - Low risk. These are text-only changes; the only non-doc edit is a log-message wording correction with no behavior change. ## Model Used - OpenAI Codex, GPT-5-based coding agent in the Codex CLI environment; exact deployed model ID/context window not exposed in-session; used terminal tool execution, repository inspection, and patch application. ## 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 run tests locally and they pass - [x] I have added or updated tests where applicable - [x] If this change affects the UI, I have included before/after screenshots - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com> |