Commit Graph
2678 Commits
Author SHA1 Message Date
75b22e264d fix(ui): honor Project visibility on Kanban cards (#16714)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - People use task collections to track work across projects.
> - The collection has a Project visibility setting and a Kanban view.
> - The list reads that setting, but board cards receive neither the
setting nor the project metadata.
> - This pull request passes the existing preference and project map to
the board and its drag preview.
> - The benefit is that people see each known project's name and color
on the board when they enable Project.

## Linked Issues or Issue Description

Related prior work: #3686 by @levineam and #7243 by @cassioln. Both PRs
are closed without a merge. Thank you to both authors for the earlier
work on project metadata in board cards. I searched open and closed PRs
and issues before starting this focused follow-up.

**What happened?**

In the task board, enabling Project in the Columns menu does not show
the project on any card. The collection reads the saved preference for
list rows, but does not pass it or its existing project map to
`KanbanBoard`.

**Expected behavior**

A card shows its known project's name and color when Project is enabled.
Disabling Project hides the badge. Regular cards, compact cards, and the
drag preview use the same setting. A long name stays inside the card and
keeps its full text in the title. A task with no known project has no
badge.

**Steps to reproduce**

1. Create a project and a task in that project.
2. Open the Tasks collection and select board view.
3. Open Columns and enable Project.
4. Check the task card. On `master`, it still shows no project.

## What Changed

- Pass the saved Project visibility setting and the existing project map
from the collection to the board. Both the streamlined and the legacy
collection do this.
- Show a token-styled badge with the project color, a truncated name,
and the full name in its title. Use it in regular cards, compact cards,
and the drag preview.
- Cover saved enabled and disabled preferences in both collections,
badge color, unknown or unset projects, neutral color fallback, long
names, and drag-preview visibility in component tests.
- Add three Storybook fixture states.

Scope update (2026-11-11): the branch is rebuilt as one commit on
current `master` (`14cb692`). Earlier revisions also carried shared CI
repairs (CLI startup deadline, legacy heartbeat cleanup handoff, and a
scheduled-retry test wait). Those changes are not part of this fix and
are removed from this PR. The feature-map paragraph is removed too,
because routine fixes leave the maps unchanged.
`doc/SPEC-implementation.md` no longer exists on `master` (#20565), so
the spec paragraph is removed too.

## Verification

Run in a clean Node 24.22 container with `pnpm install
--frozen-lockfile`, on `9d3d138`. The current head `ed05687` only
removes the feature-map paragraph from that revision:

- `cd ui && vitest run src/components/KanbanBoard.test.tsx
src/components/IssuesList.test.tsx src/components/IssueColumns.test.tsx
--maxWorkers=1` — 3 files, 103 tests passed.
- `pnpm --filter @paperclipai/ui typecheck` — passed.
- `pnpm check:token-gates`, `node scripts/check-maps.mjs`, `node
scripts/storybook-catalog.mjs --check`, and `git diff --check` — passed.
The feature map is unchanged on the current head, per
`rules/feature-map-scope.mdc`.
- Storybook states: `product-kanban-projects--project-enabled`,
`product-kanban-projects--compact-cards`, and
`product-kanban-projects--project-disabled`. These use fixtures and do
not prove live API access or navigation.
- Earlier revisions recorded a red-before-fix run: the component suites
failed on missing project badges and missing board props before the
implementation.
- Full GitHub CI passed on head `ed05687`.

## Risks

- Low risk. The change adds an optional badge row to each board card.
- Long names truncate. The badge uses the existing neutral badge tokens.
Missing project metadata produces no badge.
- The API, stored preferences, task mutations, and drag target logic
stay the same.

## Model Used

- Original change: OpenAI Codex, GPT-based agent, with repository
search, code editing, and code execution. The runtime did not expose the
exact model ID.
- Rebase onto current `master`, scope cleanup, and the legacy-collection
follow-up: Anthropic Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code,
with tool use and code execution.

## Merge Attribution

If squash-merging, retain these trailers in the squash commit body:

```text
Co-Authored-By: Codex <codex@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
```

## 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 (head ed05687)
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
(reviewed ed05687)
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Codex <codex@users.noreply.github.com>
Co-authored-by: a-vasyliev <1255946+a-vasyliev@users.noreply.github.com>
2026-12-04 23:58:50 -08:00
9f4562f076 fix(claude-local): list Claude Haiku 5.5 in the model catalog (#16708)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The `claude_local` adapter owns the Claude Code model list that `GET
/api/companies/{companyId}/adapters/claude_local/models` returns.
> - That list includes Claude Opus 5.5 and Claude Sonnet 5.5, but the
newest Haiku entry is still Claude Haiku 4.5.
> - Claude Code 2.1.293 added `claude-haiku-5-5`. Operators on a current
CLI cannot select it in the agent model picker.
> - This pull request adds Claude Haiku 5.5 to the direct catalog and to
the Bedrock catalog, in the same family order as the other 5.5 models.
> - Haiku 5.5 needs Claude Code 2.1.293 or later. Haiku models still do
not take a reasoning effort.
> - The benefit is that the model picker can offer Claude Haiku 5.5
without a catalog redesign.

## Linked Issues or Issue Description

Fixes #16637

Refs #16660. That open pull request also inserts this model ID, but it
replaces the hardcoded catalog with an operator-editable catalog. This
pull request only adds the missing model to the catalog that ships
today.

Refs #14038. Haiku models still return no reasoning-effort choices. This
change does not alter that behavior.

## What Changed

- Added `claude-haiku-5-5` ("Claude Haiku 5.5") to the `claude_local`
model list, after Sonnet 5.5. Moved `claude-haiku-4-5` into the older
Haiku group.
- Added the dateless Bedrock ID `us.anthropic.claude-haiku-5-5`
("Bedrock Haiku 5.5"). The Anthropic Bedrock model ID is
`anthropic.claude-haiku-5-5`.
- Required Claude Code 2.1.293 or later before a CLI run or environment
test uses Haiku 5.5. Documented that minimum in the adapter
configuration notes.
- Left reasoning effort empty for Haiku 5.5, matching Haiku 4.5.

## Verification

- `pnpm exec vitest run --config vitest.config.ts src/index.test.ts
src/server/model-order.test.ts src/server/execute.remote.test.ts
src/server/test.remote.test.ts src/server/test.probe.test.ts` in
`packages/adapters/claude-local` (72 passed).
- `pnpm exec vitest run --config vitest.config.ts
src/__tests__/adapter-models.test.ts` in `server` (28 passed).
- `pnpm exec vitest run --config vitest.config.ts
src/lib/agent-setup-fields.test.ts
src/components/task-chat/composer-run-settings.test.ts` in `ui` (6
passed).
- With no Anthropic API key, the `claude_local` model list includes `{
id: "claude-haiku-5-5", label: "Claude Haiku 5.5" }` ahead of
`claude-haiku-4-5`.
- In Bedrock mode, the list includes `us.anthropic.claude-haiku-5-5` and
does not include the direct ID `claude-haiku-5-5`.

## Risks

Low risk. The new ID is additive. Existing Haiku 4.5 agents keep that
model. A CLI older than 2.1.293 fails the existing version check before
launch when Haiku 5.5 is selected. `ROADMAP.md` does not plan this
catalog entry.

## Model Used

Grok 4.7 from SpaceXAI. Tool use for repository search, tests, and the
pull request.

## 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: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com>
2026-12-04 23:50:33 -08:00
Dotta 266eccc524 fix(connections): improve custom remote MCP OAuth draft setup, auto-detection, and recovery UX (#23846)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - People connect external tools to agents through custom remote MCP
servers in `/apps/byo` and manage them on `/apps/:id/permissions`
> - Unauthenticated custom MCP OAuth drafts failed catalog reads with
`oauth_refresh_missing`, displayed as `Paused`, and left operators on a
dead-end `Retry` error screen with no sign-in, auth-method switch, or
remove controls
> - The `/apps/byo` setup flow also lacked upfront read-only auth
detection, display-name editing, custom draft resume, and detached-tab
OAuth completion polling
> - Custom remote MCP servers must work smoothly out of the box without
dead ends or manual trial-and-error
> - This pull request fixes backend OAuth draft/catalog truthfulness,
adds a read-only custom MCP auto-detection probe, adds dedicated draft
setup and error recovery on `AppDetail`, and improves `/apps/byo`
auto-detection, resume, and OAuth waiting UX
> - The benefit is that operators can connect and recover any
standards-compliant remote MCP server cleanly without hitting false
expired-credential dead ends

## Linked Issues or Issue Description

**What happened?**
Opening an unauthenticated custom remote MCP OAuth draft at
`/apps/:id/permissions` triggered a live remote catalog refresh that
threw `422 oauth_refresh_missing` (`"OAuth credentials have expired and
need to be reconnected."`), overwrote stored health to `failed`,
displayed status `Paused`, and replaced the Permissions tab with a
looping `Retry` box. Operators had no way to start sign-in, change the
sign-in method, see OAuth callback failure details, or remove the
connection. In `/apps/byo`, pasting a URL did not detect auth upfront,
did not allow editing the display name, failed to resume custom MCP
drafts via `?resume=<id>`, duplicated the `Unverified server` badge, and
stopped polling when opening sign-in in a new tab.

**Expected behavior**
Unauthenticated OAuth drafts should remain readable without failing
catalog reads or reporting expired credentials, show `Setup incomplete`
with clear `Sign in`, `Change sign-in method`, `Remove`, and `Connection
details` controls, surface OAuth callback errors inline, and keep
recovery actions visible when catalog loading fails. `/apps/byo` should
detect auth upfront in a read-only probe, allow naming the connection,
resume custom MCP drafts cleanly, and detect OAuth completion even when
sign-in opens in a new tab.

**Steps to reproduce**
1. Create a custom remote MCP OAuth draft via `/apps/byo` or `POST
/api/companies/:companyId/tools/apps/connect` without completing browser
OAuth consent.
2. Open `/<prefix>/apps/<connectionId>/permissions`.
3. Observe `Paused` and `"Couldn't load tools for this app / OAuth
credentials have expired and need to be reconnected. [Retry]"` with no
sign-in or recovery controls.

**Paperclip version or commit**
`master` (`fd8ad7d5b8`)

**Deployment mode**
Local dev (pnpm dev)

## What Changed

- **Backend OAuth draft & catalog truthfulness**
- Export `isConnectionAwaitingFirstSignIn` in
`server/src/services/tool-access/connections/first-sign-in.ts` and skip
remote `refreshCatalog()` in
`server/src/services/tool-access/catalog/reader.ts` when an
unauthenticated OAuth draft has an empty catalog.
- Distinguish never-authorized OAuth connections/grants (`422
oauth_challenge`: `"This app needs you to sign in."`) from genuinely
expired tokens missing a refresh token (`422 oauth_refresh_missing`) in
`server/src/services/tool-access/oauth/grant-refresh.ts` and
`server/src/services/tool-access/oauth/connection-refresh.ts`.
- Annotate `firstSignInPending` on `getConnection` in
`server/src/services/tool-access.ts` to match `listConnections`.
- **Read-only custom MCP auto-detection probe**
- Add `probeGenericMcpSchema` and `GenericMcpProbeResult` in
`packages/shared`, capture optional `resource_name` in
`server/src/services/tool-access/oauth/discovery.ts`, implement
read-only `createGenericMcpProbe` in
`server/src/services/tool-access/connections/probe-mcp.ts`, expose `POST
/api/companies/:companyId/tools/apps/probe-mcp` in
`server/src/routes/tool-access.ts`, and add `toolsApi.probeGenericMcp`
in `ui/src/api/tools.ts`.
- Refresh `tests/runner-e2e/source-sdk-public-inputs.json` for the
shared schema and type additions.
- **App detail setup, recovery, and management UI**
- Show `Setup incomplete` for draft connections in
`ui/src/pages/apps/AppDetail.tsx` and
`ui/src/pages/apps/Connections.tsx`.
- Add `FinishSetupCard` in `AppDetail.tsx` with `Sign in` (shared,
personal, and agent policies), `Change sign-in method`, inline OAuth
return error recovery (`?oauth=failed|denied`), live completion polling,
`Remove`, and `Connection details`.
- Scope catalog fetch errors to the Actions area so `IdentitiesSection`,
`ReconnectCard`, and custom MCP management (`AdvancedPanel`) stay
accessible.
- **BYO setup, resume, and OAuth waiting UX**
- Run background read-only probing on `/apps/byo` Step 2 in
`ConnectionSetupFlow.tsx` and `GenericMcpConnectStep.tsx`, add an
editable Display name input, use `Server URL · Connect` for the BYO
stepper, and support resuming/reconnecting custom MCP drafts via
`?resume=<id>&editAuth=1`.
- Remove the duplicate `Unverified server` badge and stuck disabled
`Opening …` button on `OAuthConnectStateScreen`, use non-workspace copy
for custom MCP servers, and keep polling connection activation after
clicking `Open sign-in in a new tab`.

## Verification

- Ran server and UI regression tests (183/183 passing):
- `pnpm vitest run server/src/__tests__/generic-mcp-connection.test.ts
server/src/__tests__/tool-access-cancelled-first-sign-in.integration.test.ts
ui/src/pages/apps/AppDetail.test.tsx
ui/src/features/connections/ConnectionSetupFlow.generic-mcp.test.tsx
ui/src/features/connections/GenericMcpConnectStep.machine.test.tsx
ui/src/pages/apps/generic-mcp-connect.test.ts`
- Ran package typechecks and UI checks:
  - `pnpm --filter @paperclipai/shared typecheck`
  - `pnpm --filter @paperclipai/server typecheck`
  - `pnpm --filter @paperclipai/ui typecheck`
  - `node scripts/check-query-error-rendering.mjs` (0 findings)
  - `pnpm run check:token-gates` (0 violations in changed files)
- Verified end-to-end locally in an isolated worktree dev server against
live remote OAuth MCP endpoints for draft setup, `Change sign-in method`
resume, upfront read-only auto-detection, and OAuth waiting screen.

## Risks

- Low risk: existing active and expired OAuth connections keep
`oauth_refresh_missing` behavior unchanged (covered by explicit
regression tests).
- The new `/probe-mcp` route uses the same company/management
authorization guards, SSRF/private-network checks, self-loop protection,
and OAuth endpoint policy as `/apps/connect`, performs zero database
writes, and makes zero DCR `POST` requests.
- `packages/shared` exports changed, so
`tests/runner-e2e/source-sdk-public-inputs.json` was regenerated for CI.

## Model Used

- Google Antigravity (`gemini-3-pro`, extended thinking, tool use and
code execution)

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] 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
2026-12-05 00:41:30 -06:00
Steven Nance c8ca682bf2 fix(ui): remount the composer takeover card per pending input (#15121)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Agents ask people for decisions through cards in the task chat
> - The composer shows one pending card at a time in a takeover slot
> - The checkbox card and the suggested-tasks card keep the selection,
the reason and the page in local React state
> - The takeover slot renders each pending card in the same position
without a React `key`, so React reuses one card instance for the next
pending card
> - The next card then starts with the state of the card before it
> - This pull request adds a `key` for each pending input, so each card
mounts with its own state
> - The benefit is that each card shows and sends only its own options

## Linked Issues or Issue Description

No public issue exists for this bug. The description follows the bug
report template.

**What happened?**

A task had two pending cards of the same kind. I answered the first
card. The takeover slot then showed the second card, but the second card
kept the selection state of the first card. The default ticks of the
second card did not show. The card also wrote the selection of the first
card into the saved draft of the second card. When I confirmed the
second checkbox card, it sent option ids that belong to the first card.
The server refused the request with `Unknown checkbox confirmation
optionId`.

**Expected behavior**

Each pending card starts with its own default selection. Each card sends
only its own option ids. Each card saves only its own draft.

**Steps to reproduce**

1. Create two pending `request_checkbox_confirmation` interactions on
one task. Give them different option ids and different
`defaultSelectedOptionIds`.
2. Open the task. The composer takeover shows one of the cards.
3. Change the ticks on that card, then confirm it.
4. Look at the next card in the takeover slot. Its default ticks do not
show.
5. Confirm the next card. The request fails with `Unknown checkbox
confirmation optionId`.

The same fault occurs with two pending `suggest_tasks` cards.

**Paperclip version or commit**

`master` at `1c07b5903b1b11139b1e1ce052a3cd4885865d90`.

**Deployment mode**

Self-hosted server. The bug is in the UI and does not depend on the
deployment mode.

Related work: a search of issues and pull requests found no report and
no fix for this bug. #14613 and #9290 change the same cards, but they do
not change how the takeover slot mounts a card.

## What Changed

- `ui/src/components/TaskChatThread.tsx`: the takeover
`TaskChatProtocolCard` and `TaskChatInteractionCard` now have
`key={selectedPendingInput.key}`. React mounts a new card when the
pending input changes.
- `ui/src/components/TaskChatThread.test.tsx`: two new tests. One test
covers two pending checkbox cards. One test covers two pending
suggested-tasks cards. Each test answers the first card and then checks
the ticks, the submitted ids and the saved draft of the second card.
- The branch has two commits. The first commit adds only the tests. The
second commit adds the fix.

## Verification

Run these commands from the repository root:

- `pnpm exec vitest run --project @paperclipai/ui
ui/src/components/TaskChatThread.test.tsx`
- On the tests-only commit: 2 failed, 195 passed. The two failures are
the new tests.
  - On the head commit: 197 passed.
- `pnpm exec vitest run --project @paperclipai/ui`: 679 test files
passed, 7316 tests passed.
- `pnpm --filter @paperclipai/ui typecheck`: no errors.
- `pnpm check:token-gates`: all gates clean.
- `pnpm check:tokens`: no forbidden tokens.

Manual check: on a self-hosted build that has the same two-line change,
two pending checkbox cards on one task were accepted one after the
other. Each request sent the option ids of its own card. This build was
not the head commit of this branch.

I did not run `pnpm -r typecheck`, the full `pnpm test:run`, `pnpm
build` or the browser suites. The change touches only the two UI files
above.

## Risks

Low risk. A card in the takeover slot now mounts again when the selected
pending input changes. Unsaved local state of the card that leaves the
slot is not kept in memory. Selections and reasons stay in the saved
draft for each card, as before. The card does not mount again while the
same pending input stays selected, because the key is stable for one
pending input.

## Model Used

Claude Opus 5.5 (`claude-opus-5-5`) from Anthropic, run as a coding
agent with tool use (shell, file edit, test runs). The context window
size of the run was not recorded. A person reviews the change before the
pull request opens.

## 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 (not
applicable: no documentation describes this behavior)
- [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
2026-12-04 21:09:46 -08:00
Can H. Tartanoglu 6c6e978725 fix(build): preserve UI errors before service worker output exists (#14444)
## Thinking Path

> - Paperclip serves a web UI with a service worker.
> - The UI build stamps the worker with the entry bundle ID.
> - Vite also calls `closeBundle` after a failed build.
> - A failed build can leave the worker file absent.
> - Reading that file replaces the useful build error with an `ENOENT`
error.
> - This change stamps the worker in `writeBundle`, after the output
exists.

## Linked Issues or Issue Description

**What happened?**

An unresolved UI import reports a missing `dist/sw.js` file instead of
the missing module. The stamping plugin reads the worker from
`closeBundle`, including after a failed bundle.

**Expected behavior**

The build should report the original module error. A successful build
should still stamp the copied worker with its entry bundle ID.

**Steps to reproduce**

1. Create a minimal Vite project with an HTML entry and `public/sw.js`
containing the build-ID placeholder.
2. Enable `serviceWorkerBuildIdPlugin()`.
3. Make the entry import `./missing.js`.
4. Run the build. The current plugin reports `ENOENT` for `dist/sw.js`.

**Paperclip version or commit**

Reproduced on `3447609d2247e75e55d91493dda91a608364f672`.

**Deployment mode**

Other: production UI build.

**Installation method**

Built from source.

**Database mode**

Not database-related.

**Operating system**

NixOS, x86_64 Linux. Node 24.19.0.

**Additional context**

Searches of open and closed issues and PRs for `closeBundle` and
`writeBundle` found no matching contribution.

## What Changed

- Move file stamping to `writeBundle`.
- Add real Vite build tests for a failed import and a successful stamped
output.
- Compare the complete stamped worker content against the entry-derived
build ID.

## Verification

### Current exact-source hosted qualification — 2026-10-09

Published head: `d0b95c377e43a06a2b5ba740dd6df9cb23fd3335`. The
externally published reconciliation preserves the prior proposal and
exactly matches its recorded tree merged with target
`9b624a110e281badc54cbdf37ddb792cdc1690ff`; no proposal behavior was
changed. Required **`ci / verify` and `ci / e2e` succeed** in [run
37864533960/1](https://github.com/paperclipai/paperclip/actions/runs/37864533960).
Actual checkout logs bind this exact candidate to this exact current
target. All original regression repairs and historical findings remain
retained.

GitHub verifies the reconciliation signature. Local signature
verification cannot check it because the signer public key is absent; no
key, signing setting or commit identity was changed. Local worktrees
were fast-forwarded to the existing public heads without creating or
rewriting commits.

Successful complete native Codex code review and applicable maintainer
approvals remain outstanding; [the source-bound review
request](https://github.com/paperclipai/paperclip/pull/14444#issuecomment-6072822720)
is not acceptance. After qualification, mark the draft ready and use the
protected exact-head merge. The authenticated operator currently has
READ-only upstream access.


<!-- preserving-source-refresh-20261009:start -->
### Preserving upstream refresh — 2026-10-09

Published signed head: `d0b95c377e43a06a2b5ba740dd6df9cb23fd3335`.

This head contains observed upstream
`9b624a110e281badc54cbdf37ddb792cdc1690ff`, previous published head
`eda06f1c0a8eaf0a8c9c3a352ba02dea88bb0b95`, and preserved prepared head
`cde0ef5321f48d75593738afd3310d901986a16e`. The publication used one
atomic, non-force push. Remote branch and PR readback match the signed
head. The lockfile and database migrations have no delta from this
upstream.

Exact-head hosted CI:
https://github.com/paperclipai/paperclip/actions/runs/37864533960.
Qualification is pending. Earlier results remain historical evidence and
do not qualify this refreshed head. Acceptance requires mandatory
attempt-1 GREEN results, zero mandatory failures, errors, skips or
retries, SHA-256-bound receipts, and provider retention of at least
2592000 seconds.

Refresh assistance: OpenAI `openai/gpt-6.1-sol`, with repository
inspection, Git tooling and evidence verification. The harness does not
expose a context-window size.
<!-- preserving-source-refresh-20261009:end -->

### Published reconciliation — 2026-10-08

Published candidate `eda06f1c0a8eaf0a8c9c3a352ba02dea88bb0b95` includes
the target `71cd0a2621615182274a977d6cc969b9ab920b92`. Frozen dependency
installation and all **9** stamping unit/integration tests passed on
that exact candidate, with zero skipped. Changing only `writeBundle`
back to `closeBundle` reproduced the masked missing-import diagnostic.
Restoring the candidate passed the full focused file again.

```sh
corepack pnpm --filter @paperclipai/ui exec vitest run src/lib/vite-sw-build-id.test.ts src/lib/vite-sw-build-id.integration.test.ts
```

The source comparison merges without conflict against the live `master`
observed at `9f4acc8f14f5baf77b54b040d156a1b094d8d366`. The exact
candidate was normal-pushed to this PR branch. The focused results are
not full qualification of the newer target/composite tree. New hosted CI
and full native code review are pending. Queued, running, skipped or
failed checks do not establish a pass. Applicable maintainer approvals
and protected merge gates remain required.

### Historical qualification — not acceptance of the new comparison

- Before the fix, the failed-import regression reports the unrelated
worker `ENOENT`; the successful-build case passes.
- After the fix, all nine stamping unit/integration tests pass.
- At `375f1cbd9`, all 6,756 UI tests passed across 639 files: `pnpm exec
vitest run --project @paperclipai/ui --exclude '**/dist/**'`.
- `pnpm --filter @paperclipai/ui typecheck` passes.
- `pnpm --filter @paperclipai/ui build` passes, with existing chunk-size
and mixed static/dynamic import warnings.
- `git diff --check` passes.
- `pnpm check:token-gates` passes on the exact published head.
- The assertion-only follow-up
`415c30fe034f7e99b25f12a940776766e9325966` passed all nine focused
stamping tests and UI typecheck. Greptile reviewed that head at 5/5 with
no remaining findings. Full-monorepo qualification and CI remain
pending. This is a draft.
- Added code comment removed per CONTRIBUTING.md; `pnpm exec vitest run
ui/src/lib/vite-sw-build-id` (11 passed) and `pnpm --filter
@paperclipai/ui typecheck` pass on this head and on upstream `820c458`.
- `ci / General tests (server (8/12))` failed once in
`server/src/__tests__/decision-expiry-work.test.ts` (expected timestamps
off by exactly 90000 ms). This PR does not touch server code, and that
file passes locally (20 tests). Treated as unrelated timing flake:
https://github.com/paperclipai/paperclip/actions/runs/40728729442

## Risks

The hook timing changes. Real build tests verify that the copied worker
exists at `writeBundle` and receives the emitted entry ID. Missing or
invalid worker content during a successful build still fails stamping.

## Model Used

OpenAI GPT-6 Astra, exact model ID `gpt-6-astra`, through OpenCode.
Assistance included code, real-build regression tests, and command
execution. The harness did not expose a verified 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
- [ ] 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
2026-12-04 20:49:00 -08:00
DottaandPaperclip 042cb67370 fix(ui): keep Composio connect navigation from closing back to /apps (#23845)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The Plugins page lets users connect third-party apps directly or
through aggregators like Composio and Arcade.
> - When an app offers multiple aggregators, clicking Connect opens
AggregatorConnectDialog so the user can choose a provider.
> - Selecting Composio with no saved Composio gateway, or clicking
Connect new account, called onNavigate and then immediately called
onClose.
> - In Browse, closeAggregatorSetup checked window.location.search for
source=composio, matched the URL that onNavigate had just pushed, and
replaced the route with /apps.
> - This pull request stops in-app dialog navigation from calling
onClose, clears dialog state in Browse's navigation handler, and reads
React Router's location.search instead of window.location.search.
> - The benefit is that choosing Composio or adding a new Composio
account from the connect modal navigates cleanly to /apps/connect while
dismissing the modal still strips ?source=composio.

## Linked Issues or Issue Description

No public GitHub issue exists for this report (searched open and closed
issues and PRs for duplicates).

**What happened?**

When going to Plugins -> Slack -> Connect and clicking Composio without
a saved Composio gateway, the connect modal closed and redirected back
to /apps instead of opening
/apps/connect?source=composio&targetToolkit=slack. The same redirect
happened when opening the modal via
/apps?source=composio&targetToolkit=slack and clicking Connect new
account.

**Expected behavior**

Clicking Composio with no saved Composio gateway navigates to
/apps/connect?source=composio&targetToolkit=slack. Clicking Connect new
account navigates to
/apps/connect?source=composio&targetToolkit=slack&new=1. Dismissing the
modal without navigating still closes it and strips ?source=composio
back to /apps.

**Steps to reproduce**

1. Open Plugins on a Cloud instance where Slack yields to aggregators
and no Composio gateway is saved.
2. Open Slack and click Connect.
3. Click Composio in the Connect Slack dialog.
4. Observe that the dialog closes and the page stays on /apps instead of
navigating to /apps/connect?source=composio&targetToolkit=slack.

**Access context**

Board (human operator)

## What Changed

- Updated `ui/src/pages/apps/AggregatorConnectDialog.tsx` so in-app
navigation handlers (`choose`, `onConnectNew`, and the non-Composio
"Connect a new account" button) call only `onNavigate` without also
invoking `onClose`.
- Updated `ui/src/pages/apps/Browse.tsx` to pass
`navigateFromAggregatorSetup` as `AggregatorConnectDialog`'s
`onNavigate` prop so navigation clears dialog state without triggering
`closeAggregatorSetup`'s `?source=composio` redirect cleanup.
- Switched `Browse.tsx` from `window.location.search` to React Router's
`useLocation().search` for the `?source=...` effect and dismissal
cleanup.
- Added `ui/src/pages/apps/Browse.aggregatorConnect.test.tsx` with real
`BrowserRouter` regression tests covering Plugins -> Slack -> Connect ->
Composio, new-account navigation from `?source=composio`, dismissal
cleanup, and staying on the plugin page when cancelling.

## Verification

- Verified TDD red-before / green-after on
`ui/src/pages/apps/Browse.aggregatorConnect.test.tsx`: before the fix,
both Composio navigation tests failed with `Received: "/PAP/apps"`
instead of `/PAP/apps/connect?source=composio&targetToolkit=slack` and
`...&new=1`.
- Ran `pnpm vitest run
ui/src/pages/apps/Browse.aggregatorConnect.test.tsx
ui/src/pages/apps/Browse.pluginTileState.test.ts
ui/src/pages/apps/AppsConnect.test.tsx
ui/src/lib/analytics/replay-masking.test.tsx` on rebased HEAD
`c605d6358c`: 4 test files, 243 tests passed.
- Ran `pnpm --filter @paperclipai/ui typecheck`: passed with 0 errors.
- CI covers repo-wide typecheck, build, and test suites on the pushed PR
revision.

## Risks

- Low risk. Changes are scoped to `AggregatorConnectDialog` and
`Browse`'s aggregator connect dialog wiring. Dismissal actions (Cancel,
Escape, dialog close, completion, and external management links) still
invoke `closeAggregatorSetup` to invalidate aggregator queries and strip
`?source=composio`.

## Model Used

- Google Gemini 4 (Antigravity agent with extended reasoning and local
tool/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
- [ ] 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>
2026-12-04 20:56:22 -06:00
Dotta fd8ad7d5b8 fix(ui): remove environment selector from AI connection setup (#23836)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Users connect AI provider accounts (Claude, OpenAI, Antigravity,
xAI, and GitHub Copilot) through `AiConnectionCredentialStep`
> - AI connections store credentials in Paperclip's secret store and do
not bind the saved connection to an execution environment
> - When a company had more than one active login-capable environment,
the setup form showed a raw environment dropdown (exposing internal
sandbox names and appearing even for API key or hosted OAuth flows)
> - The component already resolves the default login or probe
environment automatically
> - This pull request removes the environment selector dropdowns from
`AiConnectionCredentialStep` while preserving automatic environment
resolution
> - The benefit is a simpler AI connection flow that does not leak
internal execution infrastructure into provider account setup

## Linked Issues or Issue Description

**What existing behavior does this improve?**

The AI provider connection setup screen (`AiConnectionCredentialStep`)
for Anthropic (Claude), OpenAI, Google (Antigravity), xAI (Grok), and
GitHub Copilot.

**Subsystem affected**

`ui/` — React + Vite board UI

**Current behavior**

When a company has more than one active login-capable environment,
`SubscriptionConnectionStep` renders a `Sign-in environment` dropdown
and `ApiKeyConnectionStep` renders a `Copilot execution environment`
dropdown. The dropdown appears even for hosted Google OAuth or when the
user switches to an API key, and it exposes internal sandbox labels such
as `Paperclip Sandbox (Legacy)`.

**Proposed behavior**

Remove both environment dropdowns from `AiConnectionCredentialStep` and
update the GitHub Copilot help text to say verification discovers models
automatically. Continue resolving `environmentId` automatically from the
forced Kubernetes environment, instance default, plugin login target
preferences, or local default environment.

**Reason and benefit**

Saved AI connections are not bound to an execution environment; the
environment is only an internal detail for running a temporary
subscription login PTY or Copilot model probe. Removing the dropdown
eliminates user confusion and keeps internal infrastructure out of the
Apps connect flow.

**Breaking changes**

Users can no longer manually override the temporary login/probe
environment from the standalone AI connection setup form; Paperclip uses
the automatically resolved default environment instead. Agent-scoped
flows that pass `environmentId` explicitly continue to use the supplied
environment.

## What Changed

- Removed the `Sign-in environment` `<Select>` and unused
`chosenEnvironment` state from `SubscriptionConnectionStep` in
`ui/src/components/ai-connections/AiConnectionCredentialStep.tsx`.
- Removed the `Copilot execution environment` `<Select>` and unused
`chosenEnvironment` state from `ApiKeyConnectionStep` in
`ui/src/components/ai-connections/AiConnectionCredentialStep.tsx`, and
updated the Copilot help text to match.
- Added
`ui/src/components/ai-connections/AiConnectionCredentialStep.test.tsx`
to verify that no environment selector renders for Anthropic, OpenAI,
Google, xAI, or GitHub Copilot when multiple environments exist, while
automatic `environmentId` resolution is preserved.

## Verification

- `pnpm --filter @paperclipai/ui exec vitest run
src/components/ai-connections/AiConnectionCredentialStep.test.tsx` — 5/5
tests passed.
- `pnpm --filter @paperclipai/ui typecheck` — passed.
- `pnpm verify` — 270/271 UI test files passed in the combined run (1
unrelated `requestAnimationFrame` timing failure in
`src/components/TaskChatThread.test.tsx`); re-running `pnpm --filter
@paperclipai/ui exec vitest run src/components/TaskChatThread.test.tsx
src/components/ai-connections/AiConnectionCredentialStep.test.tsx`
passed all 444 tests (1 skipped).

## Risks

- Low risk. Self-hosted instances with multiple login-capable
environments now always use the automatically resolved default
environment during standalone AI account sign-in rather than exposing a
per-login override dropdown.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

- Google Gemini (Antigravity agent, medium reasoning effort, with
repository read/edit, terminal, and browser inspection 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
2026-12-04 20:46:43 -06:00
Devin FoleyandPaperclip 1f817b495c fix(ui): hide monitor waiting notices during active runs (#23822)
## Thinking Path

> - Paperclip manages work performed by AI agents.
> - Task monitors schedule later checks.
> - A saved schedule can remain present during a new run.
> - The UI calls that state a wait even while the agent works.
> - This change gives the current run priority over monitor notices.
> - Users see the monitor again after the run ends.

## Linked Issues or Issue Description

Refs #19519, which added the active-run wait message. This change
removes that message during execution. Searches found no open duplicate,
and the roadmap has no overlapping item. The small SSH fixture repair
below addresses a CI regression introduced on master by #14309.

**What happened?**

A task showed a running agent and a monitor waiting notice at the same
time. The notice said the agent was waiting or saving work, based only
on the presence of a run.

**Expected behavior**

Show the current run without monitor waiting notices. Keep the saved
schedule. Restore both monitor surfaces after execution ends, if the
monitor remains scheduled.

**Steps to reproduce**

1. Schedule a task monitor.
2. Start a run on the same task before its next check.
3. Inspect the task banner and composer while the run works.
4. End the run and confirm the retained monitor appears again.

**Paperclip version or commit**

Reproduced against master at dfe392dada
with mounted production components.

**Deployment mode**

Source checkout on macOS arm64 with Node v25.6.1. Browser checks use
disposable local servers. No deployment is part of this PR.

## What Changed

- Hide the banner and composer monitor notice while a task run is queued
or running. Use the existing live-run state; add no request.
- Restore countdowns, PR review links, and check controls after
execution ends. Keep workspace and usage retry waits visible.
- Add mounted regressions for future, due-now, overdue, review, and
retry states. Update the product and monitor documentation.
- Pass the stdin command envelope to the new dash SSH test from master.
This one-line repair changes only its test input.
- Make the connection-review race fixture drop exactly one initial
interaction snapshot, through either bootstrap or the standalone
endpoint. Preserve all other bootstrap data and keep dropping the live
creation event. Keep the approval assertions, timeouts, and retry
settings unchanged.

## Verification

Current head: `cfdbbb22839`.

- Red-green: four new monitor regression cases failed against the
original implementation, then passed with the fix.
- From ui/: `pnpm exec vitest run
src/components/IssueMonitorBanner.test.tsx
src/lib/issue-monitor.test.tsx
src/pages/IssueDetail.agentChatPanel.test.tsx
src/pages/IssueDetail.mobile.test.tsx` passes: 44 tests in four files,
including after the master merge.
- UI and adapter-utils typechecks pass. `git diff --check` passes.
- The new monitor transition test initially crossed a real countdown
boundary. Its clock is now fixed. The fresh worktree initially lacked
plugin SDK declarations; building them restored the UI typecheck.
- The focused dash regression reproduced CI exit 125 without stdin.
Passing `target.stdinPrefix` makes it pass. No SSH runtime code changed.
- Both stale chat-settings grant/revocation cases pass locally with two
Chromium workers. The original [e2e shard 13
failure](https://github.com/paperclipai/paperclip/actions/runs/47463601089/job/145495043379)
remains unexplained; the same shard passed in the next CI run without a
settings change.
- The connection-review decline journey passes in Chromium with trace
capture: `PAPERCLIP_E2E_PORT=43984 PAPERCLIP_E2E_SKIP_UI_BUILD=1 pnpm
exec playwright test --config tests/e2e/playwright.config.ts
tests/e2e/connection-reviews.spec.ts --grep 'connection review: decline'
--workers=1 --trace=on --reporter=line --output=<scratch>`. E2E
test-project typecheck also passes.
- Before that fixture repair, the local trace shows bootstrap at
02:08:50, an empty first recovery poll at 02:09:11, and the review
arriving on the second poll at 02:09:31. The corrected trace shows
bootstrap at 02:10:29 and the review on the first poll at 02:10:50. The
original fixture was consuming a recovery read rather than the initial
snapshot. The complete decline and continuation assertions pass with the
correction.
- The [first CI
run](https://github.com/paperclipai/paperclip/actions/runs/47463601089)
failed in the SSH fixture and the chat-settings case. The [second run on
e9fced7](https://github.com/paperclipai/paperclip/actions/runs/47464395894)
passed all general tests, build, typecheck, Runner checks, and 15
browser shards. Its [connection-review
failure](https://github.com/paperclipai/paperclip/actions/runs/47464395894/job/145499941920)
is addressed by the fixture correction above. These original failures
remain part of the evidence; later passes do not erase them.
- Greptile scored the current head
cfdbbb2283 at 5/5 with no actionable
findings or open threads. Required CI passes on this head.
- The token scan reports three existing violations: two task-number
strings in transcript-adapter.test.ts and one grid class in
AdapterLoginChrome.tsx. Those files and the scanner match the base
branch. This PR adds no visual values.
- Broad local selection was inspected with `pnpm verify --explain`; that
command did not execute the selected suite. Final CI supplies the
broader coverage. Added lines and PR text were scanned for secrets,
private endpoints, personal data, and run artifacts before push.

Final qualification for cfdbbb2283:

- [Final CI
run](https://github.com/paperclipai/paperclip/actions/runs/47466120239):
80 successful checks and four skipped checks, with no failures or
pending checks. Both required aggregates, ci / verify and ci / e2e,
pass. All 16 browser shards pass, including the repaired
connection-review journey.
- Greptile's completed check and 5/5 summary both name this exact head.
No review comments or unresolved threads remain.
- GitHub reports MERGEABLE and CLEAN against master. The worktree is
clean. This PR is ready to merge; it has not been merged or deployed.

## Risks

Low risk. Delayed live-run query updates can briefly delay notice
transitions. PR review links inside these notices are hidden during
execution and return afterward. The two CI repairs affect test fixtures
only. Schedules, execution admission, ownership, authorization, approval
behavior, and schema stay unchanged. Required CI passes on this head.

## Model Used

OpenAI Codex, gpt-6.1-sol, with xhigh reasoning effort, repository
inspection, code editing, shell tools, and test execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-04 18:35:01 -08:00
6a5dfc0288 feat(recents): store sidebar Recents on the server so every client shares one list (#23706)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The sidebar Recents list shows the tasks from a person's own recent
activity
> - Each browser kept Recents in `localStorage`. A laptop, a phone, and
a second browser each showed a different list
> - People expect one list for their account, the same on every client
> - This pull request moves Recents to the server. The server keeps one
list for each person in each company. The UI shows that list and gets
live updates when another client changes it
> - The benefit is that every client shows the same Recents in the same
order, and a change on one client shows on the others at once

## Linked Issues or Issue Description

**Is your feature request related to a problem? Please describe.**
Recents is kept in the browser. When I open a task on my laptop, the
task does not show in Recents on my phone or in another browser.

**Describe the solution you'd like**
Keep Recents on the server, so that every client that I sign in to shows
the same list.

**Additional context**
Eligibility (which rows show) does not change. The navigation summaries
still decide it (see #23675).

## What Changed

- `packages/db`: new `user_recent_tasks` table (company, user, issue,
`recorded_at`), unique on company + user + issue. Migration `0515`
creates only a new table, so it is `online_compatible`.
- `packages/shared`: `RecentTaskRecord`, `RecentTaskList`,
`RECENT_TASKS_MAX_ENTRIES` (200), and the `recordRecentTaskSchema` and
`importRecentTasksSchema` validators.
- `server`: new `recentTaskService` and routes:
- `GET /api/companies/:companyId/recent-tasks/me`: the list, newest
first.
- `POST /api/companies/:companyId/recent-tasks/me` `{ issueId, touch }`:
`touch: true` moves the task to the top (server time). `touch: false`
adds a missing task below the history and does not move an existing
task.
- `POST /api/companies/:companyId/recent-tasks/me/import`: imports the
list that a browser kept. The later time wins.
  - `DELETE /api/companies/:companyId/recent-tasks/me/:issueId`.
- The server keeps the newest 200 rows for each person. Each change is
in the activity log as `recent_tasks.*` with `entityType: "company"` and
`details.userId`. The entry does not name the task. Viewers can change
their own Recents, like workspace preferences.
- Record, import, and list use the normal task read decision. A private
or unreadable task gets the same 404 as a missing task. The import skips
it, and the list does not return it.
- `server/src/realtime/live-events-ws.ts`: sends `recent_tasks.*` events
only to the owner's connections, without details.
  - OpenAPI entries for the four routes.
- `ui/src/lib/recent-tasks.ts`: the module is now a client mirror of the
server list, not `localStorage`. Optimistic records and removals stay
applied until a server list that was requested after the server saved
them arrives. This prevents a stale list from hiding a new visit.
- `ui/src/hooks/useRecentTasks.ts`: fetches the server list
(`queryKeys.recentTasks`). On the first load it imports the old browser
list one time and then deletes the browser copy. It does not delete
ineligible rows anymore. It hides them, and it requests a new summary
batch when new activity occurs on a hidden task. The `awaitingRead` flow
is removed because nothing deletes the row while the read is in flight.
- `LiveUpdatesProvider`: a `recent_tasks.*` event refreshes Recents.
Other company views do not refresh.
- A failed save is tried again one time. If it fails again, the client
loads the server list again, so an unsaved change does not look saved.
- The import reads only the newest browser storage version.
- `SidebarRecentTasks`: the "Archive" action removes the task from the
server list.
- `doc/PRODUCT.md`: describes the shared list.

## Verification

- `cd server && npx vitest run
src/__tests__/recent-tasks-routes.test.ts` (embedded Postgres): 5
passed. The tests cover: two clients of the same person see the same
order; touch and passive seed; personal and company scope (teammate,
other company, agent, viewer, suspended member); removal plus activity
log plus live events; import, and the 200-row limit.
- `cd server && npx vitest run src/__tests__/openapi-routes.test.ts`: 59
passed.
- `cd server && npx vitest run src/__tests__/recent-tasks-routes.test.ts
src/__tests__/live-events-toast.test.ts`: 21 passed. This includes
private-task checks and owner-only socket delivery.
- `cd ui && npx vitest run src/lib/recent-tasks.test.ts
src/hooks/useRecentTasks.test.tsx
src/context/LiveUpdatesProvider.test.ts`: all passed. New tests cover:
the same list on a second client, legacy import (success and failure),
the record-and-list race, server-time adoption, and live-event scoping.
- `packages/db`: `migration-compatibility.ts` classifies `0515` as
`online_compatible`.
- `packages/shared` typecheck: no errors. `ui` typecheck: no errors in
changed files (errors exist only in the ungenerated Storybook
feature-map indexes).
- `server`: a typecheck of the route, service, and test graph passes.
The full `server` typecheck was killed by the local memory limit (exit
137). CI covers it.
- `pnpm verify` returned exit 2 (the migration needs broad CI coverage).
Required CI supplies that coverage.

## Risks

- Medium. This adds a table and changes where Recents is kept.
- Each task open now sends one more request and writes one activity row
(the same as `issue.read_marked`). The live socket sends the event only
to the owner's connections.
- Rows that are not eligible stay in the server list (hidden) until they
fall out of the newest 200. Before, the client deleted them.
- The import reads `paperclip.recentTasks.v3`, `v2`, and the oldest key
one time for each browser. If the import fails, the browser copy stays
and the next load tries again.
- An old tab from the previous release still writes to `localStorage`.
The next load of a new tab imports those entries. The later time wins,
so this does not reorder newer server entries.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), via Claude Code with tool use
(shell, file edit, test runs).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [ ] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: devinfoley <139239+devinfoley@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 01:44:29 +00:00
SealdotandCodex 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>
2026-12-04 17:39:12 -08:00
TonioandPaperclip 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 3d4b46fcb8.
Coverage includes reversing a pose transition midway.
- The local verification selector requested broader CI coverage because
the shared stylesheet changed.

## Risks

- Long agent names share header space with the pill on narrow screens.

## Model Used

OpenAI Codex, GPT-6, with repository edits and Chromium 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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-05 01:25:23 +00:00
DottaandPaperclip 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
9a5a949098 --check` (`changed: false`, 602
inputs).
- Required CI checks (`ci / verify`, `ci / e2e`, `ci / Typecheck +
Release Registry`, `ci / Build`) cover the full matrix on `9a5a949098`.

## Risks

- Low risk. Auto-enabling repositories remains strictly fenced by
`bot.status !== "active"`, `initialRepositoryImportPending === true`,
and `!repositorySelectionSaved`, and is skipped when repository refresh
fails, so active bots, recovered installations, and explicit user
repository disables in Access settings are never overwritten.
- `managementUrl`, `installationUrl`, and `appUrl` are validated by
shared helpers on both server and UI to allow only `https://github.com`
paths matching their expected URL shapes.

## Model Used

- Google Gemini 4 Neon (High) via Antigravity with tool use and code
execution (exact internal model version string and context window are
not exposed in this session).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [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>
2026-12-04 18:43:20 -06:00
DottaandPaperclip 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>
2026-12-04 18:24:02 -06:00
DottaandClaude Opus 5.5 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>
2026-12-04 18:07:05 -06:00
DottaandPaperclip 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>
2026-12-04 17:45:39 -06:00
DottaandPaperclip 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>
2026-12-04 17:26:31 -06:00
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>
2026-12-04 15:12:42 -08:00
DottaandPaperclip 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>
2026-12-04 16:41:13 -06:00
TonioandPaperclip 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>
2026-12-04 14:01:43 -08:00
DottaandPaperclip 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>
2026-12-04 15:54:56 -06:00
DottaandPaperclip 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>
2026-12-04 15:50:56 -06:00
DottaandPaperclip 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>
2026-12-04 21:03:26 +00:00
DottaandPaperclip 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>
2026-12-04 14:23:22 -06:00
Zhafron Adani Kautsar 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
2026-12-04 11:03:50 -08:00
DottaandPaperclip 0960dd464d perf(chat): eliminate activity_log seq scans, chat load waterfalls, and transcript storms (#23750)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Persistent agent chat pages (`/:companyPrefix/chats/:agentRef`) are
a primary surface for collaborating with an agent across many tasks and
turns.
> - Opening an active agent chat page was slow: multiple endpoints
scanned the full `activity_log` table, the page bypassed the
single-request chat bootstrap, the native transcript hook aborted and
retried historical run fetches across multiple waves, and pending task
questions triggered N+1 per-task interaction requests.
> - These bottlenecks blocked the initial chat reveal for several
seconds and saturated server and database capacity during page open.
> - This pull request eliminates the `activity_log` sequential scans
with index-backed predicates (no schema migrations), batches
pending-question interaction hydration, defers completed saved-reply run
transcripts in persistent agent chats, stabilizes per-run transcript
lifecycles, and enables parallel chat resolution and chat-bootstrap
adoption on agent chat pages.
> - The benefit is dramatically faster agent chat page loads with far
fewer HTTP requests, zero `activity_log` full-table scans on hot chat
paths, and no schema migrations.

## Linked Issues or Issue Description

Related: #18461, #20355, #21650, #21671.

**What happened?**

Opening a persistent agent chat page with accumulated history and active
tasks took multiple seconds before the conversation became visible and
triggered dozens of concurrent API requests:

1. `decisionHistoryService.list` (`handledForBySource`) scanned all rows
of `activity_log` because `(details ->> 'handledForUserId') IS NOT NULL`
alone did not bind the second key of
`activity_log_company_handled_for_created_idx`, and `decisions` used
`NOT IN (SELECT id FROM issues ...)` which planned a full-company
privacy subquery even when no settled decisions existed.
2. `activityService.forIssue` scanned all rows of `activity_log` because
the `project.created` and `company.skill_created` branches omitted
`entity_type`, preventing index scans.
3. `attentionService.taskQuestions` executed steady-state write
transactions in `decision-retention` and unnecessary plan-document reads
on read paths, and `CoordinatorChatPendingQuestion` mounted an
`AttentionInteractionResolver` per question that fired one `GET
/api/issues/:taskId/interactions` request per pending question.
4. `TaskChatThread` disabled saved-reply transcript deferral in
`conversationMode`, fetching `/events` (and legacy `/log` fallbacks) for
every historical completed run in the comment window, while
`useNativeRunTranscripts` used a single shared `AbortController` that
aborted and restarted in-flight sibling reads whenever run membership or
live-stream state changed.
5. `AgentChat` waited serially for the agent roster and session before
fetching the chat by `:agentRef`, `IssueDetail` skipped
`startIssueChatBootstrap` for conversations, and the HTML preload plugin
omitted the `AgentChat` chunk on `/chats/:ref` hard loads.

**Expected behavior**

Opening an agent chat page resolves the conversation and its first-frame
data in parallel via `chat-bootstrap`, avoids sequential scans on
`activity_log`, avoids fetching completed run transcripts when a saved
reply is already visible, avoids aborting sibling in-flight transcript
reads, and renders pending task questions without per-task N+1
interaction requests.

**Steps to reproduce**

1. Create a company with a persistent agent chat that has 20+ historical
replies from completed native runs, several hundred tasks assigned to
that agent, pending `ask_user_questions` interactions across multiple
tasks, and a large `activity_log` table.
2. Open `/:companyPrefix/chats/:agentRef` directly or from the sidebar
and inspect the network waterfall and PostgreSQL query plans for
`/activity`, `/decision-receipts`, `/pending-questions`, and
`/heartbeat-runs/:id/events`.
3. Observe full-table `Seq Scan` plans on `activity_log`, bypassed
`chat-bootstrap`, repeated aborted `/events` requests, and N+1
`/issues/:taskId/interactions` calls.

**Paperclip version or commit**

Reproduced on `ca21075837` (rebased onto `a3719da3ca`, final head
`2995820afe`).

## What Changed

- **Eliminate `activity_log` sequential scans (zero migrations)**:
- `server/src/services/activity.ts`, `server/src/routes/activity.ts`,
`server/src/routes/issues.ts`: Scope `forIssue` secondary branches by
their canonical `entity_type` (`project` for `project.created`,
`company_skill` for `company.skill_created`) and accept `companyId` from
routes so PostgreSQL uses `BitmapOr` index scans instead of a full-table
`Seq Scan`.
- `server/src/services/decision-history.ts`: Add `(details ->>
'handledForUserId') >= ''` alongside `IS NOT NULL` in
`handledForBySource` so PostgreSQL binds the partial index
`activity_log_company_handled_for_created_idx`; replace
`decision_target_issues.issue_id NOT IN (...)` with correlated `NOT
EXISTS (...)`; add a `LIMIT 1` index probe before planning the full
`decisions` privacy query when no settled decisions exist.
- `server/src/services/conversation-decision-receipts.ts`,
`server/src/routes/issues.ts`: Reuse the route's already-authorized
conversation record instead of re-querying `source()`.
- **Batch pending-question hydration and avoid steady-state retention
writes**:
- `packages/shared/src/types/attention.ts`,
`server/src/services/issue-thread-interactions.ts`,
`server/src/services/attention.ts`: Add optional `interaction?:
IssueThreadInteraction | null` on `AttentionItem`, batch-hydrate
interactions in `issueThreadInteractionService.listByIds` (grouping by
`issueId` for acceptance readiness and skipping only `z.ZodError` legacy
payloads), restrict `planDocumentMap` to actual plan confirmation
interactions, and parallelize `decisionQueueItems` and `decisionTriage`
reads in `enrichAttentionItems`.
- `server/src/services/decision-retention.ts`: Add a read-only fast path
in `syncItems` so steady-state reads skip opening a write transaction
when retention rows are already current, while still syncing and bumping
versions whenever `activityAt` changes.
- `ui/src/components/AttentionInteractionResolver.tsx`,
`ui/src/components/coordinator/CoordinatorChatPendingQuestions.tsx`:
Accept optional `initialInteraction` so inline pending-question cards
render immediately without N+1 `GET /issues/:taskId/interactions`
requests while still honoring cache updates after mutations.
- **Remove agent chat load waterfalls and transcript abort storms**:
- `ui/src/components/TaskChatThread.tsx`,
`ui/src/lib/run-answer-visibility.ts`: Defer completed `succeeded` run
transcripts that already have a visible saved reply in
`conversationMode` while preserving immediate hydration for live,
failed, yielded, pending-interaction, and unanswered runs; precompute
visible-answer lookups in linear time (`O(comments + runs)`) instead of
quadratic scans.
- `ui/src/components/transcript/useNativeRunTranscripts.ts`: Manage
`AbortController`s and poll timers per run instead of one shared
controller so adding sibling runs or transitioning stream health never
aborts in-flight reads or refetches already-hydrated terminal runs;
clear aborted in-flight tracking cleanly so expanding compact history
refetches immediately.
- `ui/src/pages/AgentChat.tsx`, `ui/src/pages/IssueDetail.tsx`,
`ui/src/lib/vite-issue-detail-preload.ts`: Start `agentChatsApi.get` by
`:agentRef` in parallel with roster/session reads on cold loads, enable
`startIssueChatBootstrap` for conversations with an existing issue ID,
and preload the `AgentChat` chunk alongside `IssueDetail` on
`/chats/:ref` hard loads.
- **Tests & SDK pin**:
- Added/updated tests in
`server/src/__tests__/activity-service.test.ts`,
`server/src/__tests__/activity-routes.test.ts`,
`server/src/__tests__/decision-history.test.ts`,
`server/src/__tests__/issue-thread-interaction-routes.test.ts`,
`ui/src/components/AttentionInteractionResolver.initial.test.tsx`,
`ui/src/components/TaskChatThread.test.tsx`,
`ui/src/components/transcript/useNativeRunTranscripts.test.tsx`,
`ui/src/components/transcript/useNativeRunTranscripts.streaming.test.tsx`,
and `ui/src/lib/vite-issue-detail-preload.test.ts`.
- Updated `tests/runner-e2e/source-sdk-public-inputs.json` for
`packages/shared/src/types/attention.ts`.

## Verification

Local disposable PostgreSQL 18.1 benchmark (`200,000` `activity_log`
rows, `455` tasks, `82` interactions, alternating baseline/treatment
samples, `ANALYZE` run, positional `.values()` output equality verified
on both empty and populated `handledForUserId` sets):

| Caller/query | Before median | After median | Samples/spread |
Complete output/contract check | Scope |
| --- | --- | --- | --- | --- | --- |
| `activityService.forIssue(50)` | `53.66 ms` (`50.78 ms` SQL exec,
`11,147` buffers, `Seq Scan`) | `1.84 ms` (`0.31 ms` SQL exec, `23`
buffers, `BitmapOr` index scans) | 7 alternating samples (before
`48.03–62.79 ms`, after `1.34–3.18 ms`, `29.2x` speedup) | Pass (50
positional rows equal) | SQL |
| `decisionHistory.handledForBySource` (40 ids, 0 rows) | `13.71 ms`
(`11,193` buffers, `Seq Scan`) | `0.73 ms` (`2` buffers, `Bitmap Index
Scan` on partial index) | 7 alternating samples (before `11.56–15.45
ms`, after `0.64–0.99 ms`, `18.8x` speedup) | Pass (empty + populated
non-empty positional rows equal) | SQL |
| `decisionHistory.handledForBySource` (40 ids, 1 matching row) | `40.35
ms` SQL exec (`11,193` buffers, `Seq Scan`) | `0.04 ms` SQL exec (`2`
buffers, `Bitmap Index Scan` on partial index) | `EXPLAIN (ANALYZE,
BUFFERS)` | Pass (1 positional row equal) | SQL |

CI and reviews on final head `2995820afe`:
- **GitHub Actions CI (`ci / verify`)**: **PASS** (all 86 check runs
completed with 0 failures; `mergeStateStatus: CLEAN`).
- **Greptile Review**: **5/5** (`SUCCESS`, 0 unresolved findings).
- **Ponytail Paperclip Review**: **5/5** ("No actionable defects found
in the reviewed paths. Verdict: Ship.").
- **Feynman Nuclear Review**: **4/5** ("no confirmed defect in the new
commits").

Tests and builds also verified locally:
- `pnpm --filter @paperclipai/shared build` — pass
- `cd server && node scripts/typecheck-layers.mjs` — pass (all 7 layers)
- `pnpm --filter @paperclipai/ui typecheck` & `pnpm --filter
@paperclipai/ui build` — pass
- `pnpm --filter @paperclipai/server exec vitest run
src/__tests__/approval-queue-seeding-work.test.ts
src/__tests__/decision-history.test.ts` — pass (28/28 and 14/14 on real
embedded PostgreSQL)
- `pnpm --filter @paperclipai/server exec vitest run
src/__tests__/activity-service.test.ts
src/__tests__/openapi-routes.test.ts` — pass
- Focused UI suites (`TaskChatThread.test.tsx`,
`useNativeRunTranscripts.test.tsx`,
`useNativeRunTranscripts.streaming.test.tsx`,
`AttentionInteractionResolver.initial.test.tsx`,
`AttentionInteractionResolver.replace.test.ts`,
`IssueDetail.agentChatPanel.test.tsx`,
`vite-issue-detail-preload.test.ts`) — pass

## Risks

- **No schema migrations**: All SQL improvements use existing indexes.
- **Completed chat run transcripts**: Persistent agent chats now defer
completed `succeeded` runs that already have a visible saved reply,
matching compact task behavior. Live, failed, yielded,
pending-interaction, placeholder, progress-only, and hash-targeted runs
still hydrate immediately.
- **Inline interaction hydration**: `AttentionInteractionResolver` uses
`initialInteraction` when provided and valid, skipping the mount-time
`listInteractions` read; mutations and live updates continue to
update/invalidate `queryKeys.issues.interactions(issueId)` and
`["issues", "pending-questions"]`. Unparseable legacy interaction rows
(`z.ZodError`) are omitted from the batch map and fall back cleanly to
the per-issue read.
- **Synthetic local proof vs production**: Local PostgreSQL benchmarks
prove query plan and buffer reductions on synthetic data (`200k` rows);
deployed latency improvements depend on production dataset size and
cache warmth.

## Model Used

Google Antigravity (Gemini) with tool use, terminal execution, and local
embedded PostgreSQL profiling.

## 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>
2026-12-04 12:28:02 -06:00
DottaandPaperclip cfe5042378 fix(opencode): fix API key env/secret resolution and support Antigravity connector (#23387)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Agent setup, environment testing, and managed AI connections pass
provider API keys into the OpenCode adapter and Paperclip Runner
> - OpenCode setup failed with `Secret not found` when a user supplied a
direct Gemini API key alongside a stale or auto-selected secret binding,
and the OpenCode runtime reported `GOOGLE_GENERATIVE_AI_API_KEY` missing
because Paperclip only passed `GEMINI_API_KEY` and limited OpenCode to
OpenRouter credentials
> - Users need reliable direct provider API keys and Google/Antigravity
API-key connectors across legacy OpenCode, native Paperclip Runner, and
Plugin Runner environments without exposing raw keys to child tool
shells
> - This pull request strips probe-overridden secret references
(including symmetric Google key aliases) before secret resolution,
prioritizes pasted API keys in setup, routes direct OpenCode provider
credentials through a runner-owned loopback proxy, and enables API-key
AI connections (including the Google / Antigravity connector) for
`opencode_local`
> - The benefit is that OpenCode agents test and run reliably with
direct provider keys or connected Google/Antigravity API keys without
false `Secret not found`, missing `GOOGLE_GENERATIVE_AI_API_KEY` errors,
or raw key leaks into child environments

## Linked Issues or Issue Description

- Fixes: #23359
- Refs #23370 (related community fix by @dev-787 for the initial Gemini
API key issue)

## What Changed

- **Server test-environment secret stripping and inheritance
(`server/src/routes/agents.ts`)**: Strip any credential key supplied in
`testCredentials` (including the symmetric `GEMINI_API_KEY` /
`GOOGLE_GENERATIVE_AI_API_KEY` pair and `hermes_gateway` `apiKey`) from
both `adapterConfig` and resolved environment `envVars` before secret
persistence normalization and runtime resolution. Scope `opencode_local`
inheritable credential groups from `@paperclipai/shared`
(`OPENCODE_PROVIDER_CREDENTIAL_ENV_KEYS`), skip inheritance when the
child supplies any OpenCode credential, and isolate multi-provider
parents to one matching provider group.
- **UI setup credential precedence (`ui/src/lib/provider-credential.ts`,
`ui/src/components/new-agent/NewAgentSetup.tsx`)**: Prefer an explicitly
entered raw API key over an auto-selected organization or personal
secret, and clear stale provider secret bindings and Google alias keys
when switching credentials or providers.
- **OpenCode direct provider keys and Gemini aliasing
(`packages/adapters/opencode-local/`, `packages/adapter-utils/`)**:
Mirror non-empty `GEMINI_API_KEY` into `GOOGLE_GENERATIVE_AI_API_KEY`
during OpenCode runtime config preparation and model discovery while
preserving blank managed isolation. Register `google`, `xai`, `groq`,
and `opencode` API key names in `api-billing-type`.
- **Runner-owned loopback credential proxy and allowlist parity
(`packages/paperclip-runner/`, `packages/plugins/sdk/`,
`packages/shared/`)**: Export canonical
`OPENCODE_PROVIDER_CREDENTIAL_ENV_KEYS` and
`OPENCODE_CREDENTIAL_ENV_KEYS` from `@paperclipai/shared`. Route direct
OpenCode provider API keys (`google`, `anthropic`, `openai`, `xai`,
`groq`, `opencode`) through a runner-owned loopback proxy
(`packages/paperclip-runner/src/drivers/opencode/provider-proxy.ts`)
with per-session bearer tokens, model-pinned endpoint allowlists, native
upstream auth header injection, request secret redaction, and redirect
refusal so raw keys never enter `opencode serve` child environments or
`opencode.json`. Allow direct provider keys across TypeScript, Rust, and
Plugin SDK allowlists, reserve `GOOGLE_API_KEY` and `GROK_API_KEY` in
TS/Rust configured-environment projections, strip ambient provider keys
(including `OPENROUTER_API_KEY`) from sanitized OpenCode runner
environments unless explicitly supplied, and redact provider keys in
output custody.
- **Antigravity / multi-provider API-key AI connections for OpenCode
(`packages/shared/`, `server/src/services/`,
`ui/src/components/ai-connections/`)**: Enable `api_key` AI connections
for `google` (Antigravity catalog slug), `anthropic`, `openai`, and
`xai` on `opencode_local` (keeping OAuth `subscription` methods
excluded), enforce provider-to-model prefix compatibility, mirror
`GEMINI_API_KEY` to `GOOGLE_GENERATIVE_AI_API_KEY` in
`prepareManagedAiRuntime`, isolate project config with
`OPENCODE_DISABLE_PROJECT_CONFIG=true`, and scope child-auth override
detection in `agent-ai-connection-default.ts` to non-empty OpenCode
credentials (supporting plain values, `secret_ref.secretId`, and
`user_secret_ref.key`).
- **Tests and pinned input registry**: Added unit, route, cross-layer
allowlist parity, and pinned `opencode@1.18.34` `bash`-tool credential
isolation tests across `adapter-utils`, `adapter-opencode-local`,
`paperclip-runner`, `server`, and `ui`, and synchronized
`tests/runner-e2e/source-sdk-public-inputs.json`.

## Verification

- `@paperclipai/adapter-utils`: `src/api-billing-type.test.ts` (17/17
tests), `typecheck`, `build` — passed
- `@paperclipai/adapter-opencode-local`:
`src/server/runtime-config.test.ts`, `src/server/models.test.ts`,
`typecheck`, `build` — passed
- `@paperclipai/shared`: full suite (123/123 files, 1426/1426 tests),
`typecheck`, `build` — passed
- `@paperclipai/paperclip-runner`: `typecheck:typescript`,
`build:typescript`, `check:package-boundaries`,
`opencode-server-driver.test.ts` (101/101 including pinned
`opencode@1.18.34` `bash`-tool test), `output-custody.test.ts` (13/13),
`configured-environment.test.ts` (35/35),
`antigravity-credentials.test.ts` (11/11), and
`durable-prp-control-plane.test.ts` — passed
- `@paperclipai/server`: `typecheck` and targeted suites
(`ai-connections.test.ts` 170/170, `agent-hire-ai-connections.test.ts`
84/84, `agent-test-environment-routes.test.ts` 72/72,
`agent-hire-auth-inheritance-routes.test.ts` 29/29,
`plugin-runner-credentials.test.ts` 43/43,
`plugin-runner-credential-names.test.ts` 6/6 cross-layer TS/Rust parity,
`opencode-local-adapter-environment.test.ts` 4/4,
`ai-auth-failure.test.ts` 32/32, `ai-provider-routing.test.ts` 21/21,
`antigravity-runner-credentials.test.ts`) — passed
- `@paperclipai/ui`: `typecheck`, `provider-credential.test.ts`,
`AiConnectionSelect.test.tsx` (20/20 tests) — passed
- `@paperclipai/plugin-sdk`: `build`, `environment-tasks.test.ts`,
`environment-task-release-resume.test.ts` (104/104) — passed on
`03dc341957`
- `@paperclipai/paperclip-runner`: `provider-traffic.test.ts` &
`provider-traffic-proxy.test.ts` alongside OpenCode/Antigravity/custody
suites (169/169) — passed on `03dc341957`
- `node tests/runner-e2e/source-sdk-public-inputs.mjs
03dc341957 --check` — passed (`changed:
false`, 602 inputs)
- GitHub CI on `03dc341957`: all 95 checks green (`MERGEABLE` / `CLEAN`)
— `ci / verify` ([run
47315344108](https://github.com/paperclipai/paperclip/actions/runs/47315344108)),
`ci / e2e`, `Verify Paperclip Runner` (static checks, Rust, Vitest
package & native server suites), `Runner Windows` ([run
47315343800](https://github.com/paperclipai/paperclip/actions/runs/47315343800)),
`Runner image` (`amd64` + `arm64`, [run
47315343840](https://github.com/paperclipai/paperclip/actions/runs/47315343840)),
`macOS OpenCode SSH runtime` ([run
47315343817](https://github.com/paperclipai/paperclip/actions/runs/47315343817)),
`Verify serialized server suites` (1/9–9/9), `Superagent Security Scan`,
`Greptile Review` (5/5), `Paperclip Review` (5/5), `Socket Security`,
and `security/snyk` passed.
- Local verification gap: `cargo` is not installed in this container;
Rust checks (`typecheck:rust` / `test:rust`) ran and passed in GitHub CI
(`verify_paperclip_runner`).

## Risks

- Low to moderate risk. No database schema or migration changes are
included.
- Touches provider credential allowlists in both TypeScript and Rust
(`codex_provider.rs`, `configured_environment.rs`), the runner-owned
loopback proxy for direct OpenCode providers, and secret-stripping logic
in `POST /companies/:companyId/adapters/:type/test-environment`. Parity
between TypeScript and Rust allowlists is enforced by
`plugin-runner-credential-names.test.ts`, and Rust build/test checks
pass in CI.
- `opencode_local` AI connection compatibility enforces that the
selected model prefix matches the connected provider (for example,
`google/...` for a Google/Antigravity API-key connection). Existing
`openrouter/...` connections remain compatible.

## Model Used

- Google Gemini (Antigravity agent runtime) with reasoning, repository
code navigation, shell execution, and automated test verification.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] 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>
2026-12-04 12:20:32 -06:00
Nicky LeachandClaude Opus 5.5 e2e2265085 feat(plugins): tell a task side panel plugin when the person closes its tab (#23747)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Plugins can show an agent detail tab in the task side panel, next to
a task
> - The board mounts only the active side panel tab, and it unmounts a
plugin view in the same way when the person switches tabs and when the
person closes the tab
> - Thus a plugin that shows a live view in a task panel tab cannot know
when the person is done with it, and it cannot release the view
> - A component callback does not solve this, because a background tab
is not mounted when the person clicks its close control
> - This pull request adds an optional declarative
`taskSidePanel.closePath`, symmetric with the existing
`availabilityPath`
> - The benefit is that a plugin can release a live view when the person
closes its tab, and plugins that do not declare the path see no change

## Linked Issues or Issue Description

Refs #17796 (added plugin panels in task side panels). Related: #23609.

**Subsystem affected**

Plugin UI slots: `detailTab` slots with a `taskSidePanel` declaration,
and the task side panel in the board UI.

**Problem or motivation**

A plugin panel in the task side panel gets no signal when the person
closes its tab. The board unmounts the view on a close and on a tab
switch in the same way, so the plugin cannot tell the two apart. A
plugin that holds a live view for the panel cannot release it when the
person closes the tab.

**Proposed solution**

Add an optional `closePath` to `taskSidePanel`. When the person closes
the tab, the board sends a fire-and-forget POST to that plugin route,
with the same agent, run and task as the availability request. The
manifest must declare the path as a board POST route scoped to agent
`:entityId`.

**Alternatives considered**

A callback on the mounted plugin component. It does not work for a
background tab, because only the active tab is mounted.

**Roadmap alignment**

This extends the plugin system. It adds no product-specific behaviour to
the control plane.

## What Changed

- `taskSidePanel` accepts an optional `closePath`. It uses the same path
rules as `availabilityPath`: a plugin-relative path with one `:entityId`
segment.
- Manifest validation requires a declared `POST` API route at
`closePath` with `auth: "board"`, no transport, and `companyResolution:
{ from: "agent", param: "entityId" }`. These are the same rules as the
`GET` availability route.
- When the person closes a plugin panel tab in the task side panel, the
board sends `POST
/plugins/<pluginId>/api<closePath>?runId=<run>&issueId=<task>`, with
`:entityId` replaced by the panel's agent. The board leaves out `runId`
when the task has no active run. This applies to the active tab and to
background tabs.
- The board does not wait for the request. A failed request does not
block the close, and the board logs a console warning.
- The board sends no request on a tab switch, when the panel unmounts,
when the person leaves the task, or when the board removes a panel that
is no longer available.
- A slot without `closePath` behaves as before.
- The plugin SDK README and the plugin spec document the new field.

A plugin declares:

```ts
ui: { slots: [{
  type: "detailTab", id: "screen", displayName: "Live view", exportName: "LiveView", entityTypes: ["agent"],
  taskSidePanel: {
    availabilityPath: "/agents/:entityId/view/availability",
    closePath: "/agents/:entityId/view/close",
  },
}] },
apiRoutes: [
  { routeKey: "view.availability", method: "GET", path: "/agents/:entityId/view/availability", auth: "board", capability: "api.routes.register", companyResolution: { from: "agent", param: "entityId" } },
  { routeKey: "view.close", method: "POST", path: "/agents/:entityId/view/close", auth: "board", capability: "api.routes.register", companyResolution: { from: "agent", param: "entityId" } },
],
```

## Verification

- `packages/shared`: `npx vitest run src/validators/plugin.test.ts`
passes (85 tests). New cases accept a valid close route and a close path
equal to the availability path. They reject unsafe paths, a missing POST
route, the wrong method (`GET`, `DELETE`), non-board auth, a non-agent
company resolution, and the wrong agent parameter.
- `ui`: `npx vitest run
src/components/task-side-panel/TaskSidePanel.pluginClose.test.tsx`
passes (6 tests). The tests render the task side panel and check that a
close of the active tab and of a background tab sends exactly one POST
to the correct URL. They also check that a tab switch, an unmount, a
removal of an unavailable panel, and a slot without `closePath` send
nothing, and that an idle task omits `runId` and a failed request still
closes the tab.
- Red check: with the board call removed, the three close tests fail.
- `ui`: `npx vitest run src/hooks/useTaskPluginPanels.test.tsx` passes
(56 tests).
- `tsc --noEmit` passes for `packages/shared` and for `ui` source files.

## Risks

- Low risk. The field is optional, and slots without it keep their
current behaviour.
- A plugin receives a close POST only for a person's close of the tab.
The plugin must treat the request as a hint, because the request can
fail or arrive late.
- Existing manifests continue to validate. The availability route error
message has the same text as before.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

- Claude Opus 5.5 (Anthropic), model ID `claude-opus-5-5`, run in Claude
Code with tool use (file edits, shell, test runs) and extended
reasoning.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 08:42:58 -08:00
DottaandPaperclip a3719da3ca fix(ui): prioritize recent composer assignees (#23744)
## Thinking Path

> - Paperclip helps people manage work with agents.
> - People pick a recipient in the new-task and task reply composers.
> - The picker puts people before agents. Frequently used recipients can
be far down the list.
> - The composer can use its saved assignee history to put recent
recipients at the top.
> - This change shows up to five recent choices, then puts the other
agents before the other people.

## Linked Issues or Issue Description

**What existing behavior does this improve?**

The assignee list in the task composer.

**Subsystem affected**

UI board.

**Current behavior**

Open the assignee picker in a task composer. The list can show people
before all agents. It has no top list of mixed agent and human
selections.

**Proposed behavior**

Show the five most recent available choices first in newest-first order.
Show the other agents, then the other people. Put No assignee at the end
of the list and include it in search.

**Reason and benefit**

People can find recipients they use often and reach other agents sooner.

Related composer UI changes are #15050 and #14250.

## What Changed

- Read company-specific assignee history in the shared composer picker.
- Record each explicit picker selection, including reselection of the
current assignee. Reset run settings only when the assignee changes.
- Keep the saved recent-agent fallback for older browser history.
- Test recency order, the five-choice limit, company boundaries, search,
reselection, and reopening with 268 choices in the new-task and reply
composers. Bound option reads in each step.

## Verification

- The new regression test failed on the old order and passed with the
fix.
- Ran the composer, run settings, assignee, and recent selection test
files with Vitest. All 205 tests passed.
- Ran `pnpm --filter @paperclipai/ui typecheck`. It passed.
- Ran `pnpm test:e2e tests/e2e/new-task-picker-touch.spec.ts
--workers=1`. All three Chromium tests passed.

## Risks

Low risk. This changes the order of existing options. The history uses
the browser's existing storage. The regression test checks that a
missing assignee does not reduce the five-choice limit.

## Model Used

OpenAI Codex, GPT-6, with shell and GitHub tooling.

## 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>
2026-12-04 10:18:53 -06:00
DottaandPaperclip 70d780107d fix(ui): stop re-sorting Recents sidebar items to the top on click (#23404)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The sidebar includes a Recents list that mixes recent tasks, agent
chats, and projects.
> - Opening an existing task or project from Recents currently writes
`Date.now()` as its timestamp and jumps that item to the top.
> - That breaks spatial stability when a person clicks through items in
Recents, because every click re-sorts the list.
> - This pull request stops passive opens and clicks from changing an
existing item's recency timestamp, seeds unseen items from their latest
activity timestamp, and records explicit user activity when a person
takes action on a task.
> - The benefit is a predictable Recents list that orders items by
recent activity without shifting on click.

## Linked Issues or Issue Description

**What happened?**

When a person clicked an existing task or project in the sidebar Recents
list, opening that item stamped it with `Date.now()` and moved it to the
top of Recents. Clicking through several recent items constantly
re-sorted the sidebar.

**Expected behavior**

Recents sorts items with the most recent activity at the top, and
clicking or passively opening an existing item keeps the list order
unchanged. Only real activity (such as creating, editing, commenting,
approving/rejecting, or responding to an interaction on a task, or
server-side updates on chats and projects) moves an item to the top.

**Steps to reproduce**

1. Open the Coordinator workspace with at least two tasks or projects in
the sidebar Recents list.
2. Click an older item lower in Recents.
3. Observe that the clicked item jumps to the top of Recents even though
no activity occurred.

**Paperclip version or commit**

Reproduced on `master` (`b63445c8f1`).

**Deployment mode**

Local dev (source checkout).

Related PRs: #22219, #22024.

## What Changed

- Updated `recordRecentTask` in `ui/src/lib/recent-tasks.ts` so passive
opens never change an existing entry's `recordedAt`, and unseen passive
opens seed chronologically from `lastActivityAt` or `updatedAt` (falling
back below existing history when no valid timestamp exists).
- Removed visit-time `Date.now()` bumping in
`ui/src/pages/IssueDetail.tsx` and centralized explicit local activity
updates (`recordLocalTaskActivity`) across task edits, comments,
approvals (captured at mutation start), interaction responses, and
isolated re-issues for both Streamlined and Coordinator modes.
- Enabled immediate recent-task recording on task creation in
`ui/src/components/NewIssueDialog.tsx` when Coordinator mode is enabled
(previously gated only on Streamlined mode).
- Extracted `recordProjectRecentVisit` and `buildCoordinatorRecents` in
`ui/src/components/CoordinatorSidebar.tsx` so revisiting a project keeps
its existing entry unchanged, unseen projects seed from
`project.updatedAt`, real project updates advance its sort time via
`Math.max`, and memo inputs remain referentially stable.
- Updated `DESIGN.md` and `doc/PRODUCT.md` to document activity-based
Recents ordering without click-driven re-sorting.
- Added and updated unit and component tests in
`ui/src/lib/recent-tasks.test.ts`,
`ui/src/components/CoordinatorSidebar.recents.test.ts` (including a
linear-scan read-budget check across 450 items), and
`ui/src/pages/IssueDetail.mobile.test.tsx`.

## Verification

Tested on rebased commit `79f028344b56ec41092ad458b956c3fd02be0fe0`:

- `pnpm --filter @paperclipai/ui typecheck` — passed (0 errors).
- `pnpm --filter @paperclipai/ui exec vitest run
src/lib/recent-tasks.test.ts src/hooks/useRecentTasks.test.tsx
src/hooks/useRecentTaskOpenWarmup.test.tsx
src/components/CoordinatorSidebar.recents.test.ts
src/pages/IssueDetail.mobile.test.tsx` — passed (5 files, 68 tests).
- `pnpm check:token-gates` — passed (all 4 token gates clean).
- Broad typecheck, build, and full test coverage will be verified by
GitHub CI on this PR.

## Risks

- Low risk. Changes are scoped to client-side Recents ordering, state
recording, and documentation. No database migrations, API schema
changes, or permission changes.
- Users who relied on clicking an old task solely to pin it at the top
of Recents can use the existing sidebar pin control or take action on
the task.

## Model Used

- Antigravity (Google DeepMind agentic assistant) with code inspection,
file editing, shell execution, Vitest, TypeScript, and GitHub CLI 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>
2026-12-04 10:10:42 -06:00
597992d955 fix(ui): open the chat side drawer on the chat's task list (#23702)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Agent Chat lets a person talk to one agent. The chat header has a
button that toggles the right side drawer.
> - In a new chat, the button did nothing. The desktop panel did not
show content until the chat was saved by the first message.
> - In the coordinator workspace, the drawer opened on an empty
launcher. It did not show the tasks from the chat.
> - The user expects the button to open a list of the tasks that the
chat created or that its agent worked on.
> - This pull request makes the drawer open on that task list in both
cases.
> - The benefit is that the header button always does something useful
in a chat.

## Linked Issues or Issue Description

**What happened?**
In the chat view, the button in the top right toggles the right side
drawer. In a new chat, a click on the button does nothing. In the
coordinator workspace, the drawer opens empty.

**What did you expect to happen?**
The button opens the drawer with a list of the tasks that the chat
created or worked on.

**Steps to reproduce**
1. Turn on Agent Chat.
2. Open a chat with an agent that has no saved conversation.
3. Click the drawer button in the top right of the header.
4. The drawer does not open.

## What Changed

- `IssueDetail.tsx`: For an unsaved chat on desktop, the panel now shows
a read-only task list. The full side panel still needs a saved issue,
because its Properties tab writes to the issue.
- `AgentWorkPanels.tsx`: Add `AgentChatDraftTasksPanel`. It shows the
agent's tasks. In the coordinator workspace, it shows the empty list of
tasks from the conversation.
- `TaskSidePanel.tsx`: In the coordinator workspace, a saved chat now
opens on its Tasks tab ("Tasks from this conversation") and not on the
empty launcher. Other tasks keep the empty, on-demand panel.
- Add `IssueDetail.agentChatPanel.test.tsx` with four desktop tests: a
saved chat, an unsaved chat, a saved coordinator chat, and an unsaved
coordinator chat.

## Verification

- `cd ui && npx vitest run src/pages/IssueDetail.agentChatPanel.test.tsx
src/pages/IssueDetail.mobile.test.tsx`: 7 tests pass.
- Red-green: before the fix, the unsaved-chat test failed because the
drawer stayed hidden. The coordinator test failed when I removed the
`TaskSidePanel.tsx` change.
- `pnpm verify`: 4,214 tests pass in 260 of 261 selected files. One
test, `codemirror-single-instance.test.ts`, timed out at 5 s under load.
It walks `node_modules` and does not touch this change. It passes alone
(10/10).
- `npx tsc --noEmit -p ui`: no errors in changed files. The only errors
come from Storybook feature-map files that need generated indexes. Those
indexes are not in git.
- I did not do a manual browser check. The local preflight build did not
finish in time.

## Risks

- Low risk. The change applies only to Agent Chat routes.
- In the coordinator workspace, a chat's drawer now opens on Tasks and
not on the launcher. The user can still open other tabs from the
launcher.
- The unsaved-chat task list in the classic workspace shows all the
agent's tasks. That is the same list as the saved chat's default Tasks
tab.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use and
code execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: devinfoley <139239+devinfoley@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 23:46:32 -08:00
0f36a88f41 fix(notifications): stop toasting "changed the title" on task updates (#23674)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The board shows live toast notifications when another person or
agent changes a task.
> - Each title edit makes a toast that says "<actor> changed the title".
> - Agents often set or change task titles automatically. These toasts
are noise and give no useful information.
> - This pull request removes title changes from the toast details on
the server and from the toast text in the UI.
> - The benefit is fewer unhelpful notifications. Status, priority,
assignment, and description changes still show.

## Linked Issues or Issue Description

**Describe the bug**
Users get toast notifications that only say "<actor> changed the title".

**Steps to reproduce**
1. Open the board as a user.
2. Let another user or an agent change the title of a task.
3. See the toast "<actor> changed the title".

**Expected behavior**
A title change does not show a notification. Other changes in the same
update still show.

## What Changed

- `server/src/realtime/activity-toast-details.ts`: the projection does
not set `titleChanged` any more. This also stops old cached UI bundles
from showing the toast.
- `ui/src/context/LiveUpdatesProvider.tsx`: `describeIssueUpdate` does
not add "changed the title". A title-only update now makes no toast.
- Tests: new UI and server tests for title-only and mixed updates. The
existing tests now expect no `titleChanged` field.

## Verification

- Red-green: the new UI test "does not announce title changes" failed
before the fix and passes after it.
- `cd ui && npx vitest run src/context/LiveUpdatesProvider.test.ts`: 140
passed.
- `cd server && npx vitest run
src/realtime/activity-toast-details.test.ts
src/__tests__/live-events-toast.test.ts`: 19 passed.

## Risks

- Low risk. Title changes do not show a toast any more. The task
activity log still records them.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, 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)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
(the execution workspace assigned the branch name)
- [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 (no
doc describes this toast)
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: devinfoley <139239+devinfoley@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 20:54:56 -08:00
bca282e587 feat(recents): add tasks from manual routine runs to Recents (#23675)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The sidebar Recents list shows the tasks from a person's own recent
activity
> - A person can run a routine manually with "Run now", and the run
creates a task
> - That task does not show in Recents, and opening it does not keep it
there, because Recents only admits tasks under the Mine participation
rule. This also affects every routine, channel, and agent-created task
that a person opens
> - The Mine rule keeps these tasks out of Mine on purpose, so we must
not change that rule
> - This pull request adds a separate Recents eligibility flag. It also
admits tasks that the viewer opened and tasks from manual routine runs
that the viewer started. The UI records the new task in Recents when the
run starts
> - The benefit is that people can find the task they just started from
the sidebar at once, and Mine stays unchanged

## Linked Issues or Issue Description

**Is your feature request related to a problem? Please describe.**
When I run a routine manually and it creates a task, the task is not in
my Recents list. I must go to the routine or the task list to find it.

**Describe the solution you'd like**
When I run a routine manually and a task is created, add that task to my
Recents list automatically, even if I did not open it.

Also, a task that a routine creates does not show in Recents even after
I open it.

**Additional context**
Mine must continue to keep routine tasks out by default, including
routines that a person starts manually (see `doc/PRODUCT.md`).

## What Changed

- `server/src/services/issue-summaries.ts`: navigation summaries return
a new `isRecentEligibleForMe` flag. It is true when one of these
conditions is true:
  - The viewer participates under the Mine rule.
- The viewer opened the task. The check is the viewer's
`issue_read_states` row, which is unique on company, issue, and user.
- The viewer started the manual routine run that created the task. The
check is a `routine_runs` row found through the indexed
`linked_issue_id`, with `source = 'manual'` and the same ID as the
issue's `originRunId`. The issue `createdByUserId` must be the viewer,
with no creating agent.
  `isParticipantForMe`, Mine, and unread state do not change.
- `packages/shared`: add `isRecentEligibleForMe` to `IssueSummary`.
- `ui/src/hooks/useRecentTasks.ts`: Recents uses `isRecentEligibleForMe`
(with a fallback to `isParticipantForMe` for older cached summaries) to
show, keep, and prune entries.
- `ui/src/lib/recent-tasks.ts`: add `recordStartedRoutineRunTask`. It
puts the run's task at the top of Recents. The summary fetch then
supplies the title and status and confirms eligibility.
- New `useRecordRoutineRunInRecents` hook. All five "Run now" paths call
it on success: Routines (both list variants), Routine detail, Execution
workspace detail, and the Responsibility screen.
- `tests/runner-e2e/source-sdk-public-inputs.json`: refresh the pin for
`packages/shared/src/types/issue.ts`.
- `doc/PRODUCT.md`: document the Recents behavior.

## Verification

- `cd ui && npx vitest run src/hooks/useRecentTasks.test.tsx`: 29
passed. The new test "shows a task from the viewer's manual routine run
at the top before it is opened" fails on the old hook (red) and passes
with the change (green). Other new tests cover a run that the server
does not confirm (for example, a coalesced run) and a repeat run for a
task that is already in Recents.
- `cd server && npx vitest run
src/__tests__/issue-summaries-routes.test.ts` (embedded Postgres): 24
passed. One new test checks that a manual run by the viewer is
Recents-eligible but not a Mine participant, and that runs by another
person and scheduled runs are not eligible. Another new test checks that
a routine task the viewer opened is Recents-eligible, and that a task
opened only by another person is not. That test fails on the previous
service code (red) and passes with the change (green).
- `ui` typecheck: no errors in changed files. (Errors exist only in
ungenerated Storybook feature-map indexes, which this change does not
touch.)
- The full `server` typecheck was killed by the local memory limit. CI
covers it.
- Manual check: run a routine with "Run now", then look at sidebar
Recents. The new task shows at the top before you open it. Mine does not
show it.

## Risks

- Low risk. No schema change and no migration.
- The summaries query adds two `EXISTS` subqueries per requested task.
Both use indexes (the read-state unique index and
`routine_runs_linked_issue_idx`). The request is bounded by
`ISSUE_SUMMARIES_MAX_IDS`.
- Behavior change: Recents now keeps tasks that the person opened, also
when the task is automatic work. Old local Recents entries for automatic
tasks that the person read can come back.
- If a manual run coalesces into an existing task that the viewer did
not start, the entry is pruned after the summary read. That task does
not show in Recents.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), via Claude Code with tool use
(shell, file edit, test runs).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [ ] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [ ] 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>
2026-12-03 20:54:26 -08:00
b93527b632 fix(ui): sort the Reports to manager picker alphabetically (#23689)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Each agent can report to a manager agent. The user selects the
manager in the "Reports to" picker.
> - The picker shows candidate managers in directory order. This order
is not alphabetical.
> - When a company has many agents, the user cannot easily find a
specific agent in the list.
> - This pull request sorts the picker rows alphabetically by agent
name.
> - The benefit is that the user finds a manager faster, and the order
agrees with the sidebar.

## Linked Issues or Issue Description

**Is your feature request related to a problem?**
The "Reports to" picker on the agent profile lists agents in an
unpredictable order (for example: "Mac Coder", "Bug Bot", "Nibbler",
"CTO"). It is hard to find one agent in a long list.

**Describe the solution you'd like**
Sort the picker rows alphabetically by agent name. Ignore letter case.
Put "Agent 2" before "Agent 10".

**Describe alternatives you've considered**
Sorting the agent list in each caller. This change sorts inside the
shared `ReportsToPicker` component instead, so the agent profile and the
agent configuration form both get the same order.

## What Changed

- Added `reportsToPickerRows` to
`ui/src/components/ReportsToPicker.tsx`. It removes terminated and
excluded agents, then sorts the rows by name with `localeCompare`
(`sensitivity: "base"`, `numeric: true`).
- `ReportsToPicker` uses this function for its rows. "No manager" stays
at the top.
- The picker indexes `disabledAgentIds` in a `Set`. Before, it scanned
the array once per row.
- Added `ui/src/components/ReportsToPicker.test.ts` with unit tests for
the order and the filter.

## Verification

- `cd ui && npx vitest run src/components/ReportsToPicker.test.ts`: 2
tests pass.
- Red check: the same tests fail on the previous code.
- `npx tsc --noEmit -p ui/tsconfig.json` shows no errors in the changed
files.
- 1,000-agent test bounds the sort work with a throwing name-read
counter (per `rules/ui-render-cost.mdc`).
- Manual: ran the branch on a local dev server with 13 agents. The
"Reports to" picker showed: Agent 2, Agent 10, Bug Bot (Deprecated), CEO
Agent, CTO, Dickens, Engineer Agent, Fry (Codex), Mac Coder, nibbler,
Reviewie, Slow Query (GLM), Test Gardener (GLM).

## Risks

- Low risk. The change is UI-only and changes only the row order. Filter
and selection behavior do not change.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, used through Claude
Code with tool use (shell, file edit) and image input.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: devinfoley <139239+devinfoley@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 20:52:44 -08:00
Dotta 986af44e94 fix(ui): omit task archive success toasts (#23697)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Task views let each person archive tasks from their inbox.
> - Some archive actions display a success toast.
> - The task lists and indicators already show the archive result.
> - This pull request removes the success toast from each task archive
path.

## Linked Issues or Issue Description

**What happened?**
Some task archive actions displayed a success toast. Related work:
#11220.

**Expected behavior**
A successful task archive has no toast. If the action fails, the UI
shows the error.

**Steps to reproduce**
1. Open Tasks and select Mine or All tasks.
2. Archive a task.
3. On the base revision, the Task archived toast appears.

**Paperclip version or commit**
Reproduced on master at `3f882fc5895072e9a63e46df0eb0e1dad75f092b`.

**Deployment mode**
Local UI component tests.

## What Changed

- Remove task archive success toasts from the inbox-backed Tasks view,
the shared task-list action, task detail, and the recent-tasks sidebar.
- Use **U** after archiving directly from Mine or Unread. Use
**Restore** in **Archived** for a task archived from any view.
- Add regression cases for Inbox, Tasks, All tasks, and task detail.
Document where to restore a task.

## Verification

- The Tasks and All tasks cases failed on the base revision because they
received a success toast.
- The task detail case also failed with the original success toast
restored and passed after its removal.
- Run `pnpm exec vitest run --root ui --config vitest.config.ts
src/pages/IssueDetail.mobile.test.tsx
src/pages/TaskListPagination.test.tsx src/lib/inboxArchiveCache.test.ts
src/lib/keyboardShortcuts.test.ts
src/hooks/useInboxTouchedIssues.test.tsx`. All 63 tests passed on
`8cf0f17`.
- `pnpm --filter @paperclipai/ui typecheck` passed.
- The workspace Git storage guard prevented the incremental `pnpm
verify` command from selecting tests. The focused Vitest run above
covers the changed behavior.

## Risks

- The Undo button in the toast goes away with the toast. Use **U** for
archives initiated in Mine or Unread. **Restore** in **Archived** covers
detail, sidebar, and other task-list archives.
- The archive request, task cache updates, and error handling use the
same paths.

## Model Used

- OpenAI Codex, GPT-6, with shell and GitHub API tools.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

hint: if you need to wait for this pull request to be reviewed, merged,
or closed before continuing, use this instead of polling:
gh event listen --resource
https://github.com/paperclipai/paperclip/pull/23697 --event
com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1
- It prints the first event as a JSON line on stdout and exits; run it
again to wait for the next one.
- Add `--timeout` to stop waiting after a while, for example `--timeout
30m`; it then exits with status 8.
  - Events carry no details; read the pull request to see what changed.
- It misses changes made before it starts, so read the pull request once
it is running.
  - See `gh event listen --help` for other event types.
- Event subscriptions are in preview and may not be enabled for your
account.

hint: if you need to wait for this pull request to be reviewed, merged,
or closed before continuing, use this instead of polling:
gh event listen --resource
https://github.com/paperclipai/paperclip/pull/23697 --event
com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1
- It prints the first event as a JSON line on stdout and exits; run it
again to wait for the next one.
- Add `--timeout` to stop waiting after a while, for example `--timeout
30m`; it then exits with status 8.
  - Events carry no details; read the pull request to see what changed.
- It misses changes made before it starts, so read the pull request once
it is running.
  - See `gh event listen --help` for other event types.
- Event subscriptions are in preview and may not be enabled for your
account.
2026-12-03 21:32:35 -06:00
DottaandPaperclip a30541b793 fix(ui): fade out task status update caret unless hovered (#23402)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - On a task page, the activity thread shows status update rows such as
"Ran commands, searched files" and their expanded activity rows.
> - In `TaskChatRunnerActivityGroup`, the disclosure caret on the right
edge stays at full opacity even when the user does not hover over the
row.
> - Other collapsible rows in the task thread (`TaskChatThinking`,
`TaskChatProtocolActivityRow`) hide their disclosure carets at rest
while preserving touch-device discoverability
(`tc-hover-disclosure-caret`) and keeping expanded carets legible
(`rotate-90 opacity-80`).
> - This pull request fades out the right-side caret on runner activity
phase toggles, folded read runs, and expandable activity rows unless
hovered, keyboard-focused, or expanded, while sharing the repository's
`.tc-hover-disclosure-caret` touch fallback.
> - The benefit is a calmer task thread with no layout shift on hover,
full keyboard accessibility, and consistent disclosure behavior across
all task-chat rows.

## Linked Issues or Issue Description

**What existing behavior does this improve?**

The disclosure carets on the right side of task status update rows in
`TaskChatRunnerActivityGroup` on the task page.

**Subsystem affected**

ui/ — React + Vite board UI

**Current behavior**

Activity status update rows such as "Ran commands, searched files",
folded file-read rows, and expandable activity rows keep their
right-side chevron caret visible at full opacity at rest.

**Proposed behavior**

When collapsed and not hovered, the right-side caret stays faded out
(`opacity-0`). It fades in smoothly with the shared motion tokens
(`--motion-duration-fast` and `--motion-ease-standard`) on row hover or
keyboard `focus-visible`, and fades back out when hover or focus ends.
While a row is expanded, the caret stays visible (`rotate-90
opacity-80`, brightening to `opacity-100` on hover/focus). All three
carets include the shared `.tc-hover-disclosure-caret` class so
touch-only devices (`@media (hover: none)`) keep the disclosure
affordance discoverable.

**Reason and benefit**

Hiding the right-side caret at rest removes visual noise across activity
updates in the task thread and aligns `TaskChatRunnerActivityGroup` with
the existing hover-disclosure pattern in `TaskChatThinking`,
`TaskChatProtocolActivityRow`, and `ui/src/index.css` (related: #12640,
#15048). Using opacity instead of unmounting keeps row alignment stable
on hover.

**Breaking changes**

None.

## What Changed

- Extract a shared `DISCLOSURE_CARET_CLASS` constant in
`ui/src/components/task-chat/TaskChatRunnerActivityGroup.tsx` including
`tc-hover-disclosure-caret` and the shared motion tokens
(`--motion-duration-fast`, `--motion-ease-standard`,
`motion-reduce:transition-none`).
- Add named group hooks (`group/activity-phase`, `group/read-run`,
`group/activity-row`) to the three disclosure buttons in
`TaskChatRunnerActivityGroup.tsx`.
- Fade out each right-side `ChevronRight` caret at rest (`opacity-0`),
reveal it on hover or keyboard focus (`group-hover/...:opacity-100`,
`group-focus-visible/...:opacity-100`), and keep it visible while open
(`rotate-90 opacity-80`).
- Add unit tests in
`ui/src/components/task-chat/TaskChatRunnerActivityGroup.test.tsx`
covering completed summaries, active toggles, folded read runs, expanded
activity rows, open/close state transitions, and
`tc-hover-disclosure-caret`.

## Verification

- Local focused Vitest on `0b46f7cf99`: `node
node_modules/vitest/vitest.mjs run
ui/src/components/task-chat/TaskChatRunnerActivityGroup.test.tsx
ui/src/components/task-chat/antigravity-thread.test.tsx
ui/src/components/task-chat/completed-activity-summary.test.ts` — 36/36
tests passed.
- Local focused Vitest on `0b46f7cf99`: `node
node_modules/vitest/vitest.mjs run
ui/src/components/TaskChatThread.test.tsx` — 436 passed, 1 skipped.
- Local token gates on `0b46f7cf99`: `pnpm check:token-gates` — all 4
token gates clean.
- Local UI build on `0b46f7cf99`: `pnpm --filter @paperclipai/ui build`
— built cleanly and verified compiled CSS emits `@media
(hover:none){.tc-hover-disclosure-caret{opacity:1}}` and scoped
`group-hover/*:opacity-100` rules.
- GitHub Actions CI on `0b46f7cf99` ([run
46734780674](https://github.com/paperclipai/paperclip/actions/runs/46734780674)):
all 30 checks passed (`ci / verify`, `ci / Build`, `ci / Typecheck +
Release Registry`, `ci / General tests`, `ci / policy`, all 16 `ci /
e2e` shards, `commitperclip PR Review`, `Socket Security`, `Superagent
Security`, and `security/snyk`).
- Automated reviews on `0b46f7cf99`: `ponytail-paperclip-review` (5/5,
ship), `feynman-nuclear-review` (5/5), and `Greptile Review` (5/5; P2
note about `tc-hover-disclosure-caret` answered and resolved in-thread).

## Risks

- Low risk. Only the opacity, rotation, and transition classes on the
right-side disclosure carets change; click, expand/collapse, keyboard,
and touch-device discoverability semantics stay intact.

> This is a small UI polish change and does not overlap with planned
core features in `ROADMAP.md`.

## Model Used

- Google DeepMind Antigravity coding agent (Gemini model with
reasoning/thinking mode, file editing, shell execution, and GitHub CLI
tools; exact model ID and context window are not exposed by the runner
environment).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-03 21:18:38 -06:00
Devin FoleyandPaperclip 3f882fc589 fix(native): stage task-description attachments for native agents (#23688)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - People often create a task with a screenshot in its description and
assign it to a native agent.
> - The native Runner stages wake-comment files into the agent
workspace, so the agent can open an image with its file reader.
> - Files attached to the task description have no comment, so the
Runner never staged them.
> - The agent then said that it could not see the screenshot, or it
guessed from the text.
> - This pull request stages the task's own files on every native wake.
> - The benefit is that an agent can see the screenshot that explains
the task.

## Linked Issues or Issue Description

**What happened?**

A user created a task with the description "This list should probably be
sorted alphabetically" and pasted a screenshot of the list. A Claude
agent on a native sandbox replied that it could not open the screenshot
and asked which list to sort. It found the attachment through the API,
but the run had no staged path and no tool that put the image in its
workspace. When the same image was attached to a comment, the agent
opened it at once.

**Expected behavior**

A native agent can inspect files that are attached to the task
description, the same as files attached to a wake comment.

**Steps to reproduce**

1. Create a task and paste an image into its description.
2. Assign the task to a native `paperclip_runner` agent.
3. Ask the agent what the image shows.
4. The prompt has no "Paperclip native attachment access" entry for the
image, and the agent cannot see it.

**Paperclip version or commit**

`master` at c5f5d3163d.

## What Changed

- New column `issue_attachments.issue_level` (boolean, default `false`,
migration `0514`). It marks a file that a person attached to the task
itself.
- The UI sets `issueLevel` for new-task files, the task attachment
picker and drop zone, the task side panel upload button and drop zone,
the description editor, and task document images. Inline description
draft images that are bound at publication are also marked.
Comment-composer uploads, agent uploads and system files (for example
workspace-recovery archives) stay unmarked.
- The upload route accepts an optional `issueLevel` multipart field
(`true` or `false`). A file with a comment is never issue-level.
- `resolveNativeRunnerWakeAttachmentSelections` adds task files without
a comment after the wake comment's files. A task file is marked
issue-level, or the saved description links to it by its attachment or
asset content path (this covers files saved before the marker, with no
backfill). They come oldest first, within the existing 20-file limit. A
full wake keeps its comment files and does not fail. Only files a person
uploaded count; agent uploads, which carry no per-file trust, never do.
A quarantined low-trust task does not stage them.
- Staged descriptors for these files carry `taskAttachment: true`, so
the agent can tell them from the current wake's files.
- Runner download grants accept a null source comment for `wake` grants
only. The download route requires that the file is in the current wake
selection and has no comment. `history` grants still require a comment.

## Verification

- New `native-runner-task-attachment-staging.test.ts` (embedded
Postgres, with the migration): local staging of a task image, an
unmarked file that the description links to, comment-first ordering, an
unsent composer upload that is not staged and returns 404 on download,
an agent upload that is marked and linked from the description but is
not staged, the 20-file limit, low-trust quarantine, and the Runner
download grant (200 for the task file, 404 for crossed comment/task
grants, and no history grant without a comment).
- `issue-attachment-routes.test.ts`: `issueLevel` is saved for `true`,
is `false` when absent, and an invalid value returns 400.
- `chat-attachment-read`, `native-chat-workspace`,
`native-runner-attachment-staging`, `antigravity-run-start`,
`paperclip-control-plane-port`, `native-stop-accounting.integration`:
pass. `native-session-executor.test.ts`: 1572 passed, 7 skipped.
- `pnpm run typecheck` in `server` and `ui`: passed.
`IssueDetail.mobile.test.tsx`: passed.
- `pnpm verify` asks for full CI because of the migration. The pinned
runner-e2e source inputs are refreshed.

## Risks

- Schema change: one `ADD COLUMN ... DEFAULT false NOT NULL`. PostgreSQL
11 and later add it without a table rewrite.
- Existing attachments stay `false`. Older files that the description
links to are still staged. Other older files without a comment are not
staged. This fails closed, and a person can attach the file again.
- The migration is a constant-default `ADD COLUMN` only;
`migration-compatibility --check` passes.
- A file attached through a task-level surface stays a task file until
it is deleted, also if it is later removed from the description text. It
stays in the task's Attachments list for everyone on the task.
- Each native wake on a task with task files stages those files again.
The 20-file and 10 MiB Runner download limits apply. Each wake adds one
indexed query.
- Adapter (non-native) runs do not change.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use
(shell, file edits, database reads of a test instance) and extended
thinking.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [ ] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-03 17:44:15 -08:00
Tonio 23ca89e376 Link agent names in the chat sidebar to their overviews (#23650)
## Thinking Path

> - Paperclip lets people manage agents.
> - The chat sidebar lists agents with conversations.
> - Each row opens a conversation.
> - The agent name gives readers a natural place to open the agent
overview.
> - Separate links let users choose either destination with a mouse or
keyboard.

## Linked Issues or Issue Description

**Subsystem affected**
Chat sidebar navigation.

**Current behavior**
Selecting an agent name opens the conversation.

**Proposed behavior**
Selecting the name opens that agent's overview. Selecting the avatar or
role opens the chat.

## What Changed

Added a company-scoped overview link on the name and kept a separate
chat link across the row.

## Verification

The sidebar compiled with esbuild. The diff whitespace check passed. To
verify in the app, click the name, return to the list, then click the
role. Check both links with Tab and Enter.

## Risks

Users who previously clicked the name to open chat will now reach the
overview.

## Model Used

OpenAI Codex, GPT-6, with shell tools.

## Checklist

- [ ] I have included a thinking path that traces from project context
to this change
- [ ] I have specified the model used (with version and capability
details)
- [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [ ] I have searched GitHub for duplicate or related PRs and linked
them above
- [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [ ] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [ ] I have run tests locally and they pass
- [ ] I have added or updated tests where applicable
- [ ] I have updated relevant documentation to reflect my changes
- [ ] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [ ] I will address all Greptile and reviewer comments before
requesting merge
2026-12-03 12:13:14 -08:00
ce204a223a fix(ui): tag chunk-load reports with the reload recovery step that gave up (#23613)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The board UI loads each page as a lazy chunk. When a chunk fails to
load, chunk-load recovery reloads the page. It retries while a deploy
settles (#17349, #19361).
> - Safari reported `TypeError: Importing a module script failed.` from
the route error boundary. The build already had the retry logic. So
recovery gave up and the user saw the error page.
> - Recovery can give up for four reasons. The reload did not leave the
page within 10 seconds, the retries were used up, session storage was
blocked, or an earlier reload in this page was abandoned. The report
does not say which one occurred. Breadcrumbs are off for privacy, so the
event has no other clue.
> - This pull request records the recovery decision for each chunk-load
error and sends it as one enum tag.
> - The benefit is that the next report shows which recovery step
failed, so a real fix can target that step.

## Linked Issues or Issue Description

Refs #17349
Refs #19361

**What happened?**
A Safari user got `TypeError: Importing a module script failed.` from
the route error boundary. The page was more than 10 minutes old and had
become visible 10–60 seconds earlier. The build included the chunk-load
retry logic, so recovery gave up. The event does not tell why.

**Expected behavior**
A chunk-load error report states which recovery step gave up, without
URLs or page data.

**Steps to reproduce**
1. Open a lazy route in a build where its chunk can no longer load.
2. Let the reload stall for more than 10 seconds, or use up the retries
in the guard window.
3. Look at the Sentry event. It has no field that tells which case
occurred.

## What Changed

- `chunk-load-recovery.ts`: Record a `ChunkLoadRecoveryOutcome` for each
chunk-load error. The values are `reload_pending`, `reload_abandoned`,
`reload_cancelled`, `retries_exhausted`, `storage_unavailable`, and
`disabled_after_abandon`. Errors that wait on a reload change to
`reload_abandoned` or `reload_cancelled` when that reload ends. Add
`readChunkLoadRecoveryOutcome(error)`. The reload behavior does not
change.
- `sentry.ts`: In `beforeSend`, add the `browser_chunk_reload` tag when
the original exception has a recorded outcome.
- Tests for each outcome and for the tag.

## Verification

- `cd ui && npx vitest run src/lib/chunk-load-recovery.test.ts
src/lib/sentry.test.ts src/components/RouteErrorBoundary.test.tsx
src/components/AppErrorBoundary.test.tsx`: 83 tests pass.
- Red check: the 4 new tests fail on the old implementation and pass
with this change.
- `cd ui && npx tsc --noEmit -p tsconfig.json`: no errors in changed
files. The only errors are the ignored generated Storybook catalog
files, which were not generated locally.
- Note: `sentry.test.ts > initializes with the DSN it receives` can time
out at 5 s on a cold cache. The same flake occurs on unchanged `master`.
- `pnpm verify` did not finish in this environment (no output in 300 s,
also with `--explain`). CI supplies the broad coverage.

## Risks

Low risk. The change only adds one enum tag to Sentry events. It sends
no URL, path, or page data. The outcome map is a `WeakMap`, so it holds
no errors in memory. The reload timing and the guard logic do not
change.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), agentic coding with tool use and
code execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: paperclipbugbot <356415228+paperclipbugbot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 06:25:58 -08:00
Tonio 24e095c160 Keep provider navigation visible in Connect account (#23602)
## Thinking Path

> - Paperclip helps people manage AI agents.
> - Agents use provider connections to run tasks.
> - People choose those providers in the Connect account dialog.
> - A selected provider needs a direct path back to the grid.
> - Two cards keep that path visible during sign-in.

## Linked Issues or Issue Description

**Subsystem affected**

Connect account dialog.

**Current behavior**

The grid entry disappears for some providers. A disabled Next button
takes up space during automatic sign-in.

**Proposed behavior**

Show the selected provider and Other Models together. Show a primary
action when the flow requires one.

## What Changed

- Added access to the provider grid from native and custom connection
forms.
- Hid the footer during automatic sign-in and retained explicit
connection actions.

## Verification

- Ran the two AgentProviderConnection test files. All 13 tests passed.

## Risks

- Switching to another provider leaves the current credential draft.

## Model Used

GPT-6 (Codex).
2026-12-03 09:35:02 +00:00
Tonio 741bed6651 Align credential chips and clarify Restart sign-in (#23600)
## Thinking Path

> - Paperclip lets people share provider credentials with selected
agents.
> - Connect account shows those agents as profile chips.
> - The identity chip and disclosure link have different alignment
needs.
> - Give the chips one height and place the disclosure beside the access
summary.
> - Label the sign-in restart action directly.

## Linked Issues or Issue Description

Related PR #23598.

**What happened?**

The identity chip was shorter than the agent chips, and the Change link
moved when the chips wrapped.

**Expected behavior**

Keep chips at 28 pixels. Align Change and Done with the summary. Show
Restart sign-in for the isolated sign-in flow.

**Steps to reproduce**

Open Antigravity under Other Models in Connect account and expand the
access editor.

## What Changed

Move the disclosure to the summary row and align its baseline. Set a
common chip height. Update the restart link and its tests.

## Verification

All 51 focused credential access and sign-in tests passed.

## Risks

Long summaries can wrap on narrow viewports.

## Model Used

OpenAI GPT-6, via Codex.

## Checklist

- [ ] I have included a thinking path that traces from project context
to this change
- [ ] I have specified the model used (with version and capability
details)
- [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [ ] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [ ] I have run tests locally and they pass
- [ ] I have added or updated tests where applicable
- [ ] I have updated relevant documentation to reflect my changes
- [ ] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [ ] I will address all Greptile and reviewer comments before
requesting merge
2026-12-03 08:43:39 +00:00
Tonio 432ca25efa Manage Connect account access with agent profile chips (#23598)
## Thinking Path

> - Paperclip connects provider accounts to agents.
> - The account dialog summarizes agent access.
> - Initials alone make selected agents hard to identify.
> - Agent Overview already shows agent names and avatars together.
> - Reuse those chips and let people edit the selection in place.

## Linked Issues or Issue Description

Related PR #23576.

**What happened?**

The credential summary showed overlapping badges and required opening
Change to edit the selected agents.

**Expected behavior**

Show each selected agent by name. Offer a searchable add control and a
remove control on each editable agent chip.

**Steps to reproduce**

Open Connect account, choose Antigravity under Other Models, and inspect
credential access.

## What Changed

Reuse profile chips and the agent picker. Keep the draft selection in
sync with the expanded access editor.

## Verification

All 36 focused credential selection and provider sign-in tests passed.

## Risks

A large explicit selection wraps across multiple rows. Organization-wide
agent access uses one summary chip.

## Model Used

OpenAI GPT-6, via Codex.

## Checklist

- [ ] I have included a thinking path that traces from project context
to this change
- [ ] I have specified the model used (with version and capability
details)
- [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [ ] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [ ] I have run tests locally and they pass
- [ ] I have added or updated tests where applicable
- [ ] I have updated relevant documentation to reflect my changes
- [ ] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [ ] I will address all Greptile and reviewer comments before
requesting merge
2026-12-03 07:11:26 +00:00
scotttongandScott Tong 8379dedd93 Pin Plugins by default in workspace navigation (#23578)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - People browse available integrations on the Plugins page.
> - A fresh Coordinator sidebar puts that page inside More.
> - People who look in Settings can miss it.
> - This pull request pins Plugins until a person chooses their own
layout.

## Linked Issues or Issue Description

**What existing behavior does this improve?**

Finding the Plugins catalog on a first visit to the Coordinator
workspace.

**Current behavior**

Open a workspace in a fresh browser profile. The sidebar shows Inbox
followed by More. Open More to find Plugins.

**Proposed behavior**

Show Plugins below Inbox on the first visit. Honor saved pins and their
order, including an empty list.

Related discussion about navigation for individual plugin pages: #21807.

## What Changed

- Use the Plugins route as the default when the signed-in user has no
saved pin list in this browser.
- Add a browser regression for unpinning and re-pinning across reloads.
Update the AgentMail browser journey to use the visible Plugins link.
- Document the default and how to change it.

## Verification

- `pnpm exec vitest run ui/src/hooks/usePinnedNavigation.test.tsx`
passed.
- `pnpm exec playwright test -c tests/e2e/playwright.config.ts
tests/e2e/plugins-browse.spec.ts tests/e2e/agentmail.spec.ts` passed all
four Chromium tests against the built app and a disposable database.
- Compared the parent and feature commits in fresh Chromium sessions.
Confirmed the pin control in More and the unpin and reorder controls on
the pinned row.

## Risks

An existing user who has never saved pins in this browser also receives
the new default. A saved empty list keeps the sidebar empty of pins.

## Model Used

OpenAI GPT-6 (Codex), with repository editing and Chromium test
execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Scott Tong <scott@scotts-mbp-m5-max.local>
2026-12-02 18:30:20 -08:00
Tonio a93d971eed Refine Connect account sign-in controls and access badges (#23576)
## Thinking Path

> - Paperclip lets people connect provider accounts to agents.
> - The Connect account dialog shows the sign-in controls and credential
access.
> - A pasted callback requires an additional submit action.
> - The desktop dialog has room for the three controls on one row.
> - Back should return to the provider grid in one step.

## Linked Issues or Issue Description

Related PR #23551.

**What happened?**

The submit control occupied a second row and Back collapsed the selected
provider before returning to the grid.

**Expected behavior**

Keep desktop controls inline, stack them on mobile, and return directly
to the grid.

**Steps to reproduce**

Select Antigravity under Other Models. Inspect the sign-in controls,
then press Back.

## What Changed

Adjust the Antigravity and Grok sign-in marks. Show overlapping
credential access badges. Simplify the submit label and the Back action.

## Verification

All 35 focused AdapterLoginChrome and AgentProviderConnection tests
passed.

## Risks

Narrow viewports use a stacked layout. The available callback controls
depend on the environment.

## Model Used

OpenAI GPT-6, via Codex.

## Checklist

- [ ] I have included a thinking path that traces from project context
to this change
- [ ] I have specified the model used (with version and capability
details)
- [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [ ] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [ ] I have run tests locally and they pass
- [ ] I have added or updated tests where applicable
- [ ] I have updated relevant documentation to reflect my changes
- [ ] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [ ] I will address all Greptile and reviewer comments before
requesting merge
2026-12-03 02:25:24 +00:00
scotttong b0f682b66b Measure when users see a reply to their onboarding chat input (#23574) 2026-12-02 18:03:08 -08:00
Devin FoleyandPaperclip 2b65b97cae fix(ui): paginate all task-list views (#23564)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Its task lists help people find and manage work across personal and
organization views.
> - Several personal views stop after 100 tasks, and Blocked stops after
200 tasks.
> - Other lists have page reads but lack a consistent way to load more
or retry a failed page.
> - This pull request makes pagination available across every task-list
view.
> - People can reach older tasks, keep filters active, and retry without
losing readable rows.

## Linked Issues or Issue Description

**What happened?**
Task lists have inconsistent pagination. Mine, Recent, and Unread stop
at the first task batch. Blocked stops at 200 tasks. Everything has the
same missing-page behavior before this PR. Some organization layouts and
searches replace paged rows with separate capped queries.

**Expected behavior**
Every task-list view can load its remaining tasks. A failed later page
keeps loaded tasks visible and offers a retry.

**Steps to reproduce**
1. Use a company and account with more tasks than a view's first batch.
2. Open Mine, Recent, Unread, Everything, or Blocked and scroll to the
bottom.
3. Try to reach older tasks. The affected views stop without a next-page
control.
4. Check organization status views, Archived, search, and board layouts
for consistent loading controls.

**Paperclip version or commit**
The affected code is present at base commit
`53bebb59f907571228dfb85a834a38536f934aa6`.

**Deployment mode**
Observed on hosted staging. Verified locally from source on macOS arm64.

GitHub searches found no duplicate open PR or directly matching issue.

## What Changed

- Apply one task pagination control to personal, organization, status,
archive, classic, and sandbox task lists.
- Make Recent, Unread, and Everything page through touched tasks. Remove
the shared 100-task display cutoff.
- Filter unread tasks on the server before paging.
- Keep Mine's coherent initial snapshot. Fetch older task pages through
the existing authorized list API.
- Add older pages to Blocked. Load Needs attention task details in
batches from its existing task index.
- Let the Tasks route supply paged search and board data to the shared
list components, so separate capped queries cannot replace loaded pages.
- Keep loaded rows visible during later-page loading and errors. Keep
the retry control available when the final attention page fails.
- Pause the classic and streamlined lists' automatic server-page reads
after a later-page error. Keep an explicit retry button available to
restart that page.
- Keep one paging and retry control inside each task-list component for
list and board layouts.
- Reuse the same request filters for the first and later Legacy Inbox
pages.
- Preserve the array cache contract for archive rollback, live updates,
and sharing the first page across tabs.
- Update product documentation and cover the additional views with
regression tests.

## Verification

- Revision: `9275d37c06dc14d00b6759ad71fb6402252db84b`, based on
`origin/master` at `53bebb59f907571228dfb85a834a38536f934aa6`.
- Environment: macOS arm64, Node v25.6.1, pnpm 9.15.4.
- From `ui/`, ran `pnpm exec vitest run
src/components/IssuesList.paging.test.tsx
src/pages/TaskListPagination.test.tsx src/pages/Issues.test.tsx
src/hooks/useInboxTouchedIssues.test.tsx src/lib/inbox.test.ts
src/lib/blockedInbox.test.ts src/lib/inboxArchiveCache.test.ts
src/lib/inboxOrderPin.test.ts src/hooks/useSharedPolling.test.ts
src/hooks/useSharedPollingSnapshot.test.tsx
src/hooks/useTaskListCollection.test.tsx`: all 133 tests passed across
11 files.
- Real IssuesList tests cover both UI modes. They verify that provided
board and search pages stay visible, capped column and search queries do
not run, and each layout has one paging and retry control. Only leaf row
and board rendering are stubbed.
- Real Inbox page tests load later Mine and Recent pages in both UI
modes. They also check Unread's server filter, first-page and later-page
filter agreement, and removal of the control after the last page.
- Page tests cover All tasks, Active, Backlog, Done, Archived, Needs
attention, Blocked, and classic Tasks with server search. Supporting UI
services and row rendering are isolated.
- Red-green regressions proved the old 100-task display cutoff and
automatic retries after a failed page. The fixed lists keep readable
rows and require an explicit retry after failure.
- The work-limit test uses 500 full task fixtures across five pages. A
deterministic counter throws above a linear task-ID read budget. Ten
unchanged rerenders per page perform no collection work.
- Tests also cover page overlap, duplicate observer events, last-page
detection, loading and retry, account and company changes, archive
rollback, live invalidation, and the fallback without
IntersectionObserver.
- Ran `pnpm --dir ui typecheck`: passed.
- Ran `node scripts/check-test-budget.mjs --base origin/master`: passed
for all four changed test files.
- Ran `git diff --check origin/master...HEAD`: passed.
- A prior `pnpm verify` attempt selected 2,319 files and started a broad
server run. It was stopped to avoid duplicating broad CI for this UI
change. That interrupted attempt is not a pass.
- Full local build and browser acceptance of the modified pages were not
run. [Greptile passed with 5/5 on this
revision](https://github.com/paperclipai/paperclip/pull/23564#issuecomment-7362362373).
Both inline review threads are resolved. [CI
typecheck](https://github.com/paperclipai/paperclip/actions/runs/47004999629/job/143907916923)
and
[build](https://github.com/paperclipai/paperclip/actions/runs/47004999629/job/143907916990)
passed. [Both required CI checks passed on this
revision](https://github.com/paperclipai/paperclip/actions/runs/47004999629):
`ci / e2e` and `ci / verify`. No CI checks remain pending or failed.
Confirmation that automated design review has cleared the prior hold is
still pending.

## Risks

- Task updates can move rows between offset pages. The merge removes
duplicate task IDs, and live refreshes update loaded pages.
- Search and task filters cover loaded rows in personal views. Use Load
more tasks to include older rows while filters are active.
- Mine keeps the existing snapshot and access behavior. The change adds
no database migration or public API contract.

## Model Used

OpenAI `gpt-6.1-sol` through the Codex harness, with xhigh reasoning
effort and tool use.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-02 17:28:12 -08:00
Devin FoleyandPaperclip 6e340a3f96 Verify onboarding models and explain provider failures (#23563)
Verify deployment-configured model preferences with the selected account.
Preserve structured provider failures and show descriptive messages for known
causes through the existing onboarding error display. Keep the existing failure
buttons, account binding, and retry/sign-in behavior.

Validation: UI typecheck, 38 focused tests, four browser journeys, all applicable
CI checks, and Greptile 5/5 with no unresolved review comments.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-12-02 16:47:58 -08:00
Nicky LeachandPaperclip cc2e1d9d43 Honor plugin task driver concurrency defaults on hire (#23535)
## Thinking Path

> - Paperclip schedules work for agents.
> - Each agent has a limit on simultaneous runs.
> - A task driver can provide an execution environment with its own
capacity.
> - Previously the creation form sent the same limit for every driver.
> - A driver can now declare the value Core saves when a new agent has
no explicit limit.

## Linked Issues or Issue Description

**Subsystem affected**

Agent hiring and plugin environment drivers.

**Current behavior**

The create form, API, and import flow supply the global concurrency
default before the task driver can provide one.

**Proposed behavior**

Let each task driver declare an optional per-agent concurrency default.
Apply it once during hire and honor explicit agent limits.

## What Changed

- Refreshed the three SDK source pins for the changed files.
- Added the optional driver field `defaultMaxConcurrentRuns` with
integer bounds from 1 through 50.
- Applied it during hire using the resolved task environment. Saved the
resolved runtime configuration in hire approvals.
- Removed early defaults from the creation form, routes and new-agent
imports. Preserved saved limits on export, including explicit values
equal to the global default. Kept the current limit when importing an
update with an omitted limit.

## Verification

- [Full PR
CI](https://github.com/paperclipai/paperclip/actions/runs/47000023360)
passed on `83cce42b9a`. Server shard 16 passed on retry after a
PostgreSQL connection reset on the first attempt.
- `pnpm -r typecheck` passed. The SDK source pin check passed. `pnpm
verify` selected broad CI coverage because the SDK input registry
changed.
- On rebased commit `83cce42b9a`, all 441 tests in six focused Vitest
suites passed, including the MCP rollback test corrected in #23560. The
SDK source pin check passed.

## Risks

This affects new hires on drivers that opt in. Existing agents retain
their saved configuration. Single-run provider limits still apply. An
older client that explicitly sends the global default will keep that
value.

## Model Used

OpenAI GPT-6 via Codex. Used local source inspection, code editing,
TypeScript and test execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-02 16:23:42 -08:00
DottaandPaperclip d5c22b8424 fix(ui): skip Step 3 early setup draft in free_inference_1 and ignore setup drafts in paused banner (#23555)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - In the `free_inference_1` onboarding flow, `OnboardingWizard` skips
Step 4 ("Connect a model") and hires the first agent directly on starter
inference when the user submits Step 3.
> - However, Step 3's early-setup effect still auto-created a
provisional `General` draft agent (`pauseReason: "setup"`, `adapterType:
"process"`) as soon as Step 3 mounted, even though Step 4 login is never
used in `free_inference_1`.
> - If the user reloaded or navigated to the Dashboard before submitting
Step 3, that orphaned `pauseReason: "setup"` draft prevented onboarding
from re-opening and caused `Dashboard.tsx` to show "All agents in this
organization are paused — nothing will run."
> - This pull request skips Step 3 early-setup draft creation while
`free_inference_1` is active (or while the onboarding variant/status
queries are still pending) and filters out unfinished `pauseReason:
"setup"` drafts and terminated agents in
`Dashboard.derivePausedAgentBanner` and `hasNoAgents`.
> - The benefit is a clean `free_inference_1` onboarding experience with
no orphaned paused drafts and accurate Dashboard empty-state banners.

## Linked Issues or Issue Description

**Subsystem affected**

`ui/` — React + Vite board UI

**Problem or motivation**

When a Cloud workspace is assigned to `free_inference_1`, opening Step 3
of `OnboardingWizard` immediately created an unfinished `General` draft
agent (`pauseReason: "setup"`, `adapterType: "process"`) meant only for
Step 4 provider login. Navigating to `/dashboard` before clicking "Start
chatting" left that orphaned draft in place and triggered the "All
agents in this organization are paused — nothing will run." warning
banner.

**Proposed solution**

- Add `shouldSkipEarlyOnboardingSetupDraft` in
`ui/src/lib/cloud-trial-gate.ts` and gate `OnboardingWizard`'s Step 3
early-setup effect on `!shouldSkipEarlyOnboardingSetupDraft({
isFreeInferenceOnboarding, onboardingVariantPending })`.
- Update `derivePausedAgentBanner` and `hasNoAgents` in
`ui/src/pages/Dashboard.tsx` to ignore unfinished `pauseReason: "setup"`
drafts and `terminated` agents.
- Add unit tests in `ui/src/pages/Dashboard.test.ts` and
`ui/src/components/CloudTrialGate.test.tsx`.

**Alternatives considered**

- Deleting the setup draft on wizard unmount was ruled out because
browser reloads or tab closes do not reliably run unmount cleanup, and
`free_inference_1` never needs a Step 3 setup draft in the first place.

## What Changed

- `ui/src/lib/cloud-trial-gate.ts`: Added
`shouldSkipEarlyOnboardingSetupDraft`.
- `ui/src/components/OnboardingWizard.tsx`: Tracked
`onboardingVariantPending` (`onboardingSessionPending` /
`cloudTrialStatusPending`) and gated the Step 3 early-setup draft
creation effect so `free_inference_1` never creates a provisional
`General` (`pauseReason: "setup"`) draft.
- `ui/src/pages/Dashboard.tsx`: Excluded `pauseReason: "setup"` drafts
and `terminated` agents from `derivePausedAgentBanner` and
`hasNoAgents`.
- `ui/src/pages/Dashboard.test.ts` &
`ui/src/components/CloudTrialGate.test.tsx`: Added unit test coverage.

## Verification

- `pnpm --filter @paperclipai/ui typecheck` (0 errors)
- `pnpm exec vitest run ui/src/pages/Dashboard.test.ts
ui/src/components/CloudTrialGate.test.tsx
ui/src/lib/onboarding-auto-open.test.ts` (24/24 passed)

## Risks

- Low risk: `baseline` onboarding behavior is unchanged once
`onboardingSession` resolves (a cached session query already loaded by
the app shell), and `Dashboard` still shows the all-paused banner
whenever real hired agents are paused.

## Model Used

- Google Gemini (Antigravity agentic coding environment with tool use
and local Vitest + TypeScript verification)

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-02 16:30:22 -06:00
Dotta 86927d4933 feat(cloud-trial): enable fast responses by default with starter inference key (#23556)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Fast responses send a brief acknowledgement in the agent's voice
while the full agent run starts.
> - During Cloud starter-inference onboarding (`free_inference_1`),
users start chatting immediately before connecting their own model
provider, so no `company_fast_responses` connection exists yet.
> - Without a default fast-response path, the first chat waits silently
while the Runner starts up and thinks.
> - This pull request enables fast responses by default while Cloud
starter inference is active, routing acknowledgements through the
server-held OpenRouter starter key with `$1` quota and `llmBlocked` gate
enforcement.
> - The benefit is immediate, responsive first-chat acknowledgements out
of the box with a clean handoff once the user connects their own model
provider.

## Linked Issues or Issue Description

Refs #23401, #23427

**Summary**
Enable fast-response acknowledgements by default for companies running
on active Cloud starter inference (`free_inference_1`), using the
existing server-side OpenRouter starter inference key.

**Problem Statement**
Fast responses currently require both the experimental
`enableFastResponses` instance flag and an explicit shared API
connection in `company_fast_responses`. New Cloud starter-inference
workspaces have no saved API connection yet, so users do not get fast
acknowledgements during their initial onboarding chat.

**Proposed Solution**
Fall back to the server-side Cloud starter inference OpenRouter key
(`FAST_RESPONSE_DEFAULT_MODEL`, `openai/gpt-oss-120b`) when a company
has no `company_fast_responses` row and is actively on trial-only
inference without a blocked gate. Respect explicit company
configuration/opt-out, enforce `responsibleUserId` and `issue:read`
authorization, disallow sponsored webhooks on the starter key, mark the
trial exhausted on HTTP 402/limit errors, and stop using the starter key
automatically once the user connects their own model provider.

## What Changed

- `server/src/services/cloud-trial-proxy.ts` &
`server/src/services/cloud-trial-inference.ts`: Added
`isCloudTrialFastResponseEligible` and `prepareCloudTrialFastResponse`.
Keeps the raw OpenRouter key strictly in server process memory, enforces
`isCompanyOnTrialOnlyInference`, the `$1` quota, and the
`work_requires_model` / `exhausted` gates, wraps `fetch` to call
`markExhausted` immediately on HTTP 402/limit responses, and probes
usage on cleanup.
- `server/src/services/fast-responses.ts`: Updated
`enqueueFastResponse`, `fastResponseSourceCurrent`, `settings`,
`availability`, `resolve`, `process`, and `history` to use Cloud starter
inference by default when no `company_fast_responses` row exists and
starter inference is active and unblocked. Explicit
`company_fast_responses` rows (including opt-out `enabled: false`)
always take precedence, and connecting a user model provider cleanly
ends starter-key usage.
- `packages/shared/src/fast-response.ts`: Added optional
`usingCloudTrialDefault?: boolean` to `FastResponseSettings`.
- `server/src/__tests__/fast-responses.test.ts`: Added regression tests
covering starter-inference default fast responses (even when
`enableFastResponses` is `false`), raw key non-leakage,
`work_requires_model` gate blocking, HTTP 402 exhaustion, explicit
opt-out, and clean handoff after connecting a user model provider.

## Verification

- `pnpm --filter @paperclipai/shared typecheck` — passed (0 errors).
- `pnpm --filter @paperclipai/server typecheck` — passed (0 errors).
- `pnpm --filter @paperclipai/server exec vitest run
src/__tests__/fast-responses.test.ts
src/__tests__/cloud-trial-inference.test.ts` — passed (44/44 tests).

## Risks

- Low risk. No database schema migration is required
(`fast_response_requests.connection_id` and `grant_id` are already
nullable). Self-hosted instances and `baseline` Cloud stacks are
unaffected because `trialInferenceEnabled` is `false`. Companies that
explicitly configure or disable `company_fast_responses` or connect
their own AI provider never fall back to the starter key.

## Model Used

- Google Gemini (Antigravity agentic runtime, thinking mode with tool
use and local code execution).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-12-02 16:29:41 -06:00
Devin FoleyandPaperclip 34389a7921 Keep onboarding agent timer heartbeats disabled (#23552)
## Thinking Path

> - Paperclip manages agents and their work.
> - Onboarding hires the first agent in a company.
> - Normal new-agent settings disable timer heartbeats.
> - The onboarding hire path overrides that setting and enables a
five-minute timer.
> - This change makes onboarding use the normal settings and preserves
saved policy when reconnecting an existing agent.
> - New hires keep on-demand wakes without an unwanted timer.

## Linked Issues or Issue Description

**What happened?**

Completing first-agent onboarding sends `heartbeat.enabled: true` with a
300-second interval. This differs from other new-agent paths. The
enabled timer can prevent idle sleep even when the selected runtime does
not execute unscoped timer heartbeats.

**Expected behavior**

First-agent onboarding must use the normal disabled timer default.
On-demand wakes must stay enabled. Reconnecting an existing agent must
preserve its saved policy.

**Steps to reproduce**

1. Create a company and complete first-agent onboarding.
2. Inspect the hire request's runtime configuration.
3. Before this change, its timer is enabled. After this change, it is
disabled.

## What Changed

- Use the normal new-agent runtime configuration for onboarding drafts
and hires.
- Keep the existing agent's runtime policy when reconnecting it.
- Test new hires, restored drafts, existing policy, and on-demand wakes.
- Document the default. The large wizard only changes its helper and
call sites; the merge logic and tests stay in the small runtime-config
module.

## Verification

- `pnpm exec vitest run ui/src/lib/new-agent-runtime-config.test.ts
ui/src/lib/onboarding-state.test.ts`: 10 tests passed.
- `pnpm --filter @paperclipai/ui typecheck`: passed.
- `pnpm verify`: selected 2,317 test files. An unrelated CPU timing
assertion failed in `server/src/event-loop-stall-monitor.test.ts`; the
broad run was then stopped (exit 130). This is not a passing full-suite
claim. Required CI must pass for the final head.
- [Full CI
run](https://github.com/paperclipai/paperclip/actions/runs/46974544702)
is green on final head `913daa0d0ff`, including the rerun of jobs
interrupted by runner shutdown. Greptile is 5/5 on that same head, with
no unresolved comments or merge conflicts.
- `git diff --check`: passed. Reviewed and scanned the diff for secrets,
private URLs, personal data, and infrastructure identifiers.

## Risks

Low risk. New hires now match the established new-agent default.
Existing agent settings stay intact during reconnection. No database
schema or scheduler changes. Existing records require a separate, scoped
data repair.

## Model Used

OpenAI Codex, `gpt-6.1-sol`, xhigh reasoning effort, with local code and
test tools.

## Checklist

- [x] Included project context and the problem
- [x] Specified the model used
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] Described the bug with the issue-template labels
- [x] Kept internal issue links and operational identifiers out of this
public PR
- [x] Used a descriptive branch name
- [x] Focused tests and UI typecheck pass; the interrupted broad run is
disclosed above
- [x] Added regression coverage and updated documentation
- [x] Documented risks
- [x] All required CI gates are green
- [x] Greptile is 5/5 with no unresolved comments
- [x] Will address review findings before requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-02 13:41:34 -08:00