Commit Graph
1774 Commits
Author SHA1 Message Date
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
Tonio 3d0e0b6dd9 Unify provider sign-in and access controls in Connect account (#23551)
## Thinking Path

> - Paperclip manages work for AI agents.
> - Agents use provider accounts.
> - People connect those accounts in a dialog.
> - Other Models uses a second heading and a separate sign-in action.
> - Reusing the wizard card puts provider instructions and sign-in
controls together.

## Linked Issues or Issue Description

Related PR: #23474.

**What happened?**

Other Models shows duplicate headings and nested access controls.

**Expected behavior**

Show one heading, a full-width provider card, and an access disclosure
below the credentials.

**Steps to reproduce**

Open Connect account, choose Other Models, select xAI, and expand
Change.

## What Changed

Use the wizard sign-in card for subscription providers. Move access
settings below the credentials. Flatten the disclosure and show Done
when it is open.

## Verification

All 35 focused AgentProviderConnection and AdapterLoginChrome tests
passed.

## Risks

Browser redirect and code-based providers use different credential
fields.

## Model Used

OpenAI GPT-6, via Codex.

## Checklist

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

Co-Authored-By: Scott Tong <scott@scotts-mbp-m5-max.local>
2026-12-02 12:05:16 -08:00
scotttongandScott Tong c655f38b72 Fix mobile scrolling inside chat and task cards (#23538)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - People review pending requests in agent chats and tasks.
> - The request card sits above the composer in both views.
> - On mobile, a long card can extend beyond the visible screen and
cannot scroll.
> - This pull request limits the card height to part of the visible
viewport.
> - People can scroll the card to read the details and reach its
buttons.

## Linked Issues or Issue Description

Fixes: #21626

## What Changed

- Give mobile composer takeover cards their own vertical scrolling and
contain their scroll at the edges.
- Size the mobile card against the visible chat viewport, including when
the keyboard shrinks it. Keep the desktop limit and Inbox behavior
unchanged.
- Add browser regression tests for touch scrolling through a long
confirmation card in Chat and Tasks.

## Verification

- On master at `4db307d53c`, both regressions reproduced at 390 × 664
with emulated touch. The card extended past the viewport and a swipe did
not move its scroll position.
- Both patched Chromium regressions passed. A touch swipe scrolled the
card, and subsequent swipes brought the approval button into view.
- `pnpm --filter @paperclipai/ui typecheck` passed.
- The isolated mobile preview also loaded the Inbox without changing it.
Physical iPhone and keyboard testing were not performed.

## Risks

- Low risk. The change is limited to the shared composer card layout and
does not change how requests are accepted or stored. The composer is
already above the 1,000-line threshold; changing its existing card
classes keeps the fix local.
- A long card uses part of the available height, so its contents scroll
instead of pushing the controls offscreen.

## Model Used

- OpenAI GPT, in Codex with repository and Chromium 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: #123` /
`Closes #123` / `Refs #123` 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: Scott Tong <1504818+scotttong@users.noreply.github.com>
2026-12-02 11:25:44 -08:00
Nicky LeachandClaude Opus 5.5 c31197f89f fix(onboarding): stop re-preparing an agent when a save reorders its configuration keys (#23440)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Onboarding signs the first agent in to Claude or Codex through a
plugin-managed execution environment that is prepared for the agent
(#23312, #23383)
> - Core prepares that environment again whenever the draft's execution
configuration changes, and refuses a sign-in while it does
> - Core detected a change with `JSON.stringify`, so the same
configuration saved with its keys in a different order counted as a
change. Postgres `jsonb` returns keys in its own order, so an onboarding
save of the same choice could re-prepare the environment
> - The wizard held sign-in readiness per harness only, so after such a
re-preparation it still treated the environment as ready and started a
sign-in that Core refused
> - This pull request compares configuration independent of key order,
and holds readiness per harness and model
> - The benefit is that re-picking the saved choice keeps the prepared
environment and signs in at once, and a real change waits for its
preparation instead of failing

## Linked Issues or Issue Description

Refs #23312 and #23383.

**What happened?**

With a plugin-managed execution environment as the instance default, the
onboarding agent was already prepared for Claude (`verifying`). Picking
Claude again saved the same configuration. Core moved the agent back to
`preparing` and bumped its lifecycle version, and the wizard started a
sign-in at once. Core returned `400 login_agent_unavailable` and the
card showed that error.

**What did you expect to happen?**

Saving an unchanged configuration leaves the prepared environment alone,
and the sign-in starts.

**Steps to reproduce**

1. Make a plugin-managed execution environment that prepares an
environment per agent the instance default.
2. Start onboarding, choose Claude with a subscription, and wait until
the environment is prepared.
3. Reload onboarding and pick Claude again.
4. See the sign-in fail with the message above.

## What Changed

- Agent configuration comparison (`jsonEqual`) uses canonical JSON with
sorted keys. This covers the lifecycle's re-preparation check, the
changed-field check for configuration patches, and the changed fields
recorded in configuration revisions. A save that only reorders keys no
longer re-prepares the agent or records a revision field change.
- Onboarding holds sign-in readiness per selected harness and model, so
a model change waits for the preparation it causes.

## Verification

- `pnpm --filter @paperclipai/server typecheck` and `pnpm --filter
@paperclipai/ui typecheck`: no errors.
- `server`: the agent lifecycle, configuration save and configuration
revision suites pass (97 tests). The lifecycle test now saves the same
runtime configuration with its keys reversed and asserts the lifecycle
version does not change. That assertion fails without the comparison
change (`expected 3 to be 2`).
- `ui`: the sign-in readiness hook suite passes (4 tests). It already
covers a hold-key change waiting for the new preparation.
- I reproduced the failure in a running instance and read it from the
network log. I did not repeat that sign-in with this change. CI runs the
full suites and end-to-end tests.

## Risks

- Comparisons that previously reported a key-order-only difference as a
change now report none. Every caller wants value equality, so this
removes spurious re-preparations and revision entries.
- No migration and no API change.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), with extended thinking and tool
use (code search, shell, tests, browser network inspection) in Claude
Code.

## Checklist

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

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 07:32:27 -08:00
Tonio 2bef9e3a80 Keep Connect account steady when switching credential methods (#23480)
## Thinking Path

> - Paperclip manages work for AI agents.
> - Agents use provider accounts.
> - People connect those accounts in a dialog.
> - Switching methods can move the controls.
> - A shared minimum panel height keeps the footer steady.

## Linked Issues or Issue Description

Related PR: #23474.

**What happened?**

The API key panel used less space than the subscription panel.

**Expected behavior**

Changing methods keeps the dialog height steady.

**Steps to reproduce**

Open Connect account and switch from subscription to API key and back.

## What Changed

Apply a common minimum height to credential cards inside Connect
account.

## Verification

All 10 AgentProviderConnection component tests passed. Compare both
directions in the staging dialog.

## Risks

Long instructions or additional controls can still grow beyond the
minimum height.

## 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-02 09:00:36 +00:00
Tonio 28c44fa2a1 Use in-panel OpenAI sign-in from Other Models (#23474)
## Thinking Path

> - Paperclip lets people connect provider accounts for agent work.
> - The Connect account dialog includes a provider grid.
> - OpenAI subscription setup from that grid still uses the footer to
start sign-in.
> - This change uses the same sign-in panel as direct OpenAI setup.
> - People can see when authorization is pending and when they can
proceed.

## Linked Issues or Issue Description

**Subsystem affected**

Agent settings and managed AI accounts. Related change: #23361.

**Current behavior**

OpenAI under Other Models presents a sign-in hyperlink and repurposes
the footer during authorization.

**Proposed behavior**

Start device authorization from the panel. Show Waiting… there and keep
Next disabled while authorization is pending.

## What Changed

- Enable inline subscription controls for OpenAI when opened from the
provider grid.
- Exercise the grid presentation in the sign-in panel tests.

## Verification

- All 33 focused agent connection and sign-in panel tests passed.
- Open Connect account, select Other Models, select OpenAI, and click
Sign in.

## Risks

The changed path shares completion handling with direct subscription
setup. Provider authentication and access settings still use the same
APIs.

## Model Used

OpenAI GPT-6 through Codex with local editing, terminal tests, 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)
- [ ] 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
2026-12-01 23:57:07 -08:00
Nicky Leach 5a956b724b fix(agents): set agents up again when their environment driver changes (#23449) 2026-12-01 23:33:24 -08:00
Nicky LeachandPaperclip 54b86a6af2 Allow New Agent sign-in during computer preparation (#23435)
<!-- Write all pull request text in Simplified Technical English
(ASD-STE100): short sentences, one instruction per sentence, simple
approved vocabulary, and the active voice. -->

## Thinking Path

> - People use Paperclip to set up agents for work.
> - New Agent lets a user connect a provider account.
> - A plugin can host that sign-in on a sandbox or an eligible computer.
> - The form disabled sign-in while the draft agent's computer prepared.
> - This change enables sign-in when its host is ready.
> - The user can connect the account while the task computer prepares.

## Linked Issues or Issue Description

**What happened?**

New Agent disabled the sandbox sign-in controls while the draft computer
prepared. A ready computer in the same task environment could also be
overlooked.

**Expected behavior**

The user can sign in on an eligible host while task preparation runs. A
connection test that uses the draft computer waits for it.

**Steps to reproduce**

Open New Agent with a draft computer in preparation. Select a harness
that supports sandbox sign-in. The login panel opens with its controls
disabled.

**Additional context**

Related to #23425, which added login driver preferences.

## What Changed

- Separate readiness of the Connect step from readiness of the draft
computer.
- Allow the user to request an available computer in the same
environment for sign-in.
- Keep connection tests, keyboard submission of credentials, and setup
completion behind the task computer readiness check.
- Document the behavior and cover both login hosts in the rendered New
Agent flow.

## Verification

- Reproduced the disabled sandbox control and the unavailable fallback
action in failing regression tests. Both passed with the fix.
- The UI typecheck passed. All 18 focused provider sign-in and host
readiness tests passed.
- The selected local UI suite passed 4,152 tests with one skip. The
broader local verification run failed in four CLI test files on macOS.
These included embedded Postgres shared-memory exhaustion, a loopback
expectation on a Tailscale host, and headless-board CLI failures. Final
[GitHub Actions
CI](https://github.com/paperclipai/paperclip/actions/runs/46785144221)
passed.
- Live provider sign-in was outside the scope of this UI test.

## Risks

Low risk. The UI uses the existing company capability response. Core
still checks the selected host when sign-in starts. The change touches
the existing setup components because they own the Connect controls and
the task readiness checks.

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

## Model Used

OpenAI Codex (GPT-6) with local code inspection, TypeScript checks, 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
- [ ] 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 01:20:17 +00:00
Nicky LeachandPaperclip 550d8fc576 feat(plugins): honor harness login driver preferences (#23425)
## Thinking Path

> - People use Paperclip to manage agents and the accounts they use.
> - A harness can sign in on an environment supplied by a plugin.
> - Some plugins offer several environments with different login
requirements.
> - Today the task environment also determines where sign-in runs.
> - This change lets the plugin declare its preferred login drivers.
> - A company can use a temporary environment for sign-in and keep
running tasks on its chosen computer.

## Linked Issues or Issue Description

**Subsystem affected**

Plugin manifests, login target selection, and the harness sign-in UI.

**Current behavior**

A plugin with several environments cannot direct sign-in to a preferred
driver. Selecting an agent computer for tasks can require an agent even
when a temporary environment is available for login.

**Proposed behavior**

Allow the manifest to declare an ordered list of login drivers. Select
the first eligible environment for the company and harness before
starting a login.

**Reason and benefit**

A plugin can offer agentless sign-in first and keep an agent-targeted
computer as a fallback. The choice applies only to sign-in.

**Additional context**

This builds on the agentless login capability in #23392.

## What Changed

- Validate ordered login driver keys in the manifest and expose the
eligible environments to the company.
- Use the same selection rule for device login, setup-token login,
onboarding, agent configuration, and AI Connections.
- Bind the session and lease to the selected environment. Existing agent
eligibility checks apply when the target needs an agent.

## Verification

- Server and UI typechecks passed. Focused Vitest runs covered shared
manifest validation, driver order, the company access boundary, lease
checks, both HTTP login flows, and the UI helpers.
- The public SDK source input registry was regenerated. The registry
change requires broad CI coverage under `pnpm verify`.
- Regression tests cover skipping an environment without an eligible
computer, using a newly prepared draft computer, and holding the
selected host across capability and readiness updates during sign-in.
The UI typecheck and all 16 focused login tests passed on the final
commit.
- No external provider credentials were used.

## Risks

A plugin that opts in must declare at least one usable driver for the
user's harness and company. If none qualifies, the start fails before
acquisition. Manifests that omit the field keep their existing routing.
There is no database migration.

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

## Model Used

OpenAI Codex (GPT-6), with local code inspection, TypeScript checks, 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-01 16:58:28 -08:00
Nicky LeachandPaperclip 828b8c2a2a Hide background GitHub authorization until a project has a private repository (#23421)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Project settings let a project editor manage GitHub repositories.
> - The settings page offers a GitHub credential for background
repository work.
> - Projects with only public repositories or no repositories also see
the consent form.
> - This pull request shows the form when a saved repository is known to
be private.
> - The form disappears when the editor removes the last private
repository.

## Linked Issues or Issue Description

**What happened?**

Project settings showed Background GitHub authorization for every
project.

**Expected behavior**

Show the section only while the project has a private GitHub repository.

**Steps to reproduce**

Open settings for a project with no repositories or only public
repositories. The authorization form appeared on master.

**Paperclip version or commit**

Reproduced at `07af22c57f`. The original authorization form shipped in
#17798.

## What Changed

- Reuse the repository picker’s catalog query to check visibility for
saved workspace URLs. Fall back to saved visibility when it belongs to
the same URL.
- Mount the consent form and load its authorization data only when a
saved repository is private.

## Verification

- The UI typecheck and all three authorization component tests passed
locally on macOS at `d5332c47a5`. The tests cover legacy Git URLs and
bound catalog reads across repeated renders with 502 repositories. The
regression tests failed before their fixes.
- GitHub CI passed the typecheck, build, selected tests, and browser
shards for the same commit. [CI
run](https://github.com/paperclipai/paperclip/actions/runs/46757316515)
- Before the rebase, the UI typecheck and all 249 selected UI test files
passed. The broader local verifier failed in CLI tests, including
embedded Postgres startup, CLI profile selection, and the tailnet bind
address.

## Risks

- A repository with unknown visibility keeps the section hidden until
the catalog or saved metadata confirms it is private.
- Removing the last private repository hides the revoke button along
with the form. The existing grant stays in place.

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

## Model Used

OpenAI Codex (GPT-6), with repository editing, shell execution, and
local test tools.

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-01 22:24:35 +00:00
DottaandPaperclip 3df59a1853 Unify Antigravity runtime and remote /swarm onto agy acp 1.5.19 (#23168)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The Paperclip Runner executes Google Antigravity agents on local
hosts and remote sandboxes
> - Previously, Paperclip shipped two separate Google runtimes: an 853
MiB IDE-extension ACP bundle (`agy_acp_server.par` 1.5.2 +
`localharness_external` + Python admission monkey-patch) for ordinary
turns and a separate `agy` 1.5.15 CLI binary for local-only `/swarm`
turns
> - Because the legacy server lacked `/swarm` and the CLI path refused
remote targets and required macOS Keychain or Linux user namespaces
(`auto` mode), remote sandboxes could not run `/swarm` and carried 853
MiB of legacy binaries
> - This pull request unifies all Antigravity surfaces (ordinary turns,
`/swarm`, interactive sign-in, and model discovery) onto one pinned
`agy` 1.5.19 CLI binary (`1.5.19-4821414830800896`) with file-backed
OAuth isolation (`AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1`) and
`--dangerously-skip-permissions` support for remote sandboxes
> - The benefit is one 268 MiB Linux binary instead of 853 MiB (saving
~585 MiB in remote images), no Python runtime monkey-patching, full
`/swarm` support on both local and remote hosts, and a unified 25-model
catalog including Gemini 4 Neon, Carbon, Hydrogen, and Argon

## Linked Issues or Issue Description

**What existing behavior does this improve?**
The Google Antigravity Runner driver, provider pack materialization,
Google sign-in flow, model discovery, and `/swarm` execution in
`packages/paperclip-runner`, `packages/shared`, `server`, and `ui`.

**Subsystem affected**
Cross-cutting (multiple of the above)

**Current behavior**
Ordinary Antigravity turns use the legacy 1.5.2 IDE-extension ACP server
(`agy_acp_server.par` + `localharness_external` + Python monkey-patch)
at ~853 MiB on `linux-x64`. Native `/swarm` turns require a separate
`agy` 1.5.15 CLI binary, refuse remote execution targets
(`input.remote`), and fail on Linux sandboxes without user namespaces
(`auto` mode).

**Proposed behavior**
All Antigravity flows use one pinned `agy` 1.5.19 binary
(`1.5.19-4821414830800896`, ~268 MiB on `linux-x64`) across all four
platforms (`darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`).
Ordinary turns speak ACP directly through `openAntigravityAcpRuntime`.
Both ordinary and `/swarm` turns stage file-backed OAuth tokens under
`<agentHomeDirectory>/antigravity-cli/antigravity-oauth-token` with
`AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1`, isolate from host keychains, and
allow `/swarm` on remote targets using `--dangerously-skip-permissions`.
Interactive Google sign-in runs `agy acp --login` with
`https://antigravity.google/oauth-callback`, pre-creates
`<home>/antigravity-cli` with mode `0700`, and prompts for the
authorization code in the UI.

**Reason and benefit**
Unifying onto `agy` 1.5.19 cuts the `linux-x64` provider-pack footprint
by ~585 MiB, removes Python bytecode patching from materialization,
enables `/swarm` in headless Linux sandboxes without user namespaces or
D-Bus, and aligns ordinary turns, model discovery, and `/swarm` on the
same 25-model catalog.

**Breaking changes**
- `acpx-profiles.json` bumps `antigravity` to `agentProfileVersion: 3`
(`native:antigravity-cli`, version `1.5.19`). Existing saved legacy
1.5.2 sessions fail closed as incompatible saved state and start fresh
cleanly.
- Existing Google OAuth connections carrying `client_secret` remain
fully backward-compatible; new `agy acp --login` connections store
canonical credentials with `auth_method: "consumer"` and no
`client_secret`.

## What Changed

- Pin `agy` `1.5.19-4821414830800896` across all four platforms
(`darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`) in
`antigravity-distributions.json`, `antigravity-cli-distributions.json`,
`antigravity-cli-pins.ts`, and `acpx-profiles.json`
(`agentProfileVersion: 3`), and regenerate TypeScript and Rust profile
artifacts.
- Replace ZIP + Python patch materialization with strict single-member
`tar.gz` verification (`materialize-antigravity-distribution.mjs`,
`provision-antigravity.mjs`, `probe-antigravity-metadata.mjs`,
`candidate-provider-pack.mjs`, `release-provider-pack.mjs`).
- Regenerate `packages/shared/src/antigravity-models.generated.ts` from
`agy` 1.5.19 (25 models across 8 families, including Gemini 4 Neon,
Carbon, Hydrogen, and Argon) and update
`packages/shared/src/antigravity-models.ts` and
`tests/runner-e2e/antigravity-qualification-cases.ts` for `xhigh`
thinking levels.
- Add direct ACP runtime
`packages/paperclip-runner/src/drivers/acpx/antigravity-acp-runtime.ts`
(`openAntigravityAcpRuntime`) for ordinary Antigravity turns with OAuth
and `GEMINI_API_KEY` support, `session/new` + `session/resume`,
`readOnly`/plan mode enforcement, HTTP and stdio MCP forwarding, live
`setModel`, slash-command neutralization, refusal classification,
cancellation, and lineage retirement; route ordinary Antigravity turns
unconditionally in `acpx-runtime-adapter.ts` without an ACPX fallback
seam.
- Update `antigravity-auth.ts`, `antigravity-credentials.ts`,
`antigravity-models.ts`, `antigravity-process.ts`, `runtime-host.ts`,
and `runtime-sandbox.ts` to run `agy acp --login`, pre-create
`<home>/antigravity-cli` with mode `0700` (preventing Go `os.MkdirAll`
`0755` readback failures), force file-backed token storage
(`AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1`), align `--gemini-dir` with
`agentHomeDirectory`, bound model-discovery token sync cleanup, and
scrub live CLI token files on cleanup.
- Enable remote `/swarm` by removing the `input.remote` refusal in
`server/src/services/antigravity-swarm.ts` and allowing
`--dangerously-skip-permissions` + `default` mode in
`antigravity-swarm-route.ts`, `antigravity-swarm-guard.ts`, and
`antigravity-swarm-runtime.ts` when `permissionMode === "approve-all"`.
- Update `ui/src/components/AdapterLoginChrome.tsx` copy to prompt for
an authorization code (`Submit code`) for
`https://antigravity.google/oauth-callback` while preserving callback
URL handling for loopback redirects.
- Add unit tests for `openAntigravityAcpRuntime`, direct Antigravity
routing, `0700` token directory pre-creation, and hosted
authorization-code login UX, and update Runner, script, shared, server,
Rust, UI, and runner-e2e test suites for `agy` 1.5.19.

## Verification

- Runner driver tests: `vitest run` across Antigravity driver test files
(`antigravity-auth.test.ts`, `antigravity-models.test.ts`,
`antigravity-acp-runtime.test.ts`, `antigravity-swarm-route.test.ts`,
`codex-credentials.test.ts`, `acpx-runtime-adapter.test.ts`,
`candidate-admission.test.ts`, `native-distribution-integrity.test.ts`)
— all passing.
- Runner script tests: `node --test` across all 7 Antigravity &
provider-pack script suites — 98/98 passed.
- Shared, UI, Server, and runner-e2e tests:
`antigravity-models.test.ts`, `AdapterLoginChrome.test.tsx` (23/23),
`antigravity-thread.test.tsx`, 23 server Antigravity/provider-pack
suites, and 7 `runner-e2e` Antigravity suites — all passing.
- Rust tests: `cargo test --manifest-path
packages/paperclip-runner/runner/Cargo.toml --locked -p
paperclip-runner-core -- acpx antigravity` — 145/145 passed.
- Typechecks & generators: `@paperclipai/shared`,
`@paperclipai/paperclip-runner` (TS + Rust), `@paperclipai/server` (all
layers), `@paperclipai/ui`, `generate-acpx-profiles.mjs --check`,
`generate-antigravity-models.mjs --check` — all passing.
- Live E2E against real pinned `agy` 1.5.19 binaries (macOS
`darwin-arm64`, headless Linux `linux-arm64` Docker with `--security-opt
no-new-privileges`, and a live remote test deployment):
- Verified `materialize-antigravity-distribution.mjs` on all 4 platform
archives and `probe-antigravity-metadata.mjs` on macOS and headless
Linux Docker.
- Verified live Google OAuth sign-in end-to-end via `agy acp --login` +
`https://antigravity.google/oauth-callback` authorization code exchange
on a live remote deployment, creating a working Antigravity connection.
- Verified `stageManagedAntigravityCredential` +
`AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1` file-backed isolation and cleanup
scrub on macOS and headless Linux Docker.
- Verified live `openAntigravityAcpRuntime` ordinary turn + HTTP MCP
tool call + `_meta.antigravity.systemPrompt.append` +
`setModel(gemini-4-argon-low)` + `session/resume` on real `agy` 1.5.19.
- Verified live `openAntigravitySwarmRuntime` `/swarm` turn with
`--dangerously-skip-permissions` spawning a real helper, writing
workspace file, calling `paperclip_finish`, and retiring cleanly.

## Risks

- **Coordinated Cloud deployment**: Remote sandboxes use the companion
transition-safe Cloud update to expect
`provider-assets/antigravity/linux-x64/agy`, accept `auth_method:
"consumer"` credentials without `client_secret`, and scrub
`antigravity-cli/antigravity-oauth-token`.
- **Saved session continuity**: Existing saved 1.5.2 sessions fail
closed as `ANTIGRAVITY_SAVED_STATE_INCOMPATIBLE` and start fresh cleanly
on 1.5.19.

## Model Used

- Google Gemini (Antigravity agentic coding assistant,
reasoning/tool-use/code-execution enabled)

## 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-01 22:01:25 +00:00
Dotta c0edaa21a3 feat(analytics): move onboarding funnel telemetry server-side and add granular step instrumentation (#23403)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Hosted Paperclip Cloud tracks user onboarding conversion in PostHog
across server-side events and browser events
> - Onboarding funnel events (`onboarding_opened`,
`onboarding_step_viewed`, `onboarding_step_completed`,
`onboarding_step_failed`, `onboarding_dismissed`) currently fire only
from browser `posthog-js`
> - Browser `posthog-js` loads lazily after `whenPageSettles` (up to 15
seconds), drops events captured before `startProductAnalytics`
initializes, and can be blocked by privacy extensions, causing
artificial dropoff between server-side `workspace_entry` and
`onboarding_opened`
> - Step 1 (`name_org`) is unmapped in `WIZARD_STEPS`, and
`connect_model` lacks sub-step visibility (provider selection,
credential mode switch, OAuth progress, API key submission, Cloud trial
CTA, mobile handoff)
> - This pull request routes all onboarding funnel events through a
first-party `POST /api/onboarding/telemetry` endpoint backed by
`trackCloudPostHogEvent` (`posthog-node`), preserves every existing
event name verbatim, adds granular step and sub-step instrumentation,
and fixes the pre-start queue drop in `product-analytics.ts`
> - The benefit is adblocker-proof, race-free server-side onboarding
analytics in PostHog with complete step-by-step dropoff visibility and
zero breaking changes to existing insights

## Linked Issues or Issue Description

**What existing behavior does this improve?**
Cloud onboarding funnel analytics in
`ui/src/lib/analytics/onboarding-analytics.ts`,
`ui/src/lib/analytics/product-analytics.ts`,
`ui/src/components/OnboardingWizard.tsx`, and `server/src/telemetry.ts`.

**Subsystem affected**
Cross-cutting (multiple of the above)

**Current behavior**
Onboarding funnel events fire only from browser `posthog-js`. Events
captured before `ProductAnalyticsGate` calls `startProductAnalytics` are
silently dropped, queued events are lost if the user leaves before
`/_ph/static/array.js` loads, Step 1 (`name_org`) is unmapped, and
`connect_model` sub-steps (OAuth link open, code submit, retry, abandon,
provider tile click, Cloud trial CTA, mobile desktop handoff) are not
instrumented.

**Proposed behavior**
All onboarding funnel and interaction events are sent via
`fetch("/api/onboarding/telemetry", { method: "POST", keepalive: true
})` to a board-authenticated, strictly Zod-validated Express route that
forwards them server-side to PostHog via `trackCloudPostHogEvent`.
Existing event names are preserved verbatim and removed from
`posthog-js` to guarantee a single sender per event. Pre-start browser
events in `product-analytics.ts` are also buffered until
`startProductAnalytics` runs.

**Reason and benefit**
Adblockers and browser script lazy-load races can no longer drop
onboarding funnel events. Product analytics can now separate
`workspace_entry` -> `onboarding_workspace_loaded` ->
`onboarding_opened` and pinpoint exact dropoff points on every step and
`connect_model` sub-step.

**Breaking changes**
None. Existing PostHog event names (`onboarding_opened`,
`onboarding_step_viewed`, `onboarding_step_completed`,
`onboarding_step_failed`, `onboarding_dismissed`,
`agent_chat_message_sent`) are preserved verbatim. On self-hosted
installs, `trackCloudPostHogEvent` is a no-op and the endpoint returns
`204 No Content`.

## What Changed

- Added `packages/shared/src/onboarding-telemetry.ts` (exported from
`packages/shared/src/index.ts`) with strict Zod discriminated-union
schemas (`onboardingTelemetryEventSchema`), canonical event names
(`ONBOARDING_TELEMETRY_EVENTS`), and snake_case PostHog property mapping
(`onboardingTelemetryEventToPostHogProperties`).
- Added `server/src/routes/onboarding-telemetry.ts` (`POST
/api/onboarding/telemetry`), mounted in `server/src/app.ts`, enforcing
`assertBoard(req)`, `assertCompanyAccess(req, companyId)` when
`companyId` is present, strict schema validation, and server-side
delivery via `trackCloudPostHogEvent`.
- Updated `ui/src/lib/analytics/onboarding-analytics.ts` to send all
onboarding events to `/api/onboarding/telemetry` with `keepalive: true`
(removing duplicate browser `posthog-js` sends), mapped Step 1 to
`name_org`, fixed `1 -> 3` forward step completion ordering, and added
granular capture helpers.
- Instrumented `ui/src/hooks/useAgentlessOnboardingAutoOpen.ts`
(`onboarding_workspace_loaded`),
`ui/src/components/onboarding/MobileDesktopNudge.tsx`
(`onboarding_mobile_handoff_action`), and
`ui/src/components/OnboardingWizard.tsx` (all step submissions,
back/jump navigation, Cloud trial CTA, model source selection,
credential mode switching, OAuth progress stages, API key submission,
advanced toggle, and launch click). Note: `OnboardingWizard.tsx` is an
existing large file (>1,000 lines); all schema and transport logic lives
in `packages/shared/src/onboarding-telemetry.ts` and
`ui/src/lib/analytics/onboarding-analytics.ts`, with only call-site
wiring added to the wizard.
- Fixed `ui/src/lib/analytics/product-analytics.ts` to buffer events
captured before `startProductAnalytics` runs (still bounded to 50 events
and cleared on user change).
- Added server route tests in
`server/src/__tests__/onboarding-telemetry-routes.test.ts` and expanded
`ui/src/lib/analytics/onboarding-analytics.test.tsx`.
- Updated `tests/runner-e2e/source-sdk-public-inputs.json` for the new
`@paperclipai/shared` export.

## Verification

- `pnpm --filter @paperclipai/shared build` — passed.
- `pnpm --filter @paperclipai/ui typecheck` — passed.
- `pnpm --filter @paperclipai/server typecheck` — passed.
- `pnpm vitest run
server/src/__tests__/onboarding-telemetry-routes.test.ts
ui/src/lib/analytics/onboarding-analytics.test.tsx
ui/src/lib/analytics/product-analytics.test.ts
ui/src/lib/analytics/product-analytics-events.test.ts
ui/src/components/ProductAnalyticsGate.test.tsx
ui/src/hooks/useAgentlessOnboardingAutoOpen.test.tsx` — 6/6 test files
passed (41/41 tests).
- `pnpm verify` — exited with code 2 because
`tests/runner-e2e/source-sdk-public-inputs.json` requires broad CI
coverage; relying on required CI checks for the remaining broad suites.

## Risks

- Low risk: `POST /api/onboarding/telemetry` performs no database
writes, validates all fields against a strict allowlist (enums,
booleans, bounded integers, safe regex slugs), enforces board auth and
company access, and is a no-op returning `204` on self-hosted instances.
- Browser telemetry calls swallow network failures so analytics can
never block or break onboarding.

## Model Used

- Google Gemini (Gemini 4 Neon, Medium) via Antigravity agentic coding
environment with tool use and local command execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] 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-01 21:17:54 +00:00
DottaandPaperclip 689bfd04ac feat(onboarding): add free_inference_1 onboarding flow, dual-trigger model gate, and multi-variant PostHog attribution (#23401)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - First-time Cloud users currently must connect an external AI
provider during onboarding before they can talk to their first agent.
> - Requiring provider setup up front adds friction before users
experience their first agent chat.
> - Paperclip needs a multi-variant onboarding experiment
(`onboarding-flow`) that defaults to `baseline` while allowing an
alternate `free_inference_1` path that skips the model-connection screen
and starts with capped starter inference.
> - When a trial-only workspace either exhausts its starter credit or
creates its first executable task or subtask, Paperclip must hold the
new task, prompt the user to connect a model provider, keep LLM actions
blocked if the modal is dismissed, and automatically resume held work
once a model is connected.
> - This pull request adds multi-variant onboarding resolution, PostHog
multi-variant attribution, dual-trigger connect-model gating with
restart-safe DB hydration, the `free_inference_1` UI onboarding flow,
and full-flow Storybooks.
> - The benefit is a safe, measurable onboarding experiment that leaves
`baseline` and self-hosted installs unchanged while letting opted-in
Cloud workspaces reach their first chat immediately and upgrade
seamlessly when real work begins.

## Linked Issues or Issue Description

**Subsystem affected**

Cross-cutting (`packages/shared/`, `server/`, `ui/`)

**Problem or motivation**

New Cloud users currently hit a mandatory "Connect a model" step during
onboarding before they can open their first agent chat. Existing
trial-inference gating only supported a binary flag and only triggered
on starter-credit exhaustion, not on subtask or manual task creation,
and did not track multi-variant onboarding cohorts cleanly in PostHog.

**Proposed solution**

Introduce the extensible `onboarding-flow` experiment (`baseline`
default, `free_inference_1` variant) across shared contracts, server
services, and UI:
- Resolve `onboardingVariant` from the Cloud control plane (`GET
/v1/tenant/onboarding-config`) with safe fallbacks to
`PAPERCLIP_ONBOARDING_VARIANT`, managed config, and `"baseline"`.
- In `free_inference_1`, skip Step 4 ("Connect a model") in
`OnboardingWizard`, hire the first agent on starter inference, and drop
the user straight into the first chat.
- Support a dual-trigger connect-model gate (`exhausted` and
`work_requires_model`) that holds newly created tasks/subtasks on
trial-only workspaces (hydrated from DB across restarts), returns HTTP
402 for blocked LLM chat/runs, keeps the modal dismissible while
blocking chat composers with a "Connect a model" CTA banner, and
automatically resumes held work after provider migration.
- Stamp `$feature/onboarding-flow`, `onboarding_variant`, and immutable
`initial_onboarding_variant` across server PostHog events,
`$groupidentify` (with top-level `$group_set_once`), and browser PostHog
super-properties / `identify()`.

**Alternatives considered**

- Baking per-stack experiment variants into warm-pool container config
was ruled out because warm-pool stacks must remain homogeneous until
claim time.
- Failing agent subtask creation calls on trial-only workspaces was
ruled out because it breaks the agent's first-chat experience; creating
the task in a held state and auto-resuming it after model connection
preserves user intent.

## What Changed

- **`packages/shared`**: Added `onboarding-flow` variant
constants/helpers, `CloudTrialGateReason` (`"exhausted" |
"work_requires_model"`), `CloudTrialHeldIssueSummary`, `gateReason`,
`llmBlocked`, `heldIssueIds`, `heldIssues`, `onboardingVariant`, and
`resumedIssueIds` on cloud-inference and session/browser-analytics
contracts.
- **`server/`**:
- Added Ed25519-signed `GET /v1/tenant/onboarding-config` resolution
with warm-pool claim cache invalidation and safe `"baseline"` default.
- Added dual-trigger trial gating (`exhausted` + `work_requires_model`)
with DB-backed held-issue hydration across restarts, HTTP 402 refusal
for blocked trial runs and chat sends, and automatic wake/resume of held
subtasks upon migration.
- Updated PostHog server telemetry, `$groupidentify` (top-level
`$group_set` and `$group_set_once`), `$feature_flag_called`, and
`BrowserAnalyticsConfig` to stamp `onboarding-flow` multi-variant
properties while preserving backwards-compatible `cloud-trial-inference`
properties.
- Added and updated Vitest suites covering multi-variant resolution,
PostHog attribution, held subtask creation, cold-restart hydration, LLM
run refusal, and auto-resume.
- **`ui/`**:
- Updated `OnboardingWizard` so `free_inference_1` skips Step 4
("Connect a model"), auto-hires with `cloudTrialInference: true`, and
launches straight into the first chat while leaving `baseline`
unchanged.
- Updated `CloudTrialGate` and `CloudTrialExhaustedModal` for
dual-trigger copy (`work_requires_model` vs `exhausted`), waiting
subtask pills, and dismissible modal behavior (`required={false}`).
- Added `CloudTrialBlockedBanner` and wired LLM-blocked composer
disabling + "Connect a model" CTA into `IssueDetail` / `AgentChat` and
`DashboardChatComposer`, plus status refresh on manual task creation in
`NewIssueDialog`.
- Updated `product-analytics.ts` + tests to register
`$feature/onboarding-flow` and `onboarding_variant` super-properties and
`$set_once.initial_onboarding_variant`.
- Added full-flow Storybooks
(`free-inference-onboarding-flow.stories.tsx`) covering all 7 onboarding
and gate states.

## Verification

- `pnpm --filter @paperclipai/shared typecheck && pnpm --filter
@paperclipai/server typecheck` (0 errors)
- `pnpm --filter @paperclipai/ui typecheck` (0 errors)
- 9 targeted server Vitest suites (`cloud-trial-inference`,
`cloud-posthog-config`, `cloud-posthog-browser`,
`posthog-direct-telemetry`, `posthog-direct-transport`, `auth-routes`,
`cloud-runtime-identity`, `onboarding-seed-route`,
`issue-onboarding-first-task-routes`): 196/196 passed
- 4 targeted UI Vitest suites (`CloudTrialGate.test.tsx`,
`product-analytics.test.ts`, `onboarding-analytics.test.tsx`,
`Layout.mobile.test.tsx`): 37/37 passed
- `pnpm --filter @paperclipai/ui build` and `pnpm --filter
@paperclipai/ui build-storybook`: passed
- Visually inspected Storybook renders across all 7 `free_inference_1`
states in headless Chromium via Playwright with zero page errors.

## Risks

- Low risk to existing users: `onboardingVariant` defaults to
`"baseline"` everywhere, leaving self-hosted installs and unflagged
Cloud stacks unchanged.
- No database schema migrations are required; held trial subtasks are
hydrated from existing `issues` and `toolConnections` tables on restart.
- Requires the companion `paperclip-cloud` control-plane endpoint (`GET
/v1/tenant/onboarding-config`) to activate non-baseline variants in
Cloud; falls back safely to `"baseline"` if unavailable.

## Model Used

- Google Gemini (Antigravity agentic coding environment with multi-agent
swarm, tool use, code execution, and Playwright Storybook 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-01 20:54:03 +00:00
5a9c06b315 feat(analytics): make replay work content a deployment opt-in (#22820)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Hosts can enable PostHog browser analytics and session replay
through deployment configuration.
> - Replay masks work content, which makes task and artifact flows hard
to understand.
> - Hosts must decide whether their deployment may show this content.
> - This pull request adds an explicit deployment opt-in, with work
content masked by default.
> - Eligible companies can show work content after that opt-in, while
connected-account checks and secret masking still apply.

## Linked Issues or Issue Description

No public issue exists. This change follows the enhancement template.

**What existing behavior does this improve?**

Session replay masks task descriptions, document bodies and artifact
previews. A host cannot choose to show eligible work content
independently of enabling replay.

**Subsystem affected**

Browser session replay, deployment analytics configuration, and the
authenticated session contract.

**Current behavior**

Work content stays masked in every company. Task and artifact titles
already show. PostHog project masking settings cannot override the
options supplied by the board UI.

**Proposed behavior**

Keep work content masked by default. Set
`PAPERCLIP_POSTHOG_REPLAY_WORK_CONTENT_ENABLED=1` in deployment
configuration to allow it for eligible companies. Unset, `0`, and other
values keep it masked. Browser analytics and replay must also be
enabled. A host can keep replay enabled while work content stays masked.

**Reason and benefit**

Hosts control their recording policy without editing Core source. An
eligible company's replay can show the task flow after the host opts in.

**Breaking changes**

None relative to the base branch. Self-hosted analytics remain disabled
by the existing analytics gate. Existing deployments retain work-content
masking unless they explicitly opt in. The session gains an optional
boolean and the tool connection list gains an optional `hiddenCount`
field. Missing fields fail closed.

## What Changed

- Add `PAPERCLIP_POSTHOG_REPLAY_WORK_CONTENT_ENABLED`, default off.
Resolve it in the existing server analytics configuration and send the
effective boolean as `browserAnalytics.replayWorkContentEnabled`. The
shared session schema preserves the field and accepts older servers that
omit it.
- Require both replay and the work-content opt-in before the UI queries
company sources or permits visibility. Removing the opt-in from a
refreshed session masks content even when eligible source answers remain
cached.
- Preserve the original company checks: complete tool connection and
chat endpoint lists, no Google or Slack source, no known aggregator or
router, and the selected company's route. Unknown, failed, invalidated,
or hidden source data keeps content masked. Live source changes reset
the check.
- Mark task descriptions, document bodies, attachment and artifact
previews, and file viewers as work content. Customer content, editors,
comments, chat, run output and connected-account surfaces remain masked.
Secrets remain blocked or redacted. Input and attribute values remain
masked.
- Preserve credential punctuation in task previews by reusing the shared
Markdown plain-text helper. Bound conversion to the first 2,048 source
characters, and always mask source-capped previews to protect incomplete
credentials. Scan complete command-line flag names once before
classifying secrets and reading their values. A 512 KiB hyphen input and
long flag names have regression coverage.
- Mask surfaces that show cut or rewritten work content, where the
redaction cannot work. A cut task preview masks when the text before its
180-character limit holds a credential. The document card preview (first
4,000 characters) masks when the cut changes what the redaction masks
before it. The text preview on an artifact card always masks, because
the server strips hyphens and underscores from it and cuts it at 280
characters. Quoted flag values run past escaped quotes, and flag names
can hold an underscore. An unquoted token that starts with `--` is read
as the next flag, not as a value, so `--auth
--tlsCertificateKeyFilePassword hunter2` masks `hunter2`.
- Refresh the recording once when a company's work content first becomes
visible. Keep the existing autocapture text and attribute masking.
- Add tests for deployment switches, session parsing and exposure,
disabled source requests, older servers, and withdrawal with cached
data. Retain the original masking, company, secret, and source-change
tests.
- Document configuration, rollback, restart and tab-reload steps,
residual recording risks, and the board-only `hiddenCount` API field
with absent-on-older-server semantics. Refresh the shared-source pins
with the maintained generator; runtime and compiler pins stay unchanged.

The original implementation and commits are preserved from @nguyenm7.
The deployment configuration follow-up adds the host opt-in.

When squash-merging, preserve the follow-up author's credit in the
squash commit body:

```text
Co-Authored-By: Devin Foley <devinfoley@users.noreply.github.com>
```

## Verification

Current head `2ce967f1e1`: CI has 43 checks passed and four skipped,
with none failed or pending. The Greptile review on this head is 5/5,
and both findings from its previous review are fixed. No person has
approved the pull request yet. The evidence below was recorded on
earlier heads and is kept as the record of how the change was verified.

Greptile apex review: 5/5 on `45023e6`, with no unresolved review
threads. CI on that head is green: 76 checks passed and four skipped,
with no failed or pending checks. The branch has no merge conflicts with
master.

On the final source change, locally:

- `cd ui && pnpm exec vitest run src/lib/analytics
src/context/LiveUpdatesProvider.test.ts
src/lib/markdown-plain-text.test.ts`: 10 files, 520 tests pass. The
secret-redaction cases are in `replay-secret-redaction.test.tsx`, so
`replay-masking.test.tsx` stays under 1,000 lines (701).
- `cd server && pnpm exec vitest run
src/__tests__/cloud-posthog-config.test.ts
src/__tests__/cloud-posthog-browser.test.ts
src/__tests__/auth-routes.test.ts
src/__tests__/posthog-direct-transport.test.ts`: 4 files, 124 tests
pass.
- `cd packages/shared && pnpm exec vitest run
src/validators/access.test.ts`: 22 tests pass.
- `pnpm exec vitest run -c tests/runner-e2e/vitest.config.ts
source-sdk-public-inputs`: 13 tests pass.
- Shared, server and UI package typechecks pass. Server and UI builds
pass.
- Token gates, module boundaries, the test budget check for changed
suites, and `git diff --check` pass.
- Long-preview regression proof: four rendered tests initially fail on
`9f2039d` because it passes 128,005 characters to conversion. They now
verify a 2,048-character input bound while calling the real helper, a
maximum 180-character summary, and complete replay masking for capped
sources. Inputs include backticks, stars, underscores and brackets. The
earlier short-preview credential tests still pass.
- Review regression proof: three rendered task-preview tests expose
GitLab, GitHub and OpenAI fixture credentials on `7533fbe`; they pass
after preserving token punctuation. An 80,000-hyphen input took about
3.25 seconds on that head and failed the 500 ms bound. The single-pass
flag scan passes the guard with a 512 KiB prefix followed by a real
password flag.
- Regression proof: the added tests first failed on the prior
implementation, including work content visible with a missing or false
opt-in and after withdrawal. They pass with the new gate.
- `pnpm verify`: exit 2, broader verification required because the
analytics document is a global CI input. Required CI supplies
repository-wide coverage. An earlier exit 1 identified stale
shared-source pins; the maintained generator refreshed them and the 13
pin tests pass.
- Direct UI `tsc --noEmit` initially lacked generated Storybook catalogs
in the fresh checkout. The maintained UI typecheck generates those files
and passes. A preliminary Vitest `--project ui` invocation matched no
named project; the commands above use the package configuration.
- Secret scan reviewed the commit diff. Gitleaks reports two generic-key
matches in the generated source-pin registry; both equal the
corresponding Git blob hashes. The remaining commit content scans clean.
No run artifacts or private deployment data are committed.

CI follow-up on `45023e6`: [server shard
10/20](https://github.com/paperclipai/paperclip/actions/runs/45560174673/job/139021948661)
timed out twice at the existing 15-second limit in
`issue-document-batch.integration.test.ts`, test "rejects many large
documents using a size-only query before loading any bodies". The test
prepares 200 half-MiB documents and later rewrites them. The same test
and server code are unchanged from `9f2039d`, where [the same shard
passed](https://github.com/paperclipai/paperclip/actions/runs/45558505382/job/139016469065)
and this test took 8.39 seconds. The intervening commit changes UI and
documentation only.

The exact failing case passes locally on the current head with `cd
server && pnpm exec vitest run
src/services/native-runtime/issue-document-batch.integration.test.ts -t
'rejects many large documents using a size-only query before loading any
bodies'` (one passed, 15 skipped). This shows local recovery; it does
not establish the cause of the CI timeout. A targeted shard rerun was
requested, but GitHub refused because the workflow is still running. No
test limits or product code have been changed to hide the failure. This
initial failure is retained here as evidence; the successful
second-attempt outcome is recorded below.

CI follow-up, second shard: [server shard
13/20](https://github.com/paperclipai/paperclip/actions/runs/45560174673/job/139021948654)
failed `ai-connections.test.ts`, test "requires sign-in after the
receiver process dies with an exchanged but unsaved token". The first
attempt failed its wait for one token exchange and an advisory-lock
waiter within 25 seconds. The automatic retry failed earlier because the
first attempt had already inserted the fixed membership fixture. The
suite, receiver helper and AI connection service are unchanged by this
work. The [original PR head passed this
shard](https://github.com/paperclipai/paperclip/actions/runs/45544519067/job/138970880217),
with the same test taking 21.06 seconds.

The exact case passes locally on `45023e6` with `cd server && pnpm exec
vitest run src/__tests__/ai-connections.test.ts -t 'requires sign-in
after the receiver process dies with an exchanged but unsaved token'`
(one passed, 164 skipped). The cause of the missed CI wait remains
unconfirmed. This local pass does not clear the failed CI result.
Targeted reruns were initially blocked by GitHub while the workflow was
running. See the successful second-attempt outcome below.

CI recovery: [workflow attempt
2](https://github.com/paperclipai/paperclip/actions/runs/45560174673/attempts/2)
completed successfully on unchanged head `45023e6`. Both previously
failed shards now pass. No source edits, timeout increases, or test
removals were needed. The original timeout and missed-wait causes remain
unconfirmed; the earlier failures and comparison evidence above are
preserved. Final acceptance uses the green current-head CI result
together with the local checks and 5/5 review.

Not run locally: repository-wide tests/builds or a live PostHog
recording. The tests exercise the masking callback and UI state, not the
externally loaded recorder.

After deployment, compare a masked replay with the work-content flag
unset against an opted-in eligible company. Then verify that
Google/Slack or a hidden source keeps the same surfaces masked. Restart
the server and reload open tabs after changing deployment environment
values.

## Risks

- The opt-in belongs to the host, not to the people who use the
deployment. Nothing in this pull request asks or tells a user. A host
that sets the flag must tell its users first. The plan for the hosted
service is in #23338.
- Enabling the new flag allows eligible work content to leave the
instance in replay data. Leave it unset or set it to `0` to keep work
content masked. No deployment or fleet policy is changed by this PR.
- The flag does not bypass company eligibility checks or secret masking.
Changing it affects future recording after the configuration reaches the
browser; it does not remove previously recorded content.
- Connection detection is a best effort. A custom MCP server with an
unrelated name and URL, or credentials used directly by an agent, can
carry Google or Slack data without appearing as a known source.
- Secret redaction is a best effort. Unknown or unlabeled secrets,
non-English labels, values on a later line or under a table header, and
values outside bounded line context can be missed. Some ordinary values
are over-masked.
- Source changes can race with recording until the live update arrives.
A missed update can extend that window to the five-minute refresh.
Connection count and list queries can disagree briefly and then mask
conservatively.
- Hidden drafts and aggregators can keep harmless content masked. Text
rendered during a source recheck stays masked until it renders again.
The first visible state adds a full recording snapshot.
- Task previews now inspect at most 2,048 source characters before
conversion. Very long markup can produce an incomplete summary.
Source-capped previews stay fully masked; opening the full task keeps
the normal work-content policy.
- Artifact card text previews stay masked in every company. Document
card previews and cut task previews mask when a credential sits at or
before the cut, so some replays show stars there while the full document
shows.
- Task titles, names and other previously visible surfaces remain
visible and can contain copied customer text. New work-content surfaces
must preserve company scoping.

## Model Used

- Original implementation: Anthropic Claude Opus 5.5 (`claude-opus-5-5`)
and Claude Fable 5.2 (`claude-fable-5-2`) through Claude Code, with
shell, edits, tests and the original read-only exploration subagent.
- Deployment configuration follow-up: OpenAI `gpt-6.1-sol` through the
Codex, xhigh reasoning, shell, file edits and test tools. Context window
size is not exposed by the runtime. No additional subagents.

## Checklist

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Devin Foley <devin@paperclip.ing>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: Dotta <bippadotta@protonmail.com>
2026-12-01 18:53:11 +00:00
Nicky LeachandPaperclip 07af22c57f feat(plugins): support agentless harness sign-in (#23392)
## Thinking Path

> - Paperclip manages agents and the AI accounts they use.
> - A company can connect an account before creating its first agent.
> - Some plugin drivers can run sign-in in a dedicated sandbox.
> - Core currently selects a saved agent for every plugin login.
> - This change lets each driver declare that it can sign in without an
agent.

## Linked Issues or Issue Description

**Subsystem affected**

Environment drivers, managed AI connections, and the agent setup UI.

**Current behavior**

A company with zero agents cannot start a provider login on a plugin
environment, even when that driver can provision a temporary
environment.

**Proposed behavior**

A driver can declare `supportsAgentlessLogin`. Core uses this capability
when it selects a login target and acquires the lease. Drivers that omit
it retain the existing agent selection.

**Reason and benefit**

Operators can finish connecting the account before they configure its
first agent.

**Additional context**

The driver capability follows the per-driver adapter declaration in
#22827. The onboarding flow keeps the agent readiness check from #23383.

## What Changed

- Added the optional capability to the manifest, capabilities response,
and login UI.
- Kept company and driver validation at sign-in and lease acquisition.
- Applied the plugin device-login deadline to sessions with no agent.
Ordinary task provisioning keeps its existing contract.

## Verification

- 122 tests passed across shared capabilities, environment target
resolution, lease construction, device-login HTTP routes, and session
lifecycle.
- The server typecheck passed.
- The SDK input registry matches the source revision. `pnpm verify`
requests broader CI coverage for that registry.
- After merging the current base, 82 focused tests passed, including the
onboarding tests. The UI typecheck passed. All required GitHub checks
passed.

## Risks

Drivers must advertise this capability only when they can run and clean
up a login without an agent. Existing manifests retain their previous
behavior. No database migration is required.

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

## Model Used

OpenAI Codex, GPT-6, with local code inspection 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-01 10:22:32 -08:00
DottaandPaperclip ce2e6ccc00 feat(ui): surface channel, key-values, lease, and schema elements on tasks (#23382)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Paperclip tasks and comments now store channel, key-value, claim
lease, profile attribution, and structured schema fields on existing
issue and comment tables (`channelId`, `kvLabels`, `schemaBlocks`,
`resultSchemaRef`, `createdByProfile`, `actorProfile`, and claim lease
fields).
> - Existing board task views (`IssueProperties`, `MarkdownBody`,
`CommentThread`, `IssueChatThread`, and `IssueDetail`) do not yet
display these fields, and canonical `/api/issues/:id` routes do not
resolve `channelPath` or strip `claimTokenHash` at serialization time.
> - Users and reviewers cannot see channel provenance, key-values,
active or expired claim leases, `--as <profile>` attribution, or
structured `schema=<name>@<version>` blocks when they open a task in the
UI.
> - This pull request synchronizes the shared `Issue` and `IssueComment`
contracts, resolves `channelPath` only when channel access and actor
scopes allow it, strips `claimTokenHash` from issue responses, renders
channel, key-values, lease, result schema, and structured schema cards
across existing task views (only when set), and adds
production-component Storybooks.
> - The benefit is that existing task surfaces show channel, lease,
key-value, profile, and schema state cleanly in place without cluttering
standard tasks or adding a separate Channels navigation item, while
preserving secret isolation on claim tokens.

## Linked Issues or Issue Description

Refs #23329
Refs #23330

**What existing behavior does this improve?**
Existing task detail, properties, Markdown body, comment thread, chat
thread, and `/api/issues` HTTP serialization for tasks that carry
channel, claim lease, key-value, profile attribution, or structured
schema data.

**Subsystem affected**
Cross-cutting (`packages/shared`, `server/`, `ui/`, `ui/storybook/`, and
`docs/api/`)

**Current behavior**
Canonical `/api/issues` routes return raw issue columns without a
resolved `channelPath` and include `claimTokenHash: null` on the
response shape. In `ui/`, `IssueProperties` omits channel provenance,
`Key-values` editing, claim lease status, `resultSchemaRef`
verification, and `--as <profile>` creator attribution. `MarkdownBody`
renders ```` ```json schema=<name>@<version> ```` blocks only as plain
code blocks, and comment threads show `local-board` or generic user
labels instead of `actorProfile` and omit comment-level key-values.

**Proposed behavior**
`Issue` and `IssueComment` expose safe coordination and schema fields in
`@paperclipai/shared`. Server issue routes strip `claimTokenHash` from
serialized issue objects and resolve `channelPath` in batch via
`findInaccessibleChannelIds` only when actor scopes and channel
membership succeed (with zero extra SQL queries when `channelId` is
null). `IssueProperties` mounts cohesive task property rows
(`structured-task-rows.tsx`) strictly when set: `#<channelPath>` badge
on `Channel`, inline `Key-values` add/edit/remove with CAS preconditions
(`PATCH /api/issues/:id/kv-labels`), active vs expired `Lease` status
with inline status dot and live countdown, `Result schema` matching
status, and creator `--as <profile>` attribution. `MarkdownBody` and
task discussion/chat threads render token-styled `SchemaBlockCard` views
(`finding@1`, `test-report@1`, `git-commit@1`, `pull-request@1`, and
custom `<name>@<version>` schemas) with a `Structured` / `JSON` toggle,
deduplicated standalone `schemaBlocks`, `--as <actorProfile>`
attribution, and comment key-value pills. Four production-component
Storybooks document these states under
`tasks-channels-leases-and-schemas`.

**Reason and benefit**
Agents and CLI workflows coordinate through existing Paperclip tasks and
comments. Surfacing channel provenance, claim leases, key-values,
profile attribution, and typed schema blocks directly on existing task
views (and hiding those rows completely when unset) lets people inspect
and edit structured task state in place without introducing new
top-level navigation, while guaranteeing that `claimTokenHash` never
leaves the server.

**Breaking changes**
None for external callers. `claimTokenHash` is omitted from serialized
`/api/issues` JSON responses as a security invariant, and `channelPath`
(`string | null`) is added on canonical issue read and update responses.

## What Changed

- `packages/shared/src/types/issue.ts` and
`tests/runner-e2e/source-sdk-public-inputs.json`: expose safe fields on
`Issue` (`channelId`, `channelPath`, `createdByProfile`, `kvLabels`,
`schemaBlocks`, `resultSchemaRef`, `claimEpoch`, `claimHolderAgentId`,
`claimHolderUserId`, `claimHolderProfile`, `claimLeasedAt`,
`claimLeaseExpiresAt`, `claimAttemptCount`) and `IssueComment`
(`actorProfile`, `kvLabels`, `schemaBlocks`), never `claimTokenHash`,
and synchronize the SDK public input registry pin.
- `server/src/services/issues.ts`, `server/src/routes/issues.ts`, and
`docs/api/issues.md`: omit `claim_token_hash` from SQL issue selections
and `withIssueLabels`, strip `claimTokenHash` on HTTP serialization
across issue routes, clear `kvLabels` and `schemaBlocks` on tombstoned
comments, resolve `channelPath` in batch via `resolveHeadlessActor` and
`findInaccessibleChannelIds` (zero extra SQL queries when `channelId` is
`null`), and document the API response contract.
- `server/src/__tests__/fixtures/issue-detail-response.json`,
`server/src/__tests__/issue-activity-events-routes.test.ts`, and
`server/src/__tests__/headless-channels-schemas-batch.test.ts`: update
issue detail and update response snapshots (`channelPath: null`, no
`claimTokenHash`) and add route contract coverage for `channelPath`
visibility, scope enforcement, comment fields, and `claimTokenHash`
omission.
- `ui/src/api/issues.ts` and `ui/src/api/issues.test.ts`: add
`issuesApi.updateKvLabels` targeting `PATCH /api/issues/:id/kv-labels`
with CAS precondition normalization (`set`, `unset`, `if`) and unit test
coverage.
- `ui/src/components/issue-properties/structured-task-rows.tsx` and
`IssueProperties.tsx`: add `IssueChannelRow`, `IssueKvLabelsRow`
(`Key-values` with inline edit, remove, `+ Add`, CAS preconditions,
touch-safe 16px inputs, and complete omission when empty),
`IssueClaimLeaseRow` (inline status dot, live countdown, and omission
when unset or released), `IssueResultSchemaRow` (unwrapping
`InfiniteData` and identifier-keyed comment query caches, plus
distinguishing `"unverified"` truncated scans from `"missing"`), and
`IssueProfileAttributionRow`.
- `ui/src/components/SchemaBlockCard.tsx`,
`ui/src/lib/schema-block-utils.ts`, and
`ui/src/components/MarkdownBody.tsx`: parse ```` ```json
schema=<name>@<version> ```` fences (plus `{ schema, data }` JSON
envelopes) via a static remark plugin and a bounded linear $O(N)$
single-pass CommonMark fence scanner (no multi-line backtracking
regexes); render semantic-token cards for `finding@1`, `test-report@1`,
`git-commit@1`, `pull-request@1`, and custom `<name>@<version>` blocks
with `Structured` / `JSON` toggle, `https://`-only link safety,
malformed-JSON code-block fallback, and iterative stack-safe
`schemaBlocks` deduplication.
- `ui/src/components/CommentStructuredMeta.tsx`, `CommentThread.tsx`,
`IssueChatThread.tsx`, `TaskChatBubble.tsx`,
`TaskChatDescriptionBubble.tsx`, `IssueDetail.tsx`, and chat adapters:
render `--as <actorProfile>` attribution, comment-level key-value chips,
and unfenced `schemaBlocks` across classic and chat task threads.
- `ui/storybook/stories/tasks/channels-leases-and-schemas.stories.tsx`:
add `ChannelTaskPropertiesActiveLease`, `ExpiredLeaseProperties`,
`BuiltInAndCustomSchemaBlocks`, and `ChannelTaskThreadEndToEnd` stories
registered under `tasks-channels-leases-and-schemas`.
- `ui/src/components/issue-properties/structured-task-rows.test.tsx` and
`ui/src/components/SchemaBlockCard.test.tsx`: add unit tests covering
unset-row omission on standard tasks, single-badge channel provenance,
CAS key-value mutations and `409` conflict rollback, inline lease status
dots and countdown expiry, `InfiniteData` comment unwrapping, structured
schema cards, malformed JSON fallback, linear $O(N)$ scanning on 5,000
unterminated JSON fences, newline-clamped markdown bounds, and deep
deduplication.

## Verification

- `pnpm --filter @paperclipai/shared build` — passed.
- `cd server && node scripts/typecheck-layers.mjs` — passed (0 errors
across all layers and test trees).
- `cd server && npx vitest run
src/__tests__/service-read-disconnect-retry.test.ts
src/__tests__/issue-activity-events-routes.test.ts
src/__tests__/issue-detail-statements.test.ts
src/__tests__/headless-channels-schemas-batch.test.ts` — passed (54/54
tests).
- `pnpm --filter @paperclipai/ui typecheck` — passed (0 errors).
- `cd ui && npx vitest run
src/components/issue-properties/structured-task-rows.test.tsx
src/components/SchemaBlockCard.test.tsx src/api/issues.test.ts
src/lib/issue-chat-messages.test.ts
src/components/task-chat/task-chat-adapter.test.ts` — passed (115/115
tests).
- `node scripts/check-token-gates.mjs`, `node
scripts/check-test-budget.mjs`, `node
scripts/check-module-boundaries.mjs`, and `node
scripts/check-query-error-rendering.mjs` — all passed.
- `node scripts/storybook-catalog.mjs && node
scripts/storybook-catalog.mjs --check` and `node --test
scripts/check-maps.test.mjs scripts/storybook-catalog.test.mjs
scripts/storybook-feature-index.test.mjs` — passed (30/30 tests).
- `pnpm --filter @paperclipai/ui build-storybook` — passed and verified
built story IDs
(`tasks-channels-leases-and-schemas--channel-task-properties-active-lease`,
`tasks-channels-leases-and-schemas--expired-lease-properties`,
`tasks-channels-leases-and-schemas--built-in-and-custom-schema-blocks`,
`tasks-channels-leases-and-schemas--channel-task-thread-end-to-end`).

## Risks

- Low risk. Standard board tasks with unset `Channel`, `Key-values`,
`Lease`, and `Result schema` omit all four property rows completely,
preserving existing `IssueProperties` layout and SQL query count (`0`
extra queries when `channelId` is `null`).
- Fenced code blocks without `schema=<name>@<version>` metadata (or with
invalid JSON) fall back directly to the existing `CodeBlock` renderer.

## Model Used

- Google Gemini (`gemini-3.1-pro` / Antigravity agentic coding runtime
with extended thinking, code search, file editing, and terminal
verification tools).

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-01 17:57:33 +00:00
Nicky LeachandClaude Opus 5.5 51541be36f fix(onboarding): start an agent-targeted sign-in only on a settled, prepared draft (#23383)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Onboarding signs the first agent in to Claude or Codex through a
plugin-managed execution environment that is prepared for the agent
(#23312)
> - Each change to the setup draft, such as switching between Claude and
OpenAI, makes Core prepare the environment again before it accepts a
sign-in
> - The wizard remembered that the environment had been prepared once,
so it started the new sign-in during that preparation
> - Core refused it with `login_agent_unavailable`, and the sign-in card
showed only "Sign-in didn't finish"
> - This pull request starts a sign-in only when the draft has settled
on the current choice and is prepared, and shows Core's error on the
card
> - The benefit is that switching the sign-in source works, without an
added wait

## Linked Issues or Issue Description

Refs #23312 and #23315.

**What happened?**

In onboarding with a plugin-managed execution environment as the
default, a user picked Claude, then switched to OpenAI. Every sign-in
start after the switch returned `400 login_agent_unavailable`: Core
refused the agent as the sign-in target. The card showed "Sign-in didn't
finish. Try signing in again."

**What did you expect to happen?**

The OpenAI sign-in starts as soon as the environment is prepared for the
new choice.

**Steps to reproduce**

1. Make a plugin-managed execution environment that prepares an
environment per agent the instance default.
2. Start onboarding, name the agent, and choose Claude with a
subscription.
3. When the Claude sign-in shows, choose OpenAI.
4. See the sign-in fail with the message above.

## What Changed

- The sign-in readiness hook takes `settled` and `holdKey`. A sign-in
starts only when the agent has settled on the current choice and the
environment is prepared for it. Readiness is held per agent, environment
and sign-in source, so a source switch waits for the real preparation,
and a sign-in already on screen stays on screen.
- Onboarding treats the setup draft as settled when its saved harness
(and model, when one is set) matches the selection. Each draft save puts
the saved agent in the query cache at once, and readiness polls every
500 ms instead of every second.
- The new-agent flow treats its draft as settled when no environment
save is in flight, and polls a preparing draft every 500 ms.
- Both sign-in panels show Core's start error for any sign-in that
targets an agent, not only for one that Core selects automatically.

## Verification

- `pnpm typecheck` in `ui/`: no errors.
- The sign-in readiness helper and hook suites, the
`AgentProviderConnection` suites and the `AgentConfigForm` render suite
in `ui/`: 23 tests pass. A new hook test covers a switch from Claude to
OpenAI and back while the environment is prepared again.
- `PAPERCLIP_PLAYWRIGHT_CHANNEL=chrome npx playwright test --config
tests/e2e/playwright.config.ts tests/e2e/onboarding-early-setup.spec.ts
tests/e2e/onboarding.spec.ts -g "naming step creates|create-company
path"`: 2 tests pass.
- I reproduced the failure on a staging instance from the network log. I
did not repeat the sign-in on a staging instance with this change.

## Risks

- A change to the draft after a sign-in started can still make Core
refuse the login lease when it acquires it. The card then shows Core's
error and the usual retry.
- Readiness polling is now twice as frequent while an environment is
prepared. It stops when the environment is ready.
- No migration and no API change.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), with extended thinking and tool
use (code search, shell, tests, browser network inspection) in Claude
Code.

## Checklist

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

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:45:32 +00:00
Dotta d1680baf8f fix(onboarding): harden connect-model OAuth timeout, mobile paste, and API key recovery (#23379)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - During onboarding, new users connect an AI model via Claude/OpenAI
subscription OAuth or an API key.
> - Production session replays showed users failing on `connect_model`
because subscription login sessions expired at 5 minutes during
mobile/tab switches, the waiting spinner hid the sign-in link with no
way to reopen it, pasted Claude codes failed silently without
normalization or clear feedback, and rejected API keys gave a dead-end
error.
> - These friction points cause new users to abandon onboarding right
before their first agent run.
> - This pull request raises server login timeouts to 15 minutes with
visibility-change polling/auto-refresh, keeps a re-open link and 60s
recovery action visible while waiting, normalizes and validates pasted
Claude authorization codes with explicit error messaging, and adds API
key paste normalization, provider-mismatch switching, and actionable
rejection links.
> - The benefit is fewer onboarding drop-offs on mobile and desktop
without changing backend auth protocols or schema.

## Linked Issues or Issue Description

**What happened?**
Users onboarding on `connect_model` hit four repeatable failure modes:
1. Subscription login sessions (`DEVICE_LOGIN_TIMEOUT_MS` and
`DEFAULT_SETUP_TOKEN_SESSION_TTL_MS`) expired after 5 minutes while
users switched apps/tabs for OAuth and 2FA, showing `This sign-in
expired` or `Sign-in didn't finish` right when they returned.
2. After clicking `Sign in`, `ProviderSubscriptionCard` replaced the
button with a disabled `Waiting…` / `Waiting for code…` spinner, leaving
users with no way to reopen the OAuth URL if a mobile browser blocked
the tab or they closed it.
3. Pasting a Claude authorization code with mobile line breaks, quotes,
or a full callback URL could fail silently or show no explanation when
rejected.
4. Pasting a rejected or wrong-provider API key showed a generic
rejection message without pointing users to the provider's API keys page
or offering a 1-click provider switch.

**Expected behavior**
Subscription sign-in sessions should give users 15 minutes to complete
OAuth, immediately poll or refresh when returning to the tab, keep a
re-open link and 60-second recovery action accessible, normalize and
validate pasted Claude codes with clear inline feedback, and help users
recover from wrong-provider or rejected API keys.

**Steps to reproduce**
1. Open the onboarding wizard and advance to the Connect a model step.
2. Start a Claude or OpenAI subscription sign-in, switch tabs for 5
minutes (or close the OAuth tab), and return.
3. Paste an authorization code with extra whitespace/newlines or a
callback URL into the Claude code input, or paste an Anthropic
`sk-ant-...` key into OpenAI API key mode.

**Paperclip version or commit**
`43fedd51c5c37ccf7c7568328bac97179cdd48ba` (`master`)

**Deployment mode**
Other (hosted Cloud & local dev)

## What Changed

- **15-minute subscription login TTLs + tab-return poll/refresh:**
Raised `DEVICE_LOGIN_TIMEOUT_MS`
(`server/src/services/device-login-service.ts`) and
`DEFAULT_SETUP_TOKEN_SESSION_TTL_MS`
(`server/src/services/setup-token-session.ts`) from 5 minutes to 15
minutes. Added `visibilitychange` listeners to both
`AdapterDeviceLoginPanel` and `ClaudeSetupTokenLoginPanel`
(`ui/src/components/AgentConfigForm.tsx`) to immediately refetch status
on tab return and auto-refresh once if an onboarding session expired
while hidden.
- **Non-locking waiting state:** Updated `ProviderSubscriptionCard`
(`ui/src/components/AdapterLoginChrome.tsx`) to keep an `Open sign-in
link again` button visible while waiting and show a `Taking a while? Get
a new link` recovery button after 60 seconds (`WAITING_HELP_DELAY_MS`).
- **Claude code-paste normalization & inline validation:** Added
`ui/src/lib/onboarding-login-helpers.ts`
(`normalizeSubmittedBrowserCode`, `validateSubmittedBrowserCode`) to
strip newlines/quotes and extract `code#state` from pasted callback
URLs, surface immediate inline validation errors on invalid pastes, and
show an explicit rejected-code message when a submitted code fails.
- **Self-recoverable API key input:** Added `normalizeApiKeyInput`,
`detectMismatchedApiKeyProvider`, and `providerApiKeysHelp` in
`ui/src/lib/onboarding-login-helpers.ts`, wired into
`ui/src/components/OnboardingWizard.tsx` to normalize pasted keys, offer
a 1-click switch when an Anthropic/OpenAI key is pasted into the wrong
provider, and link directly to the provider's API keys page when
rejected.
- **Module size note:** `AgentConfigForm.tsx` and `OnboardingWizard.tsx`
already exceeded 1,000 lines; all new pure parsing, validation, and
provider-help logic was extracted into
`ui/src/lib/onboarding-login-helpers.ts` to keep edits to existing files
minimal.

## Verification

- `pnpm --filter @paperclipai/ui typecheck` — passed.
- `pnpm --filter @paperclipai/server typecheck` — passed.
- `pnpm vitest run ui/src/lib/onboarding-login-helpers.test.ts
ui/src/components/AdapterLoginChrome.test.tsx
ui/src/components/AgentConfigForm.render.test.tsx
server/src/__tests__/device-login-service.test.ts` — 4/4 files, 84/84
tests passed.
- `git ls-files "*setup-token*test*" "*onboarding*test*" | grep -E
"^(server|ui)/" | xargs pnpm vitest run` — 24/24 files, 373/373 tests
passed.
- Note: A full local `pnpm verify` run selected 2,296 files and hit 14
unrelated local PostgreSQL/heartbeat/Tailscale hook timeouts under
parallel macOS load (34,070 passed, 0 failures in
login/onboarding/setup-token/device-login suites); CI will supply
full-suite coverage on this PR.

## Risks

- **Low risk:** Raising `DEVICE_LOGIN_TIMEOUT_MS` and
`DEFAULT_SETUP_TOKEN_SESSION_TTL_MS` from 5 to 15 minutes extends the
maximum lifetime of an uncompleted login sandbox lease by 10 minutes
(bounded by the existing reaper and per-owner concurrency limits). No
database schema, API contract, or auth protocol changes.

## Model Used

- Google Gemini (Antigravity agentic assistant with thinking mode and
tool use / 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-01 16:43:39 +00:00
ab099dc379 feat(plugin-sdk): declare supported adapters per environment driver (#22827)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Environment plugins can run agent tasks on remote computers, and can
run the provider sign-in for those computers
> - Core decides which adapters can sign in on a plugin environment from
a fixed Claude and Codex rule and a `supportsCodexLogin` flag
> - A plugin cannot say which adapters it supports, so Grok has no
sign-in on a plugin computer, and a plugin can run an adapter that it
cannot sign in
> - This pull request lets a Runner task driver declare its supported
adapters, and makes support mean the full adapter lifecycle: runs and,
where Paperclip offers one, sign-in
> - The benefit is one extensible support contract per driver, with no
partial matrix, and Grok subscription sign-in on plugin computers

## Linked Issues or Issue Description

**Subsystem affected**

Plugin SDK environment drivers, plugin sign-in (login pseudo-terminal),
plugin Runner task credentials, and agent Runner selection.

**Problem or motivation**

Core allows plugin-computer sign-in only for Claude, and for Codex when
the plugin can read back a credential file. The flag for that is named
`supportsCodexLogin`, which does not describe what it does. A plugin
cannot advertise which adapters it supports. Grok has a device sign-in
in Core, but it has no sign-in on a plugin computer, and a Grok
subscription cannot reach a plugin task. A plugin can also run an
adapter that has no sign-in on that plugin. This gives a partial support
matrix.

**Proposed solution**

A Runner task driver declares `supportedAdapters`. Support for an
adapter means the full lifecycle. The driver must run the adapter, and
it must run the Paperclip sign-in when the adapter has one. Core
validates the declaration in the manifest, and Core checks it again
against the methods of the running worker. An adapter that fails either
check is not offered for sign-in, for save, or for runs. The sign-in
contract moves to one shared map, so a new adapter sign-in is one entry
in that map.

**Alternatives considered**

A separate per-capability table (runs, sign-in, credential read-back)
was rejected. It permits the partial matrix that this change removes.
The existing sign-in map and credential sets already contain the
necessary data.

**Additional context**

Related open pull requests: Refs #14001 (Kubernetes plugin login
pseudo-terminal), Refs #21327 (Grok device link in the sign-in UI).

## What Changed

- Environment drivers can declare `supportedAdapters`. The manifest is
rejected when the list has duplicates, when the driver is not a Runner
task driver, or when it lists an adapter that has a Paperclip sign-in
and the driver does not declare the login pseudo-terminal with
`creationOperationVersion: 1`.
- Core removes a listed adapter when the running worker does not
implement the methods it needs (task methods, and sign-in methods with
credential read-back for file sign-ins). Core logs a warning one time
for each removed adapter.
- `supportsCodexLogin` is replaced by `loginAdapters`, the adapters that
can sign in on that environment. Drivers without `supportedAdapters`
keep the current behaviour: Claude, and Codex when the worker reads back
credentials.
- A new shared sign-in map holds the adapters that Paperclip signs in
and where each sign-in leaves its credential (terminal output or a
file). Manifest validation, server admission, environment presentation,
and the Connections sign-in step use this map. Two hard-coded Claude and
Codex lists are removed.
- Credential read-back accepts any file sign-in key and returns `{ kind:
"auth-file", content }`.
- The plugin task credential `codex-auth-json` becomes `{ type:
"auth-file", provider: "codex" | "grok", content }`.
- A Grok subscription is delivered to plugin tasks as an `auth-file`
credential. A refreshed Grok file returns to the account through the
existing write-back. The write-back record now stores its provider.
- On a driver that lists adapters, Core refuses to save, offer, or
submit a Runner harness that is not on the list. The error is
`agent_runner_unavailable`.
- The SDK README and the plugin environment task and AI connection docs
describe the contract.

## Verification

- `pnpm --filter @paperclipai/server typecheck`, `pnpm --filter
@paperclipai/plugin-sdk typecheck`, and `pnpm --filter @paperclipai/ui
typecheck` pass.
- Targeted server tests pass: plugin environment driver capabilities,
plugin login credential, plugin Runner credentials, plugin task
credential write-back (Codex and Grok, with a provider mismatch case),
environment task runtime submit gating, agent Runner selection, login
environment, login session runtime, device login routes and service,
setup token, login command, and adapter routes.
- Plugin Runner probe and integration tests pass (run from the
repository root).
- Shared tests (77) and plugin SDK tests (129) pass, including the new
manifest validation cases.
- UI AI connection tests (67) pass.
- Not run locally: the full suite (CI runs it), a render test for the
Connections credential step, and an end-to-end route test for computer
device sign-in admission. Unit tests cover that admission.

## Risks

- Breaking change for plugins that use the plugin SDK task credential or
credential read-back. `codex-auth-json` becomes `auth-file`, and the
read-back result kind changes. A plugin must update to the new SDK
shapes in the same release.
- Plugins that do not declare `supportedAdapters` keep the current
behaviour. No warning is logged for them.
- `supportedAdapters` applies to Runner task drivers only. Sandbox
providers reject the field. Support for sandbox providers is a separate
change.
- The new-agent screen does not offer sign-in on a plugin computer. That
sign-in needs a target computer, and the Connections flow selects it.
This is the current behaviour for Claude and Codex.
- No migration. The write-back record treats a missing provider as
Codex, so records written before this change still work.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use
(shell, file edits, test runs) 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
- [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>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-12-01 08:13:39 -08:00
Tonio 2033ab912f Update the Connect account dialog and provider chooser (#23361)
## Thinking Path

> - Paperclip helps people manage agents.
> - Each agent can use a managed provider account.
> - People can connect that account during onboarding or from agent
settings.
> - The two screens used different sign-in controls.
> - This change brings the wizard controls to the account dialog and
groups other providers in a grid.

## Linked Issues or Issue Description

**Subsystem affected**

Agent settings and managed AI connections.

**Current behavior**

The account dialog uses different controls from onboarding and displays
other providers in separate lists.

**Proposed behavior**

Show provider sign-in, code entry, expiry, and retry inside the
credential panel. Show other providers in a compact grid.

## What Changed

- Share the provider marks and sign-in controls with onboarding.
- Keep the account fields visible while sign-in prepares.
- Crossfade between the account form and provider grid. Keep the modal
width stable.

## Verification

- All 29 tests in AdapterLoginChrome and AgentProviderConnection passed.
- The UI TypeScript check passed.
- To check the layout, open Connect account from agent settings, choose
Other Models, then return to the provider form.

## Risks

- The dialog shares controls with onboarding. Changes to their defaults
could affect both entry points.
- Subscription sign-in depends on the selected execution environment.

## Model Used

OpenAI GPT-6 through Codex, with local editing 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)
- [ ] 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
2026-12-01 09:14:24 +00:00
fd6e940b35 fix(ui): stop retrying and reporting an active sign-in conflict (#23350)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The agent sign-in panel reads the user's active sign-in session
before it starts a new one
> - When that active session belongs to another computer or AI
connection, the panel throws an error and shows "Another sign-in attempt
is active"
> - This is an expected state that the user must resolve. But the error
has no status, so the query client classifies it as an unknown failure
> - Because of that, the query retries it two times and then sends it to
Sentry as an unexpected error
> - This pull request marks this state as a conflict (409). The query
does not retry it and does not report it. The panel shows the same
message
> - The benefit is that Sentry shows real failures only, and the user
sees the conflict at once, not after about 3 seconds of retries

## Linked Issues or Issue Description

No public issue exists. The issue is below. It follows the bug template.

**What happened?**
A user opened the agent sign-in panel while a different sign-in for the
same owner was active on another computer or AI connection. The panel
showed "Another sign-in attempt is active…". The browser also sent a
handled `Error` to Sentry from the active-session query
(`query_kind=adapter-login-active-session`). This happens in the
displayed-code panel (Codex and similar adapters) and in the Claude
setup-token panel. Both throw the same kind of error.

**Expected behavior**
The panel shows the conflict and the "Cancel previous sign-in and retry"
action. The app does not retry the read. The app does not report the
conflict to Sentry, because it is a known user state and not a failure.

**Steps to reproduce**
1. Start a sign-in for an agent on computer A. Do not complete it.
2. Open the sign-in panel for an agent on computer B, as the same user.
3. The active-session read finds the session for computer A. The query
retries two times, then the panel shows the conflict, and Sentry gets an
event.

**Paperclip version or commit**
`master` at 66a8aa7f7e. Sentry saw it on hosted releases 91e9365d59 and
earlier.

**Relevant logs or output**
`Error: Another sign-in attempt is active. Finish or cancel that attempt
before starting a new sign-in.` (mechanism generic, handled, culprit
`queryFn`). A similar group has the message "Finish or cancel it in its
original account setup before starting this one." from the Claude
setup-token panel.

## What Changed

- `ui/src/lib/query-client.ts`: Add `QueryStateConflictError`. It
carries `status = 409`, so `classifyError` returns `conflict`. Because
of that, `shouldRetryRequest` does not retry it,
`shouldReportQueryError` does not send it to Sentry, and `describeError`
still shows its message.
- `ui/src/components/AgentConfigForm.tsx`: `AdapterLoginConflictError`
(displayed-code panel) now extends `QueryStateConflictError`. The Claude
setup-token panel now throws `QueryStateConflictError` and not a plain
`Error`.
- Tests: A render test for each panel (`codex_local` and `claude_local`)
uses the real `createAppQueryClient`. It checks that the panel shows the
conflict, reads the active session one time, does not start a new
sign-in, and does not report an error. The unit tests in
`query-client.test.ts` check the retry and report rules for the new
error.

## Verification

- Red: With the original `AgentConfigForm.tsx`, both new render tests
fail: `expected "vi.fn()" to be called 1 times, but got 3 times` (two
retries).
- Green: `cd ui && npx vitest run
src/components/AgentConfigForm.render.test.tsx
src/lib/query-client.test.ts src/api/errors
src/components/AgentConfigForm.test src/components/new-agent` passes: 6
files, 118 tests.
- `pnpm verify` selected a broad set because `query-client.ts` is
imported widely. I stopped the local run and used full CI on head
4267d070e7 for broad coverage. CI ran the full suite, and both changed
test files passed there (`AgentConfigForm.render.test.tsx` 8 tests,
`query-client.test.ts` 27 tests).
- `tsc --noEmit -p ui/tsconfig.json` shows no errors in the changed
files.

## Risks

- Low risk. The change touches only the two client-side conflict errors.
API errors and other query errors keep their current classification.
- The panel no longer retries the conflict read. A retry reads the same
server state, so this does not remove a recovery path. The "Cancel
previous sign-in and retry" action refetches the read.

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

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, used through 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
- [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: devinfoley <139239+devinfoley@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:36:53 +00:00
scotttongandScott Tong fb6632530d feat(onboarding): start the first chat with a welcome and choices (#23334)
## Thinking Path

> - Paperclip helps people assign and track work with AI agents.
> - Onboarding connects the first agent and opens its chat.
> - A new user needs a clear way to start a conversation.
> - A saved welcome can appear as soon as chat opens.
> - The standard question card lets the user pick a goal, a product
overview, or a task.
> - The connected model replies after the user sends the choice.

## Linked Issues or Issue Description

**Subsystem affected**

Onboarding, agent chat, and subscription sign-in.

**Problem or motivation**

New users can land in a chat before they know what to ask. The original
welcome depended on a model run, which could delay the first
interaction. Local Claude sign-in could lose its code field if the
browser reloaded the onboarding tab during authorization.

**Proposed solution**

Save a personalized welcome and a standard question card. Type the
welcome when the chat opens, then show the card above the composer. Use
the choice and any task description to guide the connected model. Resume
the local Claude sign-in attempt when the onboarding tab reloads.

**Alternatives considered**

A model-written welcome can vary, but it adds a model call before the
user has chosen what to do. The saved welcome gives the user the same
starting points each time.

**Roadmap alignment**

This improves the existing first-agent flow for local and Cloud-managed
instances.

Related PRs: #22433 covers clearing the organization name after Back.
#23326 adds the separate Cloud mobile-to-desktop handoff.

## What Changed

- Save the greeting and question card together. Reuse the saved chat on
entry and keep the transcript in order after a reload.
- Type the greeting in the chat and reveal the standard question card
above the composer. Honor reduced motion.
- Collect a task description before starting the first model turn for
the task option. Guide the first reply for each choice.
- Restore the original local Claude sign-in attempt when the onboarding
tab reloads. Show progress while it connects, and offer retry on a
failed or stalled code exchange.
- Update the organization name helper text and the onboarding
walkthrough tests.

## Verification

- See the first-chat test drive for manual steps and the credential-free
browser fixture.
- 659 focused Vitest tests passed, with one skipped. The UI and server
typechecks and the feature map validator passed.
- All 18 Chromium tests passed across the first-chat, onboarding,
sign-in resume, and mobile desktop handoff specs. Coverage includes the
saved greeting, chat ordering, question handoff, Claude code submission
and resume, and the Cloud-managed starter model path with scripted
replies.
- The published Cloud service and live subscriber credentials need
separate acceptance testing.

## Risks

- The greeting uses the existing conversation and interaction records.
No database migration is needed.
- Existing in-flight model greetings can finish through the previous
path.
- The Claude PTY change depends on the CLI's bracketed-paste support.
The runner preserves separate input writes for terminals that do not
announce support.

## Model Used

OpenAI Codex, GPT-6.2 Sol and GPT-6.2 Astra, with terminal and browser
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: Scott Tong <1504818+scotttong@users.noreply.github.com>
2026-11-30 23:01:24 +00:00
DottaandPaperclip 1eae356c55 fix(analytics): remove PostHog consent banner and opt-out gating for private beta (#23333)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Paperclip Cloud sends browser product analytics and session replays
to PostHog when enabled for a hosted stack (self-hosted installs never
load posthog-js)
> - Previously, an EU/UK/Swiss consent banner and Profile settings
opt-out toggle gated browser analytics and dropped metrics when visitors
did not opt in
> - During private beta, we want to stop showing the consent banner and
opt-out prompt anywhere while continuing to send metrics (compliance
will be handled separately later)
> - This pull request removes the consent banner, Profile opt-out
toggle, and client-side consent gating across the UI and sets
`consentRequired: false` on the server response
> - The benefit is zero banner friction during private beta and
uninterrupted PostHog product metrics, while keeping all
replay/autocapture privacy masking and pre-load event queuing intact

## Linked Issues or Issue Description

**What existing behavior does this improve?**
Paperclip Cloud browser product analytics initialization
(`ProductAnalyticsGate`, `ui/src/lib/analytics`, `ProfileSettings`,
`cloud-posthog-browser.ts`).

**Subsystem affected**
Cross-cutting (multiple of the above) — `ui/` and `server/`.

**Current behavior**
In EU/EEA/UK/Swiss regions (or unknown time zones),
`ProductAnalyticsGate` renders `AnalyticsConsentBanner` and blocks
loading `posthog-js` until the visitor clicks Accept. `ProfileSettings`
also renders a `ProductAnalyticsSetting` opt-out switch.

**Proposed behavior**
Remove `AnalyticsConsentBanner`, `ProductAnalyticsSetting`, and
client-side consent gating so `ProductAnalyticsGate` loads PostHog
unconditionally when `browserAnalytics` is enabled for a Cloud stack.
Return `consentRequired: false` from `resolveBrowserAnalyticsConfig` so
cached older UI bundles also stop prompting during rollout, and keep
`opt_in_capturing()` when `has_opted_out_capturing()` is true so
previously opted-out browsers resume sending metrics.

**Reason and benefit**
During private beta, the EU/UK consent banner adds friction and drops
PostHog product metrics. Removing the banner and opt-out gating restores
full metric delivery while keeping all replay/autocapture privacy
masking and pre-load event queuing intact.

**Breaking changes**
None — `browserAnalytics.consentRequired` remains on the session payload
(as `false`), self-hosted installs still receive `browserAnalytics:
null`, and per-stack env controls (`PAPERCLIP_POSTHOG_BROWSER_ENABLED`,
`PAPERCLIP_POSTHOG_REPLAY_ENABLED=0`) continue to work.

## What Changed

- Deleted `ui/src/components/AnalyticsConsentBanner.tsx`,
`ui/src/components/ProductAnalyticsSetting.tsx`,
`ui/src/lib/analytics/consent.ts`, and their unit tests.
- Simplified `ui/src/components/ProductAnalyticsGate.tsx` to start
PostHog unconditionally after the page settles and render `null`.
- Simplified `ui/src/lib/analytics/product-analytics.ts` to remove
consent-state gating while keeping pre-load event queuing
(`MAX_QUEUED_PRODUCT_EVENTS`) and automatic opt-in for browsers with a
prior PostHog opt-out.
- Removed `ProductAnalyticsSetting` from
`ui/src/pages/ProfileSettings.tsx` and its mock in
`ui/src/pages/mobile-collections-responsive.test.tsx`.
- Updated `server/src/services/cloud-posthog-browser.ts` to always
return `consentRequired: false`.
- Updated `ui/src/components/ProductAnalyticsGate.test.tsx`,
`ui/src/lib/analytics/onboarding-analytics.test.tsx`,
`server/src/__tests__/cloud-posthog-browser.test.ts`,
`server/src/__tests__/auth-routes.test.ts`, and
`doc/cloud-browser-analytics.md`.

## Verification

- `pnpm vitest run ui/src/components/ProductAnalyticsGate.test.tsx
ui/src/lib/analytics/onboarding-analytics.test.tsx
ui/src/lib/analytics/product-analytics.test.ts
ui/src/pages/mobile-collections-responsive.test.tsx
server/src/__tests__/cloud-posthog-browser.test.ts
server/src/__tests__/auth-routes.test.ts` — all passed.
- `pnpm --filter @paperclipai/ui typecheck` — passed.
- `pnpm --filter @paperclipai/server typecheck` — passed.

## Risks

- Low risk: self-hosted installs remain unaffected (`browserAnalytics`
is still `null`). All replay/autocapture privacy masking and `/_ph`
proxy allowlists remain unchanged. Per-stack opt-out
(`PAPERCLIP_POSTHOG_BROWSER_ENABLED` /
`PAPERCLIP_POSTHOG_REPLAY_ENABLED=0`) continues to work.

## Model Used

- Google Gemini (Antigravity agent with tool use and code execution)

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-30 22:49:39 +00:00
scotttongandScott Tong adc4501689 Add a desktop handoff to mobile Cloud onboarding (#23326)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Onboarding asks users to connect a model before they can finish
setting up their agent.
> - Cloud users can start setup on a phone, where provider sign-in and
key entry can be difficult.
> - They need a way to find the same workspace on a computer.
> - This pull request adds a copyable link on the mobile model step and
defers agent creation while the handoff is offered.
> - A user can open the link on desktop or continue on the phone.

## Linked Issues or Issue Description

**Subsystem affected**
React onboarding UI and its Cloud health metadata.

**Problem or motivation**
On a phone, the Cloud model step does not explain how to find the same
onboarding page on a computer. The fresh agent draft is local to that
browser and can leave a provisional agent behind.

**Proposed solution**
Offer Continue on desktop and Keep going here at the start of the mobile
model step. Copy the workspace's HTTPS `/onboarding` link. Ask users to
sign in to the same account on desktop and explain that they may need to
enter their choices again.

**Alternatives considered**
The original invite URL would carry an invite token. Copying the
workspace's onboarding URL lets Cloud handle sign-in through its
existing entry flow.

**Roadmap alignment**
This is a focused improvement to the existing onboarding wizard. It uses
the current Cloud workspace entry flow and keeps model selection
available on mobile.

**Additional context**
Refs #23315 for naming-step setup drafts. Related prior work: #3594
covered a native iOS-to-web handoff token and is closed.

## What Changed

- Add the Cloud mobile handoff panel and clipboard fallback.
- Prefer the canonical tenant HTTPS origin and build a clean
`/onboarding` URL. Older tenants can use the current HTTPS tenant
origin.
- Defer the provisional agent in the naming and model steps while the
mobile handoff is available. Desktop and self-hosted sessions keep the
early-draft behavior from #23315.
- Render the step indicators as round dots inside the step buttons so
the mobile touch-height rule does not stretch them.
- Add browser coverage for the Cloud and self-hosted paths and unit
coverage for URL handling.

## Verification

- Passed 52 focused Vitest tests for the onboarding route, stepper,
handoff URL, and shared clipboard policy.
- Passed UI typecheck, the test-budget guard, and `git diff --check`.
- Passed 23 tests in desktop Chrome with four workers, including the
affected CI browser shard and the upstream early-draft regression. The
handoff scenarios cover the mobile dots, clipboard success and manual
fallback, same-workspace desktop re-entry via simulated sign-in,
continuing on mobile, and the self-hosted flow.
- Manual reproduction: use a fresh Cloud test workspace and a 390 × 844
viewport. Enter an agent name and proceed to Connect a model. Open
Continue on desktop and copy the link. Open it on desktop and sign in
with the same account if needed. A real Cloud sign-in was outside the
local fixture.

## Risks

- Setup choices from the phone may need to be entered again on desktop.
- Real Cloud sign-in and in-app mobile browsers still need a live tenant
check. No database migration is needed.

## Model Used

- OpenAI Codex with GPT-6.2 Sol (`gpt-6.2-sol`) for branch preparation
and verification. Used the terminal and Chromium. The context window
size is not available in the session.

## Checklist

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

---------

Co-authored-by: Scott Tong <1504818+scotttong@users.noreply.github.com>
2026-11-30 22:42:48 +00:00
Devin FoleyandPaperclip d71d039ad7 fix(ui): link routine projects by ID (#23332)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Routines assign repeated work to an agent and an optional project.
> - A routine stores its project ID, but its detail page links to the
project's name-derived URL key.
> - A cached name can stop identifying that project after a rename.
> - This pull request uses the project ID in that link.
> - The link stays attached to the selected project when its name
changes.

## Linked Issues or Issue Description

**What happened?**

The routine detail page prefers a project's name-derived URL key over
its ID. A cached routine page can link to an old project name after a
rename. If another project takes that name, the old link can resolve to
the other project. Saved routine associations, filters, and scheduler
joins already use project IDs.

**Expected behavior**

The project link should identify the routine's selected project by ID.

**Steps to reproduce**

1. Open a routine attached to a project named Operations.
2. Rename the project while the routine page retains its cached project
data.
3. Inspect the routine's project link. Before this change, it uses
`/projects/operations`. After this change, it uses
`/projects/<project-id>`.

## What Changed

- Use the project ID for the project link on the routine detail page.
- Add rendered-link regression tests for a rename, same-name projects,
and an unassigned routine.

## Verification

- Confirmed that the rename and same-name link tests fail before the
fix.
- All 24 focused tests pass across routine page, routine form, routine
list filtering, routine row selection, and company link routing.
- `pnpm --filter @paperclipai/ui typecheck`: passed after building the
fresh worktree's shared and plugin SDK dependencies.
- `node scripts/check-test-budget.mjs --files
ui/src/components/routine-page/RoutinePage.test.tsx`: passed.
- `pnpm verify`: passed on final head
`989dad85d8fc6dfe45cc4490e798dd8da1fb1ff1`. All 309 selected files
passed: 4,012 UI tests and 537 CLI tests passed, with one UI test
skipped. Environment: macOS arm64, Node 25.6.1, pnpm 9.15.4.
- Earlier attempts exposed missing Postgres package library symlinks in
the fresh worktree, then a run invalidated by changed setup inputs. Ran
the dependency's own symlink hydration script and repeated verification
on the stable final checkout. Those earlier attempts are not counted as
passes.
- CI
[typecheck](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142231921191),
[build](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142231921278),
and
[policy](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142231921302)
passed on the final head. All selected test and browser shards passed.
The final [verify
gate](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142233704075)
and [e2e
gate](https://github.com/paperclipai/paperclip/actions/runs/46527285069/job/142233695844)
passed on the same head.
- [Greptile
review](https://github.com/paperclipai/paperclip/pull/23332#issuecomment-7293910180):
5/5 on the final head, with no findings.
- No live tenant, deployment, or browser acceptance test was run. This
change only changes a link target.
- Reviewed the complete diff locally for secrets, personal data, and run
artifacts.

## Risks

Low risk. The project page already accepts project IDs and applies its
existing authorization and canonical URL handling. The link's visible
label stays the project name. There is no schema or API change. Revert
the link change to restore the former behavior.

## Model Used

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

## Checklist

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

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-30 14:35:46 -08:00
Devin FoleyandPaperclip 3884cc6df4 fix(ui): open Needs You on Assigned to you, keep saved filters (#23321)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The Coordinator Inbox (Needs You, `/decisions`) shows the decisions
and problems that wait for a person
> - #22964 made the page open on "All assignees" for a board member who
has no saved assignee choice
> - The page title and badge read as personal, so a board member sees
other people's decisions and thinks they are theirs to act on
> - This pull request opens the page on "Assigned to you" again when no
choice is saved, and keeps the saved toolbar from #22964
> - The benefit is that each person opens on their own work, and a board
member who wants the company-wide queue picks "All assignees" once and
keeps it

## Linked Issues or Issue Description

Refs #22964

**What existing behavior does this improve?**
The opening assignee filter on the Coordinator Inbox / Needs You page
(`/decisions`).

**Current behavior**
A board member with no saved assignee choice opens Needs You on "All
assignees". The page shows decisions that are for other people (for
example, a question an agent asked the person who created the task),
with no signal that the list is not personal.

**Proposed behavior**
Every person with no saved assignee choice opens Needs You on "Assigned
to you". The assignee, agent, project, and grouping choices stay saved
per company and person, as in #22964. A board member who picks "All
assignees" or one person still reopens on that choice.

**Reason and benefit**
A page named "Needs you" must open on the work that needs this person.
The saved toolbar already removes the repeated clicks that #22964 set
out to remove, so the company-wide default is not necessary.

## What Changed

- `ui/src/lib/coordinator-attention.ts`: `openingCoordinatorAssignee`
returns "Assigned to you" when no usable choice is saved, also for board
members. A saved choice that the person may open still wins.
- `ui/src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx`:
Tests now start from "Assigned to you", prove that "All assignees"
sticks after a person picks it, and prove that the page loads the
personal feed at once when nothing is saved. The board-access wait test
now covers a saved "All assignees" choice.
- `ui/src/lib/coordinator-attention.test.ts`: Update the unit
expectations for the opening filter.
- `tests/e2e/coordinator-inbox-views.spec.ts`: Assert "Assigned to you"
on open, then pick "All assignees" and prove that it and the grouping
persist across navigation and reload.
- `doc/PRODUCT.md`: Document the opening filter and the saved choices.

## Verification

- `cd ui && npx vitest run src/components/coordinator/
src/lib/coordinator-attention.test.ts
src/hooks/useAttentionViews.test.tsx src/lib/attention-views.test.ts` →
7 files, 49 tests passed.
- RED check: with the old `everyone ? "all" : "me"` fallback restored,
13 tests in the toolbar and coordinator-attention suites fail.
- `pnpm --filter @paperclipai/ui typecheck` → pass.
- `PAPERCLIP_E2E_PORT=3257 npx playwright test --config
tests/e2e/playwright.config.ts
tests/e2e/coordinator-inbox-views.spec.ts` against a freshly built UI →
2 passed (desktop and mobile).

## Risks

- Behavioral shift: board members who relied on the #22964 default open
on "Assigned to you" until they pick "All assignees" once. After that,
the saved choice applies.
- A board member who already picked a filter keeps it. No saved data
changes.
- The classic (non-Coordinator) Decisions page is unchanged.

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

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`) by Anthropic, in Claude Code with
tool use, shell execution, Vitest, and Playwright.

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-30 14:12:46 -08:00
Nicky LeachandClaude Opus 5.5 1949a8fa10 fix(onboarding): sign in through a plugin-managed execution environment (#23312)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Onboarding connects the first agent to an AI provider account, often
with a Claude or Codex subscription sign-in
> - A plugin can manage an execution environment whose driver declares
`supportsLoginPty` and `requiresAgent`. Each agent's lifecycle prepares
that environment for the agent, and the sign-in runs in it
> - An instance can make such a plugin-managed execution environment its
default
> - The onboarding wizard offered browser sign-in only in a
sandbox-driver environment, so it blocked the connect step in every
plugin-managed execution environment
> - The sign-in also cannot start until the agent's lifecycle has
prepared the environment
> - This pull request lets onboarding and the new-agent flow sign in
through a plugin-managed execution environment, after the environment is
prepared for the agent
> - The benefit is that subscription sign-in works when the default
environment is plugin-managed

## Linked Issues or Issue Description

Refs #22695 and #20906.

**What happened?**

The default environment is a plugin-managed execution environment whose
driver declares `supportsLoginPty`. A user starts onboarding and chooses
Claude or Codex with a subscription. The connect step shows "This
environment does not support browser sign-in. Go back to use an API key
or choose another model." Connect stays disabled.

**What did you expect to happen?**

The connect step starts a browser sign-in in the plugin-managed
execution environment for the onboarding agent. The agent configuration
form and the AI Connections page already do this for plugin-managed
environments.

**Steps to reproduce**

1. Install an environment plugin with a `requiresAgent` driver that
declares `supportsLoginPty`, and make its environment the instance
default.
2. Start onboarding for a new company.
3. Choose Claude or Codex, and keep the subscription option.
4. See the message above. Connect is disabled.

## What Changed

- The onboarding wizard and the new-agent flow use the shared
`environmentSupportsLoginPty` rule. Before, both flows had their own
sandbox-only check.
- In a plugin-managed execution environment, onboarding sends the
sign-in to its own setup agent (`requiresAgent` and `agentId` on
`AdapterLoginPanel`). The new-agent flow does the same with its draft
agent.
- Onboarding polls the setup agent until the environment can take the
sign-in for it: a Paperclip runner agent on the login environment in
`verifying` or `ready`. Until then the step shows "Preparing your
agent's computer…", the user-facing name for this environment. A failed
preparation shows the error and a "Retry preparation" button. A failed
agent read shows "Could not check your agent's computer." and retries
the read.
- The new-agent flow keeps the login panel unmounted until the
environment is prepared (`loginHostPending` on
`AgentProviderConnection`). The panel starts the sign-in on mount, and
the disabled fieldset does not stop that.
- Both flows latch the readiness per agent and environment
(`useAgentComputerLoginReady`). A configuration change sends the setup
draft through preparation again. That must not unmount a sign-in that is
already on screen.
- The auth-signal route now accepts a plugin-managed execution
environment for `claude_local` and `codex_local`, and answers `unknown`
there. Before, it returned 422, and the onboarding step stayed undecided
and never showed the sign-in. The signal reads only host-local state,
which says nothing about a plugin-managed environment.
- The new-agent flow now says "Preparing your agent's computer…", the
same as onboarding.
- Each part of the login PTY question now has one owner:
- Shared `environmentLoginRequiresAgent` decides whether a sign-in needs
an agent. The four UI flows and the server's login target resolver use
it instead of their own `driver === "plugin"` checks.
- Shared `isPluginEnvironmentLoginAdapter` and
`pluginEnvironmentLoginReadsCredential` decide which adapters sign in
through a plugin-managed execution environment, and which of them must
read the credential back. `environmentSupportsLoginPty` and the server's
login target resolver use them. The server's capability resolver takes
the adapter type instead of a credential-read flag.
- `sandboxProviderSupportsLoginPty` decides sandbox-provider support for
both the capability listing and the sign-in check.
- The credential read uses `pluginSupportsLoginPty`, like the rest of
the plugin login path. Before, it checked only the manifest flag and the
read method.
- The agent configuration form's gate is now the shared rule plus "not
in create mode when an agent is required". Its duplicate driver check
and an always-true condition are gone.

## Verification

- `pnpm typecheck` in `ui/` and `server/`: no errors.
- `npx vitest run src/lib/agent-computer-login.test.ts
src/lib/agent-computer-login.hook.test.tsx
src/components/new-agent/AgentProviderConnection.computer-login.test.tsx
src/components/new-agent/AgentProviderConnection.test.tsx` in `ui/`:
tests pass. The `AgentProviderConnection` sign-in test covers a slow
preparation, and the readiness hook test covers a re-preparation of the
same environment.
- `npx vitest run src/__tests__/adapter-auth-signal-routes.test.ts` in
`server/`: tests pass. The two new plugin-managed environment cases fail
without the route change.
- `pnpm typecheck` in `packages/shared/`: no errors. `npx vitest run
src/environment-support.test.ts` in `packages/shared/`: 9 tests pass.
- In `server/`: the device-login, setup-token, login-session runtime,
sandbox-capability, credential-read and OpenAPI route suites pass (159
tests). A new credential-read case refuses a driver that does not meet
the plugin login rule.
- In `ui/`: the `AgentConfigForm`, `AgentProviderConnection`,
`agent-computer-login` and onboarding analytics suites pass.
- I did not do a live onboarding with a real plugin-managed execution
environment. Reviewers who have such an instance can reproduce with the
steps above. Expect "Preparing your agent's computer…", then the
provider sign-in, then the hire.

## Risks

- Onboarding waits for the environment's preparation before a
subscription sign-in in a plugin-managed execution environment. A slow
preparation makes the connect step wait for that time. An API key or a
saved subscription does not wait.
- The latch keeps the sign-in on screen while a configuration change
prepares the same environment again. If the plugin refuses the sign-in
in that window, the sign-in panel shows its usual error and retry.
- The setup draft must resolve to the Paperclip runner in the
plugin-managed environment. If it does not, the step stays on "Preparing
your agent's computer…". Plugin-managed environments run only the
Paperclip runner, so this is not expected.
- No migration and no API contract change. The auth-signal route accepts
one more environment driver.
- The credential read now requires the full plugin login rule
(`creationOperationVersion` 1 and every login worker method). A plugin
that reaches the credential read already passed that rule when its login
lease was acquired, so no working plugin should change.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), with extended thinking and tool
use (code search, shell, tests) in Claude Code.

## Checklist

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

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:10:58 -08:00
Devin FoleyandPaperclip 554227d926 fix(analytics): send queued product events after consent (#23328)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Hosted workspaces record browser product events for the onboarding
funnel.
> - The wizard can open before a visitor accepts browser analytics.
> - The capture path discarded those events and did not send them after
Accept.
> - This pull request holds pending events in page memory until the
visitor accepts.
> - The funnel can then retain the original event order and times.

## Linked Issues or Issue Description

**What happened?**

A visitor could open onboarding, complete steps, and then accept
analytics. The earlier browser events were missing. The funnel could
show server events such as workspace entry without the later onboarding
events, even when the visitor used the wizard.

**Expected behavior**

Hold structured product events while consent is pending. Send them once
after Accept, with their original order and timestamps. Discard them
after Decline or a change of user. Do not load PostHog before consent.

**Steps to reproduce**

1. Open a hosted workspace that requires analytics consent, with no
stored choice.
2. Open onboarding and complete a step before choosing Accept.
3. Choose Accept.
4. Confirm that the opening and step events reach the analytics client
once, with their original timestamps.

**Paperclip version or commit**

The fix is based on master at `630cf042302`. The tested PR revision is
`46df54b9ede8e5757f7af1a9d41b3c3593fe3430`.

**Deployment mode**

Hosted workspace browser analytics. The regression runs locally in
jsdom.

Related merged work: #22186 added browser consent; #22814 added
onboarding failure and chat events; #23315 enabled draft saving in the
naming step. A search found no duplicate PR for this queue fix.

## What Changed

- Track pending, granted, and denied consent in the browser analytics
state.
- Reuse the existing 50-event queue while consent is pending. Flush it
on Accept, after the client is ready.
- Clear pending events on Decline or a change of user. Apply user
identity before sending the queue.
- Add regression tests for the Accept button, onboarding events, queue
limits, and user changes. Document the queue lifetime.
- Remove the retired Runner support assertion that draft saving is
limited to step 4. PR #23315 added saving in both naming and connect
steps. Retain the other first-agent checks and the existing early-setup
browser test for name persistence and draft reuse.

## Verification

Environment: macOS arm64, Node.js v25.6.1, pnpm 9.15.4. Final local
checks use revision `46df54b9ede8e5757f7af1a9d41b3c3593fe3430`.

- The Accept-button regression failed before the fix: it expected the
earlier events but received an empty capture list.
- `pnpm exec vitest run --project @paperclipai/ui ui/src/lib/analytics
ui/src/components/ProductAnalyticsGate.test.tsx
ui/src/components/ProductAnalyticsSetting.test.tsx`: passed, 289 tests
across 9 files.
- `pnpm exec vitest run --config tests/runner-e2e/vitest.config.ts
tests/runner-e2e/chat-catalog-domains/identity-new-company-native.test.ts`:
passed, 51 tests. This suite first reproduced the stale draft-step
assertion from the failed CI job.
- `pnpm --filter @paperclipai/ui typecheck`: passed.
- `node scripts/check-test-budget.mjs --files
tests/runner-e2e/chat-catalog-domains/identity-new-company-native.test.ts
ui/src/components/ProductAnalyticsGate.test.tsx
ui/src/lib/analytics/onboarding-analytics.test.tsx`: passed.
- `git diff origin/master...HEAD --check`: passed.
- `pnpm verify`: exited 2 because `doc/cloud-browser-analytics.md`
triggers broader CI coverage. Focused checks above passed; the full
local suite was not run.
- GitHub Actions CI: [all planned suites
passed](https://github.com/paperclipai/paperclip/actions/runs/46519983330/job/142210329280)
on `46df54b9ede8e5757f7af1a9d41b3c3593fe3430`, including [typecheck and
release
registry](https://github.com/paperclipai/paperclip/actions/runs/46519983330/job/142208788257),
[build](https://github.com/paperclipai/paperclip/actions/runs/46519983330/job/142208788273),
Runner support, general tests, serialized tests, and browser E2E shards.
No live PostHog capture was checked.

- Greptile: [5/5 on the current
revision](https://github.com/paperclipai/paperclip/pull/23328#issuecomment-7292786296),
with a successful check and no unresolved review threads.

## Risks

- Accept now sends structured product events generated earlier in the
same page visit. Nothing is sent while consent is pending.
- The queue retains at most 50 events in memory. Further events are
dropped until it drains. Reloading the page loses the pending queue.
- This change does not record earlier page views or session replay.
PostHog still loads only after consent.

## Model Used

OpenAI `gpt-6.1-sol`, through the Codex harness in T3 Code, with xhigh
reasoning effort and shell/code tools. The harness does not expose the
context window size.

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-30 13:56:12 -08:00
Nicky LeachandClaude Opus 5.5 630cf04230 feat(onboarding): create the first agent's setup draft in the naming step (#23315)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Onboarding creates a company, names its first agent, and then
connects the agent to an AI provider
> - A plugin can manage an execution environment that its driver
prepares for each agent (`requiresAgent`). The agent's lifecycle starts
that preparation when the agent's setup draft exists
> - Onboarding created the setup draft when the connect step opened,
after the agent was named
> - The preparation can be slow, and a subscription sign-in in that
environment waits for it
> - This pull request creates the setup draft in the naming step, so the
preparation overlaps naming
> - The benefit is a shorter wait before sign-in when the default
environment is plugin-managed

## Linked Issues or Issue Description

Refs #23312.

**What existing behavior does this improve?**

The onboarding naming step and the connect step for a new company.

**Current behavior**

The wizard creates the first agent's provisional setup draft when the
connect step opens. A plugin-managed execution environment starts its
preparation for the agent only then. A subscription sign-in in that
environment waits for the full preparation (see #23312).

**Proposed behavior**

The wizard creates the same provisional setup draft when the naming step
opens for a company with no agents. The preparation runs while the user
names the agent.

**Reason and benefit**

The preparation does not depend on the provider choice. A later
configuration change prepares the same environment again, which is fast
because the environment already exists. The user waits less before
sign-in.

## What Changed

- The naming step creates the provisional setup draft as soon as a
company with no agents exists. The draft is the same record the connect
step created before: a provisional adapter, `setupAdapterPending`, and
the role label as a placeholder name.
- The naming step saves the typed name to the draft after a 400 ms pause
in typing. The connect step saves it at once, as before.
- A company that has agents keeps the old path, so the connect step's
same-name reuse still applies. A failed early create also falls back to
the connect step. The wizard tries the early create once per company.
- When the connect step restores a provisional draft (source still
pending), the wizard keeps its own name, role and appearance when it has
a name. A name typed after a reload in the naming step is newer than the
draft's name.
- The `create-company path` e2e test now expects the draft when the
naming step opens. A new e2e test covers the early draft, the saved
name, a reload in the naming step, and that the connect step adopts the
same record.

## Verification

- `pnpm typecheck` in `ui/`: no errors.
- `PAPERCLIP_PLAYWRIGHT_CHANNEL=chrome npx playwright test --config
tests/e2e/playwright.config.ts tests/e2e/onboarding-early-setup.spec.ts
tests/e2e/onboarding.spec.ts -g "naming step creates|create-company
path"`: 2 tests pass.
- The new `onboarding-early-setup` test fails without the wizard change:
it times out while it waits for the draft in the naming step.
- I did not measure the time saved on a live plugin-managed execution
environment. It is about the time the user spends in the naming step.

## Risks

- A user who stops onboarding in the naming step leaves a setup draft.
In a plugin-managed execution environment, that draft also keeps its
prepared environment. Before this change, the same happened to a user
who stopped in the connect step.
- The draft's name is the role label until the first save in the naming
step. A reload in the first 400 ms after typing can lose those
characters. The wizard keeps the name that is typed after the reload.
- No migration and no API change.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), with extended thinking and tool
use (code search, shell, tests) in Claude Code.

## Checklist

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

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 13:34:23 -08:00
Nicky LeachandClaude Opus 5.5 79ef767578 fix(ui): hide startup steps too short to name and hold labels long enough to read (#23299)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The task view names each startup stage of a run until the agent
works, for example "Preparing workspace" or "Starting agent".
> - Core and environment plugins report every startup step as it starts,
however short, and the task view decides which labels to show.
> - The view held each label for 500 ms and showed every change at once.
A step of a few milliseconds that started after a longer step appeared
at once and stayed up after it ended. Also, 500 ms is less than the time
most labels take to read.
> - This pull request adds a short show delay, so that steps too short
to name never appear, and holds each shown label for its reading time.
> - The benefit is a status line that changes only for steps that last,
and stays up long enough to read.

## Linked Issues or Issue Description

No public issue exists. Follows #22956, which added the startup stage
labels.

**Subsystem affected**
Task chat UI: the startup stage line of a running turn
(`ui/src/components/task-chat`).

**Problem or motivation**
A startup step that lasts a few milliseconds can show its label for 500
ms after the step ended. For example, a short "Connecting tools" step
inside a long "Starting agent" step changes the line twice. Also, the
500 ms hold is shorter than the time needed to read most labels.

**Proposed solution**
Use the common loading-indicator pattern of a show delay plus a minimum
display time. Base the minimum time on reading time:
- A new stage's label shows only after the stage stays current for 300
ms.
- A shown label stays up for 50 ms per character (20 characters a
second, the usual adult subtitle reading speed), and at least
five-sixths of a second (the usual subtitle minimum).

**Alternatives considered**
- Only a minimum display time (the current behavior). This prevents
flicker, but short steps still show and stay up after they end.
- Hide steps in the reporter. This would put a display rule in each
reporter. Reporters report every step, and the view decides what to
show.

## What Changed

- `useHeldLabel` shows a new label only after it stays current for
`STARTUP_LABEL_SHOW_DELAY_MS` (300 ms). Labels that come and go within
that time never show.
- A shown label stays up for `startupLabelHoldMs(label)`: the greater of
833 ms and 50 ms per character. Today's labels stay up for 0.83 s to
0.95 s.
- The end of startup (no label) has no show delay. The last label is
still held so that it can be read. Agent activity replaces the line as
before.
- The first label shows at once. A task opened during startup can show a
stage that is already old, and `Thinking` in its place would be wrong.
- `DESIGN.md` describes the show delay, the reading-time hold, and the
first label.

## Verification

- `npx vitest run src/components/task-chat/run-startup-stage.test.ts` in
`ui`: 9 tests pass. They cover the first label, the hold per label, the
show delay, a short step inside a longer one, a skip to the latest
stage, a longer hold for a longer label, and the end of startup.
- `npx vitest run src/components/TaskChatThread.test.tsx -t "startup
stage"` in `ui`: the startup stage thread tests pass.
- `pnpm --filter @paperclipai/ui typecheck` passes.
- CI runs the full suite.

## Risks

- Low risk. This changes display timing only.
- Each new label shows 300 ms later than before. A shown label can stay
up for up to about 0.65 s after its step ends, if the step is just
longer than the show delay.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use
(shell, file edits, web research).

## Checklist

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

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 10:03:46 -08:00
Nicky LeachandClaude Opus 5.5 1a726eaccf feat(ui): name a run's startup stage instead of Thinking (#22956)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The task view's runner turn shows a status header and a
current-activity line while an agent works.
> - From the claim until the agent's turn starts, that line says
"Thinking", even while the run acquires its environment, restores its
session or connects tools.
> - The stacked pull request below this one makes the server publish
each run's startup stage.
> - This pull request shows "Getting ready" from message submission,
then the server's stage after the claim, instead of "Thinking". It holds
each shown stage briefly so fast steps do not flicker.
> - The benefit is that a person can see why a turn has not started yet.

## Linked Issues or Issue Description

No public issue exists. Stacked on #22953, which adds the server side.

**Subsystem affected**
Task chat runner turn (`ui/src/components/task-chat`), live run updates
(`ui/src/context/LiveUpdatesProvider.tsx`) and `DESIGN.md`.

**Problem or motivation**
A cold start can spend many seconds on setup before the agent's first
event. The activity line says "Thinking" for all of it, so a slow start
looks like a slow model.

**Proposed solution**
Start a queued turn on "Getting ready", which is also the server's first
stage after the claim, so the line does not change at the claim. Then
name the server's startup stage until the agent's turn starts. Keep the
header and the 30-second "Waiting to start" rule as they are.

**Alternatives considered**
A trailing debounce (show a stage only after it lasts some time). It
delays every stage by the same amount and still cannot tell whether a
step will continue. This change shows each stage at once and only holds
a shown stage for a minimum time.

## What Changed

- `run-startup-stage.ts` (new): the stage labels (`Getting ready`,
`Waking up`, `Preparing workspace`, `Restoring session`, `Connecting
tools`, `Starting agent`, and `Resuming session` for a resumed provider
session) and `useHeldLabel`. A changed label shows at once when the
current one has been visible for 500 ms. Otherwise the latest label
shows when the 500 ms end, and labels in between are skipped.
- `TaskChatRunnerTurn`: the current-activity line of a queued turn shows
"Getting ready" instead of "Thinking", from message submission. A
running (claimed) run shows the held server stage. Stages shimmer like
"Thinking". Named holds (for example waiting for a provider) still win,
and a turn still queued after 30 seconds with no named hold still says
"Waiting to start". The header keeps "Working". "Thinking" begins when
the agent's turn starts.
- `TaskChatThread`: passes the live run's `startupStage` and
`startupSessionResumed` to the runner turn.
- `LiveUpdatesProvider`: the `heartbeat.run.startup_stage` event patches
cached runs. It drops unknown stages and does not refetch.
- `DESIGN.md`: a queued turn's activity line is now "Getting ready"
instead of "Thinking", and a new paragraph next to the queued-turn rule
describes the stages.

## Verification

- `npx vitest run src/components/task-chat/run-startup-stage.test.ts`:
labels, immediate change after the hold, the hold and skip to the latest
label, the return to the default, and an undone change.
- `npx vitest run src/components/TaskChatThread.test.tsx`: a claimed run
shows its stage and keeps the "Working" header, a resumed session shows
"Resuming session", agent activity replaces the stage, and a queued run
shows no server stage. The existing admission tests now expect "Getting
ready" where they expected "Thinking", and the mounted-through-startup
test checks that the line stays "Getting ready" across the claim. The
two tests that check for no startup feedback also reject "Getting
ready".
- `npx vitest run src/context/LiveUpdatesProvider.test.ts`: the event
becomes a cache patch and unknown stages are dropped.
- `npx vitest run src/components/TaskChatThread.test.tsx
src/components/IssueChatThread.test.tsx src/components/task-chat`: 932
tests pass. `pnpm --filter @paperclipai/ui typecheck` passes.
- CI runs the full suite.

## Risks

- Low risk. The change is presentation only. If the server sends no
stage (an older server, or after a restart), the line shows "Thinking"
as before.
- Queued turns now say "Getting ready" instead of "Thinking" during
admission. The 30 second grace, the "Waiting to start" rule and named
holds are unchanged.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use
(shell, file edits).

## Checklist

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

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:22:08 +00:00
Tonio bc98abda0c Keep onboarding subscription instructions plain (#23274)
## Thinking Path

> - Paperclip connects agents to models.
> - People choose a subscription during onboarding.
> - The panel has a sign-in button and instructions.
> - A second link appeared inside the instructions while waiting.
> - The requested design keeps the instructions plain and the actions on
buttons.

## Linked Issues or Issue Description

**Subsystem affected**

Subscription onboarding for Claude and OpenAI. Refs #23268 and #23270.

**Current behavior**

The waiting instructions contain a link to the provider.

**Proposed behavior**

Use plain text for both instructions. Open provider sign-in from the
button. Keep the waiting button disabled and offer Retry when the
attempt ends.

## What Changed

Removed the waiting instruction link. Made the sign-in pill a native
button. Use the published code deadline to show expiry even if the
status poll misses the timeout. Updated the wizard tests.

## Verification

All 25 login card and form tests passed locally. Both provider cases
check the waiting state for links.

## Risks

Closing the provider tab while waiting means the user must return to the
provider tab, go Back, or wait to retry.

## Model Used

OpenAI GPT-6 with Codex repository and test tools.

## Checklist

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

> - Paperclip connects agents to model providers.
> - Onboarding starts a device login for OpenAI.
> - The login starts its session clock before it acquires a sandbox.
> - The command must stop by the deadline shown for the session.
> - The wizard can then offer a fresh code when that session expires.

## Linked Issues or Issue Description

**Subsystem affected**

Subscription onboarding and displayed-code login. Refs #23268.

**Current behavior**

An unattended OpenAI login can show a generic failure at expiry.

**Proposed behavior**

Use the session deadline and show the same expiry message as Claude.
Show “Waiting…” for OpenAI and “Waiting for code…” for Claude.

## What Changed

Bound the command timer to the remaining session lifetime. Arm the host
timer before the command can schedule its own timeout. Keep the outcome
fixed during cleanup. Updated the OpenAI waiting label.

## Verification

All 79 tests in the device login service, runner, and login card suites
passed. These cover delayed sandbox setup, failure before expiry, and
timeout at the deadline.

## Risks

Early command failures still need their own failure state. The change
preserves those failures and explicit cancellation.

## Model Used

OpenAI GPT-6 with Codex repository and test tools.

## Checklist

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

> - Paperclip helps people manage AI agents.
> - Onboarding connects an agent to a model.
> - Users open the provider sign-in from the connection card.
> - The card should show when the provider is waiting and how to recover
after a timeout.
> - This change keeps both actions in the same place.

## Linked Issues or Issue Description

**Subsystem affected**

Model connection during first-agent onboarding. Related work includes
#23255 and #6636.

**Current behavior**

The sign-in link remains active after opening the provider. Retry
appears in the footer.

**Proposed behavior**

Show a waiting label beside the code. Offer retry inside the card when
sign-in expires. Keep Next disabled during these states.

## What Changed

- Show the provider-specific waiting label after opening sign-in.
- Show a retry action and saved-setup message in the card.
- Cover both providers and the reset after retry.

## Verification

- Ran the UI typecheck.
- Ran the adapter login card and local login tests. All 33 passed.

## Risks

Local and hosted sign-in expose retry through different handlers. This
change keeps the existing session handlers.

## Model Used

OpenAI GPT-6 with Codex repository and test tools.

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-30 07:30:05 +00:00
TonioandPaperclip e55b475f30 Polish the onboarding model connection cards (#23255)
## Thinking Path

> - Paperclip helps people manage AI agents.
> - Onboarding connects the first agent to a model provider.
> - Both subscription flows ask the user to complete an authorization
step.
> - Moving that action into the provider card keeps the footer stable.
> - The updated cards also keep their spacing through loading and mode
changes.

## Linked Issues or Issue Description

**Subsystem affected**

First-agent onboarding.

**Current behavior**

The sign-in action changes the footer label during connection. Switching
credential modes shifts the layout.

**Proposed behavior**

Show the provider sign-in action beside its code. Keep Next disabled
while connecting. Advance after verification.

## What Changed

- Align the Claude and OpenAI code controls, instructions and provider
marks.
- Reserve the loaded card height and animate the API controls together.
- Update the standalone walkthrough with simulated provider approvals.

## Verification

- Browser walkthroughs covered both simulated approvals and automatic
advance to Review before integration with master.
- Measured equal loading and ready heights, API field spacing, and
mode-switch positions in the local preview.

- On revision `7c07c13c5f`, UI typecheck passed, 31 focused tests
passed, and the Chromium Claude paste-to-chat journey passed.

## Risks

Local and hosted login use different retry paths. Check both during
review.

## Model Used

OpenAI Codex, GPT-6, with repository and browser tools.

## Checklist

- [x] Included project context, issue description, verification scope
and risks.
- [x] Described the model and tools used.
- [x] Checked the roadmap for overlapping onboarding work.
- [ ] Verify final revision in CI and resolve review feedback.
- [x] I have searched GitHub for duplicate or related PRs and linked
them above

Related prior work includes #19557 and #13499.

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-30 05:42:22 +00:00
DottaandPaperclip c57471459f feat(responsibilities): add routine filter and routine agent avatars (#23159)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The experimental Responsibilities dashboard (`outline_v2`) lists a
person's areas and responsibilities as a clean outline.
> - Today, operators cannot filter the Responsibilities outline by
whether a responsibility has routines, and rows do not show which agents
are assigned to those routines.
> - Operators need a quick visual signal of which responsibilities
already have agent-run routines and a fast way to focus on
responsibilities with or without routines.
> - This pull request adds `routineAgentIds` to `ResponsibilityRollup`,
adds the shared toolbar filter icon with "Has routines" and "No
routines" options (defaulting to either), and displays slightly
overlapping agent avatars on the right side of responsibility rows that
have assigned routines.
> - The benefit is faster scanning of routine coverage across
responsibilities without leaving the outline view.

## Linked Issues or Issue Description

**What existing behavior does this improve?**
The Responsibilities dashboard (`outline_v2` view at
`/<prefix>/responsibilities`) and the `ResponsibilityRollup` response
returned by `GET /api/companies/:companyId/responsibilities`.

**Subsystem affected**
Cross-cutting (multiple of the above)

**Current behavior**
The Responsibilities dashboard header shows only a search box, total
counts, and the New area button. Each responsibility row shows only its
bar sentence or title, with no visual indicator of which agents are
assigned to its routines and no filter to narrow by routine presence.

**Proposed behavior**
The header adds the shared toolbar Filter icon button beside the search
box, opening a popover with "Has routines" and "No routines" options
(both unchecked by default so either is shown) and a Clear action. Each
responsibility row with one or more non-archived routines assigned to
agents displays those agents' avatars slightly overlapping on the right
side of the row (up to 4 avatars with a `+N` overflow indicator and a
tooltip listing agent names).

**Reason and benefit**
Operators scanning their responsibilities need to see at a glance which
responsibilities already have agents running routines and quickly filter
to responsibilities that still need routines set up (or only those with
routines).

**Breaking changes**
Additive field `routineAgentIds: string[]` added to
`ResponsibilityRollup`. Existing callers ignore unknown fields.

## What Changed

- Added `routineAgentIds: string[]` to `ResponsibilityRollup` in
`packages/shared/src/types/responsibility.ts` and refreshed the pinned
hash in `tests/runner-e2e/source-sdk-public-inputs.json`.
- Updated `responsibilityService.computeRollups` and
`buildResponsibilityRollup` in `server/src/services/responsibilities.ts`
to select `routines.assigneeAgentId` (ordered deterministically by title
and id) and deduplicate non-null assignees across non-archived member
routines (direct and project-linked) with no extra queries.
- Added `OutlineV2RoutineFilter` and `filterOutlineV2Groups` in
`ui/src/lib/responsibility-outline-v2.ts`.
- Added the shared toolbar `Filter` icon popover ("Has routines" / "No
routines", default either) and live filtered counts to
`ui/src/pages/Responsibilities.tsx`.
- Updated `ui/src/components/responsibilities/DashboardOutlineV2.tsx` to
filter groups, unfold matching areas while filtered, show an empty-match
state with a Clear filter button, and render slightly overlapping
routine-agent avatars (`size={20}`, `-space-x-1.5`, capped at 4 with
`+N`) on the right side of each row that has routines with assigned
agents.
- Added unit, embedded-Postgres integration, jsdom UI, and Storybook
coverage (`server/src/__tests__/responsibilities-rollup.test.ts`,
`server/src/__tests__/responsibilities.test.ts`,
`ui/src/lib/responsibility-outline-v2.test.ts`,
`ui/src/components/responsibilities/DashboardOutlineV2.test.tsx`,
`ui/src/pages/Responsibilities.outline-v2.test.tsx`, and
`ui/storybook/stories/activity/responsibilities.stories.tsx`).

## Verification

- `pnpm --filter @paperclipai/shared build` — passed.
- `pnpm --filter @paperclipai/server typecheck` — passed (all 7 layers).
- `pnpm --filter @paperclipai/ui typecheck` — passed.
- `pnpm check:token-gates` — passed (all 4 gates clean).
- Focused Vitest suites (194 tests across 10 files) — passed:
  - `server/src/__tests__/responsibilities-rollup.test.ts` (18/18)
- `server/src/__tests__/responsibilities.test.ts` (37/37, embedded
PostgreSQL)
- `server/src/__tests__/responsibility-summaries.test.ts`,
`responsibility-summary-generator.test.ts`,
`responsibility-tools.test.ts`
- `ui/src/lib/responsibilities.test.ts` (41/41),
`responsibility-views.test.ts` (35/35),
`responsibility-outline-v2.test.ts` (15/15)
- `ui/src/components/responsibilities/DashboardOutlineV2.test.tsx` (2/2)
  - `ui/src/pages/Responsibilities.outline-v2.test.tsx` (1/1)
- Manually verified live Storybook preview (`Dashboard view: Outline v2,
routine avatars & filter`) in dark mode across default, "Has routines",
"No routines", and "Clear" states, confirming avatar overlap for 1, 2,
and 3 agents and empty states for rows without routines.
- Note: `pnpm verify` exited with code `2` because
`tests/runner-e2e/source-sdk-public-inputs.json` changed; CI supplies
the full broad suite.

## Risks

- Low risk. `routineAgentIds` is computed from the existing
`memberRoutines` query in `computeRollups` (adding one column selection
and deterministic ordering, no new queries or schema migrations).

## Model Used

- Google Gemini 4 Neon (High) via Antigravity with tool use and code
execution.

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-28 12:53:18 +00:00
DottaandPaperclip 99203b9f95 fix(ui): add mobile contextual navigation, drawer escape, and shell nav polish (#23047)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The board UI uses contextual sidebars in `Layout` to switch sections
on Agent Detail, App Detail, Chat Endpoint Detail, Apps developer tools,
Agent Chat, and Company Settings pages.
> - On mobile viewports (`< 768px`), `Layout` hides the adjacent
secondary sidebar without rendering an inline section switcher for most
contextual routes, traps the mobile drawer inside the contextual sidebar
without a Workspace back path, leaks a half-masked `MobileBottomNav`
beside the open drawer, overlaps the `MobileBottomNav` unread badge over
the icon center, and misaligns the `PageTabBar` native `<select>`
chevron while dropping readable text from JSX tab labels.
> - Operators on mobile cannot reach agent configuration views
(`Identity`, `Harness / Runtime`, `Secrets & variables`, `Permissions /
Trust`, `Advanced`, `Activity`, `Runs`, `Costs`, `Budgets`, and plugin
`detailTab` slots) or leave contextual drawers cleanly.
> - This pull request adds inline mobile section switchers for all
contextual-sidebar routes, adds a non-trapping `Workspace | <Section>`
switcher to the mobile drawer, fixes `MobileBottomNav` badge alignment
and drawer z-index layering, adds `companySettingsPluginSlots` support
to `CompanySettingsNav`, and fixes `PageTabBar` mobile `<select>`
chevron alignment and JSX `<option>` text extraction.
> - The benefit is full mobile navigation parity across agent
configuration and contextual shell surfaces without breaking desktop
layouts.

## Linked Issues or Issue Description

**What happened?**

On mobile viewports (`< 768px`), opening an Agent Detail page
(`/agents/:agentId/overview`) showed no on-page tabs for the 10 built-in
views or plugin `detailTab` slots, and opening the mobile sidebar drawer
replaced global Workspace navigation with only the agent links and no
back link. The same inline-nav gap affected `AppDetail`,
`ChatEndpointDetail`, `AppsSidebar`, and `AgentChat`. In addition,
`CompanySettingsNav` omitted `companySettingsPluginSlots`, `PageTabBar`
stretched its mobile `<select>` wrapper inside `<Tabs>` so the
`<ChevronDown>` icon floated on the far right while falling back to raw
values for JSX labels, and `MobileBottomNav` overlapped two-digit unread
badges over the Inbox icon while peeking out beside the open mobile
drawer.

**Expected behavior**

Mobile operators see an accessible inline section switcher on Agent
Detail (all 10 built-in views plus plugin `detailTab` slots),
`AppDetail`, `ChatEndpointDetail`, `AppsSidebar`, and `AgentChat`.
Opening the mobile drawer always provides immediate access to global
Workspace navigation and cleanly layers above `MobileBottomNav`.
`CompanySettingsNav` aligns with `CompanySettingsSidebar` including
plugin settings slots and `/company/export`. `PageTabBar` aligns its
chevron inside the `<select>` box and renders readable plain text from
JSX tab labels. `MobileBottomNav` places unread counts cleanly at the
top-right corner of the icon.

**Steps to reproduce**

1. Resize the board UI to a mobile viewport (`390x844`, `< 768px`).
2. Open an Agent Detail page (`/agents/:agentId/overview`), an App
Detail page, a Chat Endpoint Detail page, an Agent Chat page, and
Company Settings.
3. Observe missing inline section controls on contextual routes, the
trapped mobile drawer, the misaligned `PageTabBar` chevron, and the
overlapping `MobileBottomNav` unread badge and open-drawer layering.

**Paperclip version or commit**

`85ad16b47e` (`master`)

**Deployment mode**

Local dev (`pnpm dev`) / Storybook responsive verification

## What Changed

- Added reusable token-backed `MobileContextualNav`
(`ui/src/components/MobileContextualNav.tsx`) with horizontal scroll,
group dividers, active pill auto-scroll, and optional danger/secondary
badges.
- Added `AgentContextualMobileNav`
(`ui/src/components/AgentContextualSidebar.tsx`), `AppDetailMobileNav`
(`ui/src/components/AppConnectionSidebar.tsx`), `ChatDetailMobileNav`
(`ui/src/components/chat/ChatDetailSidebar.tsx`), `AppsMobileNav`
(`ui/src/components/AppsSidebar.tsx`), and `mobileSwitcher` mode on
`AgentConversationsSidebar` / `AgentConversationSidebar` so all
contextual-sidebar routes render inline mobile navigation below
`BreadcrumbBar` in `Layout.tsx`.
- Updated `Layout.tsx` mobile drawer to never trap users: routes with
inline mobile nav default the drawer to global `<Sidebar>`, all
contextual routes expose a `Workspace | <Section>` switcher (with `←
Workspace` when viewing the contextual pane), and the drawer backdrop
(`z-40`) and drawer (`z-50`, `inert` when closed) mount at shell root
after `MobileBottomNav` (`z-30`, `visible={mobileNavVisible &&
!sidebarOpen}`).
- Updated `MobileBottomNav.tsx` badge positioning (`-top-1.5 left-3
min-w-4`) so two-digit (`96`) and `99+` badges anchor to the top-right
edge and expand outward without covering the icon center.
- Updated `CompanySettingsNav.tsx` to match `CompanySettingsSidebar.tsx`
ordering and routes (including `/company/export`) and to render and
match `companySettingsPluginSlots`.
- Updated `PageTabBar.tsx` mobile `<select>` wrapper (`w-fit max-w-full
self-start` + `w-full appearance-none bg-none`) to eliminate stray
far-right and duplicate chevrons, and added `extractTabOptionText` to
extract readable text from JSX `item.label` nodes.
- Removed unused `PageTabBar` and `Tabs` imports in
`ui/src/pages/AgentDetail.tsx` and added `flex-wrap` to the left-agent
membership notice banner.
- Added responsive mobile Storybook views (`AgentOverviewMobile`,
`AgentRuntimeMobile` in `agent-persona-pages.stories.tsx`;
`MobileSettingsAndBottomNav`, `MobileAgentDrawerOpen` in
`navigation-layout.stories.tsx`) and 5 new Vitest unit/component suites.

## Verification

- Targeted Vitest (`pnpm --filter @paperclipai/ui exec vitest run
src/components/PageTabBar.test.tsx
src/components/access/CompanySettingsNav.test.tsx
src/components/MobileBottomNav.test.tsx
src/components/MobileContextualNav.test.tsx
src/components/Layout.mobile.test.tsx src/lib/shell-navigation.test.ts
src/pages/agent-detail-navigation.test.ts
src/pages/apps/apps-rail.test.ts src/context/SidebarContext.test.tsx
src/lib/mobile-nav-scroll.test.ts
src/components/contextual-sidebar-styles.test.ts`): 11/11 files, 38/38
tests passed.
- Replay masking check (`pnpm --filter @paperclipai/ui exec vitest run
src/lib/analytics/replay-masking.test.tsx`): 220/220 tests passed.
- Typecheck (`pnpm --filter @paperclipai/ui typecheck`): passed with 0
errors.
- Design token gates (`pnpm check:token-gates`): all 4 gates CLEAN and
cliplab character in sync.
- Storybook catalog and map checks (`node scripts/storybook-catalog.mjs
--check && node --test scripts/check-maps.test.mjs
scripts/storybook-catalog.test.mjs
scripts/storybook-feature-index.test.mjs`): passed (372 files, 3490
stories; 30/30 tests passed).

## Risks

- Low risk: desktop layouts (`isMobile === false`) and desktop
sidebar/rail behavior remain unchanged.
- On mobile, hiding `MobileBottomNav` while `sidebarOpen` is true uses
the existing `data-visible="false"` + `inert` transition while
preserving `--tc-composer-bottom` so background page content does not
shift when opening or closing the drawer.

## Model Used

- Model Used: Gemini 4 Neon (High) — agentic coding assistant with
reasoning, code editing, shell execution, and local test verification.

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-27 14:00:55 +00:00
DottaandPaperclip 26c72ed7ca fix(ui): polish mobile tables, popovers, PageTabBar callers, and settings (#23048)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Operators use the board UI on mobile viewports (`390x844`) to
inspect routines, members, costs, projects, dashboards, skills, and
settings
> - Wide tables overflowed the page horizontally, several `PageTabBar`
callers omitted `value`/`onValueChange` (breaking their mobile section
dropdowns), `w-96` popovers and floating save bars clipped or overlapped
the bottom nav, and key controls were hover-only or cramped on narrow
screens
> - Mobile operators could not scroll clipped columns, switch sections,
switch diff files, or tap hidden row actions on phones
> - This pull request constrains table scrollers and flex/grid
ancestors, wires all missing `PageTabBar` mobile callbacks, caps wide
popovers and floating save bars using existing viewport tokens, polishes
narrow layouts across collections and settings, and adds 390×844
Storybook views and Vitest regressions
> - The benefit is clean mobile layout without horizontal page overflow
and working touch controls across tables, tabs, popovers, dashboards,
and settings

## Linked Issues or Issue Description

Related mobile responsiveness PRs: #23045, #23046, #23047.

**What happened?**
On mobile viewports (`< 768px`, tested at `390x844`):
- Wide tables in Routines, Members, Costs, Connections, and tool profile
views caused horizontal page overflow or permanently clipped columns
(`overflow-hidden`).
- `AuditHub`, `Costs` (Providers/Billers), `Approvals`, `Inbox`, and
`LegacyInbox` omitted `value` and/or `onValueChange` on `PageTabBar`,
bypassing its mobile `<select>` section switcher.
- `w-96` popovers in `RoutinePage` and `WorkspaceServiceControlBar`
overflowed narrow viewports; the `CompanySkills` diff dialog hid its
file picker on `< md` and its floating save bar overlapped
`MobileBottomNav`.
- `ProjectDetail` task toolbars crushed the search field on `< sm`,
`Dashboard` charts rendered 2 cramped columns with uneven metric card
heights, `Agents` hid row `Chat` buttons on touch devices, and `Inbox`
hid nesting controls on `< sm`.

**Expected behavior**
Every collection, table, popover, dashboard, and settings screen stays
within the mobile viewport (`scrollWidth <= innerWidth`), wide tables
scroll horizontally inside their containers, mobile `PageTabBar`
dropdowns switch sections cleanly, and touch users can reach all row
actions, diff files, and nesting controls.

**Steps to reproduce**
1. Open the board UI at `390x844` (or the added Storybook `*Mobile`
stories).
2. Navigate to Routines, Settings → Members, Settings → Profile, Audit →
Costs, Approvals, Project Detail, Dashboard, and Company Skills diff
view.
3. Observe horizontal overflow, missing mobile tab switchers, hidden
diff file picker, and cramped toolbars/charts prior to this change.

**Paperclip version or commit**
`85ad16b47e` (`master`)

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

## What Changed

- **Horizontal table scroll containment & ancestor constraints**:
- Wrapped and constrained tables plus flex/grid ancestors
(`overflow-x-auto max-w-full`, `min-w-0`) in `RoutineTable.tsx`,
`Routines.tsx`, `CompanyAccess.tsx`, `CostByUserTable.tsx`, `Costs.tsx`,
`ProfileSettings.tsx`, `Connections.tsx`, `AgentToolsTab.tsx`,
`RoutineHistoryTab.tsx`, `RoutineVariablesEditor.tsx`,
`ProfilesTab.tsx`, `ProfileDetail.tsx`, `ProfilesIndex.tsx`, and
`SmokeLabTab.tsx`.
- Fixed `ProfileSettings.tsx` avatar upload `<label>` sizing
(`inline-block w-fit`) so the camera badge stays anchored to the avatar
circle.
- **Wired missing `PageTabBar` mobile callbacks**:
- Passed `value` and `onValueChange` to `PageTabBar` in `AuditHub.tsx`,
`Costs.tsx` (Providers and Billers), `Approvals.tsx`, `Inbox.tsx`, and
`LegacyInbox.tsx`.
- **Popovers & floating bars**:
- Capped `w-96` popovers in `RoutinePage.tsx` and
`WorkspaceServiceControlBar.tsx` with `max-w-(--sz-calc-4)` and wrapping
footer rows.
- Added a mobile file `<select>` (`md:hidden`) in the
`CompanySkills.tsx` version diff dialog and lifted its floating save bar
above `MobileBottomNav` (`bottom-20 md:bottom-6 max-w-(--sz-calc-4)
flex-wrap`).
- **Touch visibility & responsive layout polish**:
- Switched `ProjectDetail.tsx` task lists to
`toolbarPresentation="collection"` so the toolbar wraps cleanly on `<
sm`, and added `flex-wrap` to its left-membership notice banner.
- Made the `Agents.tsx` inline row `Chat` button touch-visible via
`pointer-coarse:opacity-100`.
- Exposed mobile parent-child nesting toggle and row expand chevrons in
`Inbox.tsx` and `LegacyInbox.tsx`.
- Stacked `Dashboard.tsx` chart cards to `grid-cols-1 sm:grid-cols-2`
and aligned the 2×2 summary metric cards with `auto-rows-fr
items-stretch`.
- Added responsive wrapping and width caps in `CompanySettings.tsx`,
`Secrets.tsx`, `SkillStudio.tsx`, `GrokBotSetupContent.tsx`, and
`ActionTestDialog.tsx`.
- **Storybook & Vitest coverage**:
- Added 390×844 mobile Storybook views for Routines
(`RoutinesListMobile`, `RoutineDetailMobile`), Members
(`MembersMobile`), Costs (`CostsMobile`), ProjectDetail
(`ProjectDetailMobile`), CompanySettings (`CompanySettingsMobile`), and
Dashboard (`DashboardMobile`).
  - Added `ui/src/pages/mobile-collections-responsive.test.tsx`.

## Verification

- `pnpm exec vitest run
ui/src/pages/mobile-collections-responsive.test.tsx
ui/src/pages/CompanyAccess.test.tsx ui/src/pages/Dashboard.test.ts` — 3
files, 35/35 passed
- `pnpm --filter @paperclipai/ui typecheck` — passed (0 errors)
- `pnpm check:token-gates` — all 4 gates CLEAN + cliplab character in
sync
- `node scripts/storybook-catalog.mjs --check` — passed (373 files, 3494
stories)
- `node --test scripts/check-maps.test.mjs
scripts/storybook-catalog.test.mjs
scripts/storybook-feature-index.test.mjs` — 30/30 passed

## Risks

- Low risk: layout-only responsive class updates, missing prop wiring on
`PageTabBar` callers, and additive mobile Storybook stories/tests.
Desktop breakpoints (`sm:` / `md:` / `lg:` / `xl:`) preserve existing
layouts.
- Several edited pages (`CompanySkills.tsx`, `Inbox.tsx`,
`LegacyInbox.tsx`, `Secrets.tsx`, `SkillStudio.tsx`, `Costs.tsx`,
`ProfilesTab.tsx`, `RoutineHistoryTab.tsx`, `ActionTestDialog.tsx`) were
already over 1,000 lines on `master`; this PR keeps edits minimal and
localized without introducing new subsystems into those files.

## Model Used

- Google Gemini 4 Neon (High) via Antigravity (tool use, code execution,
multi-agent code review)

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-27 13:41:45 +00:00
Dotta 74f26f3b49 fix(ui): mobile parity for task detail, chat, goals, cases, and coordinator inbox (#23046)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Operators review tasks, agent conversations, goals, cases, and
coordinator inbox decisions from both desktop and mobile viewports.
> - On mobile viewports (`< 768px`), several core detail surfaces hide
or disable controls that only mount in desktop sidebars: streamlined
Task Detail hides both the Properties drawer trigger and the More task
actions menu; Agent Chat's top-right Show properties toggle toggles a
desktop-only panel; Goal Detail hides its Properties panel with no
mobile drawer; Coordinator Inbox disables artifact and approval
inspection; BreadcrumbBar crushes current page titles behind unshrinking
ancestors; Case Detail clips long unbroken IDs; wide Markdown tables and
rigid 4-column media grids overflow narrow screens.
> - Mobile operators need full access to task properties, task actions,
goal metadata, and decision artifacts without switching to a desktop
browser or fighting horizontal page overflow.
> - This pull request restores mobile sheet triggers and action menus
across Task Detail, Agent Chat, Goal Detail, and Coordinator Inbox,
fixes mobile breadcrumb priority and properties toggle visibility, wraps
long Case Detail titles, contains wide Markdown tables inside scrollable
bubble regions, updates rigid 4-column media grids to 2-to-4 responsive
grids, and adds unit tests plus 390×844 Storybook mobile views.
> - The benefit is complete mobile parity on Paperclip's core detail and
inbox workflows with zero horizontal overflow and no regressions on
desktop layouts.

## Linked Issues or Issue Description

**What happened?**
On viewports narrower than `768px` (such as `390×844` mobile):
- Streamlined Task Detail hides both the mobile `Properties` sheet
button (gated behind `!streamlinedTaskDetailEnabled`) and the `More task
actions` (`...`) menu (nested inside `hidden md:flex`), making
Properties, Plan, Artifacts, Subtasks, Copy, Archive, Privacy, and
subtree Pause/Resume/Cancel controls unreachable.
- On Agent Chat and mobile Task Detail routes, the top-right `Show
properties` toggle calls `toggleTaskSidePanel`, which only toggles
desktop-only `panelVisible` (`PropertiesPanel` is `hidden md:flex`)
instead of opening the mobile `Sheet`.
- `BreadcrumbBar` suppresses `propertiesToggle` on mobile task trails
and gives ancestor segments `shrink-0`, crushing the final page label to
one letter.
- `GoalDetail` hides its Properties toggle (`hidden md:inline-flex`) and
only writes to the desktop `PropertiesPanel`, leaving `<GoalProperties
/>` unreachable on mobile.
- `CaseDetail` renders `<h1>` without `break-words` / `wrap-anywhere` or
`min-w-0`, causing unbroken identifiers to overflow past `390px`.
- `CoordinatorNeedsYou` sets `artifact = null`, disables mentioned-link
interception, and sets `onViewDetails = undefined` on mobile, blocking
inspection of approval details and decision artifacts.
- Wide Markdown tables inside `TaskChatBubble` lack flex `min-w-0`
containment and explicit `max-w-full overflow-x-auto` utility classes on
the table scroll wrapper, and media grids in `IssueOutputSection`,
`IssueAttachmentsSection`, and `TaskChatBubble` use rigid `grid-cols-4`
on mobile.

**Expected behavior**
- Mobile users can open the `TaskSidePanel` `Sheet` from both the
streamlined Task Detail header and the `BreadcrumbBar` top-right toggle
(on both `/issues/:id` and `/chats/:agentRef`), and can open the `More
task actions` (`...`) menu.
- Mobile breadcrumbs keep the current page title legible by collapsing
>2 leading segments and shrinking ancestor segments before the current
crumb.
- Mobile `GoalDetail` provides a `Properties` button that opens
`<GoalProperties />` in a bottom `Sheet`.
- Mobile `CaseDetail` wraps unbroken identifiers cleanly within the
viewport.
- Mobile `CoordinatorNeedsYou` opens approval details, artifact rows,
and mentioned documents in a responsive bottom `Sheet` backed by
`<CoordinatorReviewPanel />`.
- Wide Markdown tables scroll horizontally within their bubble container
without expanding page width, and media grids adapt from 2 columns on
mobile to 4 columns on `sm+`.

**Steps to reproduce**
1. Open Paperclip UI at a `390×844` viewport.
2. Visit a streamlined task detail page, an agent chat page, a goal
detail page, a case detail page with a long unbroken token in its title,
and the Coordinator Inbox (`/decisions`).
3. Attempt to open Properties, More task actions, Goal Properties, or an
approval/plan artifact review panel, and inspect breadcrumb truncation
and table overflow.

**Paperclip version or commit**
Reproduced on `origin/master` (`85ad16b47e`).

## What Changed

- **`ui/src/pages/IssueDetail.tsx`**: Wired `toggleTaskSidePanel` and
`breadcrumbPanelControl.open` to `mobilePropsOpen` when `isMobile` is
true (including on `/chats/:agentRef`); moved `More task actions`
(`...`) out of `hidden md:flex` so it stays reachable on mobile; added a
mobile-only `Properties` button to streamlined Task Detail headers.
*(Note on file size rule: `IssueDetail.tsx` already exceeded 1,000
lines; this PR adds only +36 net lines directly in the existing header
and panel toggle hooks to avoid unnecessary churn.)*
- **`ui/src/components/BreadcrumbBar.tsx`**: Rendered `propertiesToggle`
on mobile task and chat trails whenever `showPropertiesToggle` or
`breadcrumbPanelControl` is present; collapsed >2-segment mobile trails
to parent + current and shrunk ancestor segments (`max-w-28`, `max-w-24`
for task parents) while giving the final crumb `flex-1 min-w-0`.
- **`ui/src/pages/GoalDetail.tsx`**: Added a mobile-only `Properties`
trigger button and bottom `<Sheet>` rendering `<GoalProperties />`.
- **`ui/src/pages/CaseDetail.tsx`**: Added `min-w-0`, `break-words`, and
`wrap-anywhere` to the page container, header, and `<h1>` title.
- **`ui/src/components/coordinator/CoordinatorNeedsYou.tsx`**: Removed
mobile disables on `needsYouArtifact`, mentioned document clicks, and
approval `onViewDetails`; guarded desktop `panelVisible` close sync with
`!isMobile`; added a bottom `<Sheet>` rendering `<CoordinatorReviewPanel
/>` (with multi-tab switching when multiple artifacts are open).
- **`ui/src/components/MarkdownBody.tsx` &
`ui/src/components/task-chat/TaskChatBubble.tsx`**: Added `max-w-full
overflow-x-auto` to the Markdown table scroll wrapper and `min-w-0
max-w-full` flex containment on chat bubbles.
- **`ui/src/components/issue-output/IssueOutputSection.tsx`,
`ui/src/components/IssueAttachmentsSection.tsx`,
`ui/src/components/task-chat/TaskChatBubble.tsx`**: Updated rigid
`grid-cols-4` media grids to `grid-cols-2 sm:grid-cols-4`.
- **Storybook & Tests**: Added/updated 390×844 mobile Storybook exports
(`TaskDetailMobile`, `AgentChatMobile`, `GoalDetailMobile`,
`CaseDetailMobile`, `CoordinatorInboxMobile`) and 7 Vitest suites
covering every changed surface.

## Verification

- Targeted Vitest (8 files, 94 tests pass):
`pnpm --filter @paperclipai/ui exec vitest run
src/components/MarkdownBody.test.tsx
src/components/BreadcrumbBar.mobile.test.tsx
src/pages/GoalDetail.mobile.test.tsx
src/pages/CaseDetail.mobile.test.tsx
src/components/coordinator/CoordinatorNeedsYou.mobile.test.tsx
src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx
src/components/task-chat/TaskChatBubble.mobile.test.tsx
src/pages/IssueDetail.mobile.test.tsx`
- Design token & sync gates (All 4 gates CLEAN + cliplab character in
sync):
  `pnpm check:token-gates`
- TypeScript build & typecheck (0 errors):
  `pnpm --filter @paperclipai/ui typecheck`
- Storybook catalog & map checks (372 files, 3490 stories; 30/30 catalog
& map tests pass):
`node scripts/storybook-catalog.mjs --check && node --test
scripts/check-maps.test.mjs scripts/storybook-catalog.test.mjs
scripts/storybook-feature-index.test.mjs`
- Revision verified: `20c7e91bdad95b4679cd1707e6881a3f414f71a4` on local
macOS worktree. Full repo CI suite and visual browser checks will run in
GitHub Actions.

## Risks

- Low risk: all new drawer/sheet paths and breadcrumb collapsing are
strictly gated to mobile (`isMobile` / `md:hidden`), preserving existing
desktop layouts and behaviors.
- Mobile `CoordinatorNeedsYou` review sheets intentionally bypass
desktop `PropertiesPanel` so desktop `panelVisible === false` does not
auto-dismiss the mobile sheet; desktop panel behavior is unchanged.

## Model Used

- **Provider & Model**: Google Gemini — Gemini 4 Neon (High)
- **Capabilities**: Extended reasoning/thinking, tool use, local code
execution, and automated test verification.

## Checklist

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

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The board UI renders a fixed mobile bottom navigation bar
(`MobileBottomNav`, height `4rem` plus safe-area inset) and shared
collection toolbars on narrow viewports below `48rem`.
> - On mobile viewports (375px–390px), multi-control toolbars clip
actions off-screen, hidden org-chart controls reserve invisible width in
agent list view, and fixed or sticky footers and floating overlays
either hide behind `MobileBottomNav`, overlap it, or overflow the right
edge.
> - Operators on mobile cannot reach save, discard, retry, wizard
navigation, or toolbar filter controls when those surfaces collide with
the bottom navigation bar or clip off-screen.
> - This pull request adds shared mobile bottom-nav clearance tokens and
responsive rules in `ui/src/index.css`, lifts fixed/sticky footers and
floating overlays above `MobileBottomNav` on `< md` while constraining
horizontal fit at 375px+, wraps `.design-toolbar-actions` and collapses
hidden org-chart controls below `48rem`, and adds unit tests and mobile
Storybook stories.
> - The benefit is that every mobile toolbar, save bar, wizard footer,
bulk selection bar, toast, retry alert, and voice call panel stays fully
visible, reachable, and within the viewport width without changing
desktop layouts.

## Linked Issues or Issue Description

**What happened?**

On viewports narrower than `48rem` (such as 375px–390px mobile screens):
- `.design-toolbar-actions` did not wrap on mobile, pushing trailing
controls (such as Group by and View dropdowns in Coordinator Inbox)
off-screen into `overflow-x-clip`.
- `.agents-org-controls-reveal` reserved invisible `width: max-content`
space next to `New Agent` in mobile list view.
- `AgentAdvancedTab` (`sticky bottom-0 z-10`) and `ProfileWizard`
(`fixed inset-x-0 bottom-0 z-10`) footers sat behind `MobileBottomNav`
(`z-30`, `h-16`).
- `.agent-config-save-bar` (`bottom: 0; z-index: 40`) covered
`MobileBottomNav`, and `.agent-selection-bar` (`--selection-bar-bottom:
48px`) overlapped its top 16px.
- `ToastViewport` (`bottom-3 left-3 w-full max-w-sm`) overlapped
`MobileBottomNav` and overflowed the right edge by 12px at 375px.
- `IssueRowDetailsNotice` and `VoiceCallProvider` sat at `bottom-4` on
top of `MobileBottomNav` and lacked mobile horizontal containment /
viewport-safe max-height.

**Expected behavior**

- Multi-control toolbars wrap cleanly inside the mobile viewport, and
hidden org-chart controls occupy zero space in mobile list view.
- Fixed and sticky footers (`AgentConfigSaveBar`, `AgentAdvancedTab`,
`ProfileWizard`) and floating overlays (`.agent-selection-bar`,
`ToastViewport`, `IssueRowDetailsNotice`, `VoiceCallProvider`) clear
`MobileBottomNav` on `< md` viewports and stay within 375px–390px
horizontal bounds.
- Desktop (`>= 48rem`) layout and positioning remain unchanged.

**Steps to reproduce**

1. Open the Paperclip board UI at a `390x844` or `375x812` mobile
viewport.
2. Open Coordinator Inbox or Agents list view and inspect
`.design-toolbar-actions` and `.agents-org-controls-reveal`.
3. Open Agent settings (Identity/Runtime/Advanced), Tool Profile Wizard,
Agent bulk selection, or trigger a toast, row-details retry alert, or
active voice call panel while `MobileBottomNav` is visible.

**Paperclip version or commit**

`85ad16b47e` (`master`)

## What Changed

- **`ui/src/index.css`**:
- Added `--mobile-nav-overlay-bottom` (`calc(4rem + var(--spacing) * 3 +
var(--sz-safe-bottom))`) and `--mobile-nav-overlay-max-h` tokens for
floating overlays mounted outside `<main>`.
- Added `@media (width < 48rem)` rules to wrap `.design-toolbar-actions`
(`flex-wrap: wrap; min-width: 0; max-width: 100%`), expand
`[data-canonical-toolbar="inbox"] [data-toolbar-search]` to `width:
100%`, and collapse hidden
`.agents-org-controls-reveal:not([data-visible="true"])` (`display:
none`).
- Lifted `.agent-selection-bar` (`--selection-bar-bottom: calc(4rem +
var(--spacing) * 3)`) and `.agent-config-save-bar` (`bottom:
var(--tc-composer-bottom)`, `z-index: var(--z-20)`, mobile padding, full
slide-out transform when hidden, and matching
`.agent-settings-with-save-bar` bottom clearance) below `48rem` while
preserving cascade and `prefers-reduced-motion: reduce` ordering.
- **`ui/src/pages/AgentAdvancedTab.tsx`**: Updated the sticky save
footer to use `mobile-nav-composer`, `bottom-(--tc-composer-bottom)`,
`z-20`, `flex-wrap`, and `md:bottom-0`.
- **`ui/src/pages/tools/profiles/ProfileWizard.tsx`**: Updated the fixed
wizard footer to use `mobile-nav-composer`,
`bottom-(--tc-composer-bottom)`, `z-20`, `md:bottom-0`, and `flex-wrap`,
and increased mobile container bottom padding (`pb-36 md:pb-24`).
- **`ui/src/components/ToastViewport.tsx`**: Lifted toasts with
`bottom-(--mobile-nav-overlay-bottom) md:bottom-3` and replaced `left-3
w-full` with `inset-x-3 sm:inset-x-auto sm:left-3 sm:w-full` to
eliminate 375px right-edge overflow.
- **`ui/src/components/IssueRowDetailsNotice.tsx`**: Lifted above
`MobileBottomNav` with `bottom-(--mobile-nav-overlay-bottom)
md:bottom-4` and bounded mobile width with `inset-x-4 flex-wrap
sm:left-auto sm:right-4 sm:max-w-sm sm:flex-nowrap`.
- **`ui/src/components/voice/VoiceCallProvider.tsx`**: Lifted the active
voice panel with `bottom-(--mobile-nav-overlay-bottom)
max-h-(--mobile-nav-overlay-max-h) md:bottom-4 md:max-h-(--sz-calc-18)`.
- **Tests & Storybook**: Added `ui/src/index.mobile-overlays.test.ts`,
`ui/src/components/IssueRowDetailsNotice.test.tsx`,
`ui/src/components/voice/VoiceCallProvider.test.tsx`,
`ui/src/pages/AgentAdvancedTab.test.tsx`,
`ui/src/pages/tools/profiles/ProfileWizard.test.tsx`, expanded
`ui/src/components/ToastViewport.test.tsx`, and added catalog-compliant
mobile stories in
`ui/storybook/stories/navigation-preferences/mobile-overlays-clearance.stories.tsx`.

## Verification

- `pnpm --filter @paperclipai/ui exec vitest run
src/components/ToastViewport.test.tsx
src/components/IssueRowDetailsNotice.test.tsx
src/components/voice/VoiceCallProvider.test.tsx
src/pages/AgentAdvancedTab.test.tsx
src/pages/tools/profiles/ProfileWizard.test.tsx
src/index.mobile-overlays.test.ts` — 6 test files passed, 14/14 tests
passed.
- `pnpm --filter @paperclipai/ui exec vitest run
src/lib/analytics/replay-masking.test.tsx` — 220/220 tests passed.
- `pnpm --filter @paperclipai/ui typecheck` — passed with 0 errors.
- `pnpm check:token-gates` — all 4 token gates clean and `cliplab
character in sync`.
- `node scripts/storybook-catalog.mjs --check` — passed (373 files, 3491
stories).
- `node --test scripts/check-maps.test.mjs
scripts/storybook-catalog.test.mjs
scripts/storybook-feature-index.test.mjs` — 30/30 tests passed.
- Full-repo Vitest and browser E2E suites were not run locally; CI will
run the required repository checks on this PR.

## Risks

- Low risk. All positioning changes are scoped to `< md` / `< 48rem`
viewports using existing CSS custom property conventions
(`--tc-composer-bottom`, `--tc-composer-visible-nav-offset`,
`--sz-safe-bottom`), leaving desktop (`>= 48rem`) layouts unchanged.
- Floating overlays outside `<main>` (`ToastViewport`,
`IssueRowDetailsNotice`, `VoiceCallProvider`, `.agent-selection-bar`)
use the fixed `--mobile-nav-overlay-bottom` offset so they always clear
`MobileBottomNav` even when rendered in `document.body` portals; when
`MobileBottomNav` auto-hides on scroll, those overlays remain at the
safe clearance height rather than tracking `<main>`'s scroll state.

## Model Used

- Provider and model: Google Antigravity — Gemini 4 Neon (High)
- Capabilities: tool use, code editing, local terminal/test execution

## Checklist

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

> - Paperclip is the open source app people use to manage AI agents for
work
> - Operators connect AI subscriptions (such as Google Antigravity,
Claude, and Codex) through `AgentProviderConnection` and
`OnboardingWizard`, which share `FooterNav` for the primary step button
> - The remote sandbox login path (`AdapterLoginPanel`) updates the
primary footer button to `Sign in to <Provider>`, `Retry sign-in`, or
`Connecting`, but the local and hosted sign-in path (`useLocalAiLogin` +
`LocalProviderLoginInstructions`) did not wire into `FooterNav`
> - As a result, the primary footer button stayed disabled and labeled
`Connect` both when sign-in failed/expired and when a sign-in URL was
ready, forcing users to hunt for a small muted inline link (`Start
sign-in again` or `Sign in to Antigravity`)
> - This pull request maps `useLocalAiLogin` state onto the shared
primary footer button in both `AgentProviderConnection` and
`OnboardingWizard` and hides the redundant inline retry link on
failed/expired states when the footer owns it
> - The benefit is that the required next action is always the
prominent, enabled primary button on every connect screen

## Linked Issues or Issue Description

**What happened?**
On the Connect Antigravity subscription screens (and other
`useLocalAiLogin` subscription flows), the bottom-right primary button
remained disabled and labeled `Connect` while the required action was a
small muted link inside the card (`Start sign-in again` on
failed/expired sign-in, or `Sign in to Antigravity` when the OAuth URL
was ready).

**Expected behavior**
- When sign-in fails or expires, the primary footer button should be
enabled and labeled `Start sign in`, and clicking it should restart the
sign-in flow.
- When the sign-in URL is ready, the primary footer button should be
enabled and labeled `Sign in to Antigravity` (or the active provider
name), and clicking it should open the authorization URL in a new tab.
- Once sign-in succeeds, the primary footer button should switch back to
an enabled `Connect` button.

**Steps to reproduce**
1. Open the Antigravity app connection screen
(`/apps/connect?source=antigravity`) in a hosted environment with
subscription mode selected.
2. Observe the sign-in prompt state: the primary bottom-right `Connect`
button is disabled while `Sign in to Antigravity` is only a small
underlined link inside the card.
3. Let the sign-in fail or expire and observe the error state: the
primary bottom-right `Connect` button stays disabled while `Start
sign-in again` is only a small underlined link.

## What Changed

- `ui/src/components/AdapterLoginChrome.tsx`:
- Added `resolveLocalLoginPrimaryAction` to map `useLocalAiLogin` state
(`preparing`, `error`/`expired`, `submitting`, `sign_in_required` with
valid HTTP(S) `authorizationUrl`, and `ready`) to a typed primary CTA
descriptor.
- Added optional `primaryHandlesRetry` and `onSubmittingChange` props to
`LocalProviderLoginInstructions` so hosts that surface `Start sign in`
and `Connecting` on `FooterNav` hide the redundant inline error retry
link while standalone callers keep existing behavior.
- `ui/src/components/new-agent/AgentProviderConnection.tsx`:
- Wired `resolveLocalLoginPrimaryAction` into `FooterNav`
(`primaryLabel`, `primaryDisabled`, `primaryIcon`, `onPrimary`) so
failed/expired states render an enabled `Start sign in` button, ready
authorization URLs render an enabled `Sign in to <Provider>` button that
opens the URL in a new tab, and submitting/preparing states show spinner
feedback.
- `ui/src/components/OnboardingWizard.tsx`:
- Wired `resolveLocalLoginPrimaryAction` into `connectCta` and
`handleConnectStepPrimary` for the matching
`LocalProviderLoginInstructions` branch so onboarding has the same
primary CTA behavior.
- `ui/src/components/AdapterLoginChrome.test.tsx`,
`ui/src/components/new-agent/AgentProviderConnection.test.tsx`,
`ui/src/pages/apps/AppsConnect.test.tsx`:
- Added unit and render tests covering `resolveLocalLoginPrimaryAction`,
`primaryHandlesRetry`, enabled `Sign in to Antigravity` opening the
authorization URL, enabled `Start sign in` restarting failed/expired
sign-in without a redundant inline link, and returning to enabled
`Connect` once ready.

## Verification

- Ran `pnpm --filter @paperclipai/ui typecheck` — passed.
- Ran `pnpm exec vitest run
ui/src/components/AdapterLoginChrome.test.tsx
ui/src/components/new-agent/AgentProviderConnection.test.tsx
ui/src/pages/apps/AppsConnect.test.tsx
ui/src/components/ai-connections/useLocalAiLogin.test.tsx` — 4 test
files, 39 tests passed.

## Risks

- Low risk: UI-only change scoped to the `useLocalAiLogin` branch of
`AgentProviderConnection` and `OnboardingWizard`. Standalone
`LocalProviderLoginInstructions` callers default to `primaryHandlesRetry
= false`, and authorization URLs are validated as `http:` or `https:`
before calling `window.open`.

## Model Used

- Google Gemini (Antigravity agent with tool use, file editing, and
shell execution).

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-27 13:37:22 +00:00
TonioandClaude Fable 5.2 dadbc495b3 feat(ui): move the connection page to the Plugins design (#23029)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The Plugins page is where a person connects tools to agents and sets
what those tools can do
> - #22869 and #23005 moved Browse, the plugin page, and Reviews to the
Plugins marketplace design
> - The connection page that opens after a successful connection kept
the old design and an old side rail
> - A person who connects a plugin lands on a page that does not look
like the page they came from, and the plugin page does not show a clear
way back to it
> - This pull request applies the plugin page design to the connection
page and adds a Settings button to each account row on the plugin page
> - The benefit is one consistent path: Plugins, then the plugin, then
the account settings

## Linked Issues or Issue Description

Refs #22869, #23005

**What existing behavior does this improve?**

The connection page at `/apps/:connectionId/permissions` and
`/apps/:connectionId/review`, and the account rows on the plugin page.

**Subsystem affected**

UI, Plugins (Apps catalog) pages.

**Current behavior**

- The connection page shows a second side rail with "All connectors",
Permissions, and Review.
- The page uses a left-aligned column, ruled dividers, bordered chips,
and raw palette colors for the status badge.
- The plugin page opens the connection page only from the account name
and the "⋯" menu.

**Proposed behavior**

- The connection page has no second rail. It shows a back link to the
plugin, the header, and Permissions and Review as tabs in the page. The
Review tab shows the count of waiting items.
- The page uses the centered column, the quiet section labels, and the
rounded grouped surfaces of the plugin page.
- The Read and Write action groups are grouped cards. The control that
sets all actions is in the card header.
- Each account row on the plugin page has a Settings button that opens
the connection page.
- The breadcrumb reads Plugins, plugin, account.

**Reason and benefit**

The page after a connection matches the plugin page. A person can go
from the plugin to its account settings and back with one click.

**Breaking changes**

None. The routes, the labels that assistive technology reads, and the
permission logic do not change.

## What Changed

- `Layout.tsx`, `Layout.production.tsx`: connection routes no longer
mount `AppDetailSidebar`. The page for an app that is not connected
keeps its rail.
- `AppDetail.tsx`: new page shell, a restyled `AppDetailHeader`, an
exported `ConnectionBackLink`, and `ConnectionTabs` with the review
count. The status badge uses status tokens.
- `IdentitiesSection.tsx`, `PermissionsPanel.tsx`,
`AgentConnectionAccess.tsx`: quiet labels and grouped surfaces. No logic
changes.
- `Browse.tsx`: a Settings button on each account row that is not a
draft.
- `AiConnectionPoolConnector.tsx`: a "Plugins" back link, because the
rail that held it is gone.
- `replay-masking.test.tsx`, `connection-pools.spec.ts`: updated for the
new header class and the new back link.

## Verification

- `cd ui && pnpm typecheck`: pass.
- `pnpm run check:token-gates`: all gates clean.
- `node scripts/check-query-error-rendering.mjs`: 0 findings.
- `npx vitest run` on the 11 test files that import the changed
components: 732 passed, 1 skipped.
- `npx playwright test --config tests/e2e/playwright.config.ts
tests/e2e/connection-reviews.spec.ts
tests/e2e/apps-prosumer-mcp-flow.spec.ts
tests/e2e/applications-crud.spec.ts`: 9 passed, 1 skipped.
- Manual check in a local instance, dark theme, with a Context7
connection: the Permissions tab, the Review tab, and the Settings button
on the plugin page.
- Not run: `tests/ai-connections-app/connection-pools.spec.ts`. Not
checked in the browser: the GitHub repositories block, the reconnect
banner, the light theme, and narrow widths.

## Risks

- Low. The change is presentation only for the sections, and the routes
are the same.
- The connection pool page lost the rail. Its only way back is now the
"Plugins" back link and the breadcrumb.
- The page for an app that is not connected still has the old rail. This
is a known inconsistency.

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

## Model Used

- Claude Fable 5.2 (`claude-fable-5-2`) in Claude Code, with tool use,
code execution, and a browser preview.

## Checklist

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

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-26 18:25:15 +00:00
DottaandPaperclip 8f542b3c9b fix(ui): show Antigravity and Copilot as first-class harnesses in agent runtime settings (#23042)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The Harness / Runtime settings page (`/agents/:id/runtime`) lets
people choose or change an agent's harness, model, AI connection, and
execution environment
> - Qualified native ACPX harnesses (`antigravity_runtime` and
`copilot_runtime`) appeared in the New Agent wizard, but
`AdapterTypeDropdown` in `AgentConfigForm` only listed top-level UI
adapters plus `openai_dot` and `muse`
> - People configuring an agent on `/agents/:id/runtime` could not find
Google Antigravity or GitHub Copilot in the Harness dropdown, and
existing Antigravity agents displayed as `Paperclip Runner` instead of
their own harness and logo
> - This pull request exposes qualified `antigravity_runtime` and
`copilot_runtime` entries directly in `AdapterTypeDropdown`, hides the
redundant inner Runner/ACP pickers when selected, and persists the
native `paperclip_runner` ACPX configuration cleanly
> - The benefit is that people can configure and switch agents to
Antigravity or Copilot directly from `/agents/:id/runtime` across local,
Daytona, and Unikraft environments

## Linked Issues or Issue Description

**What existing behavior does this improve?**
Harness selection and display on the agent Harness / Runtime settings
page (`/agents/:id/runtime`).

**Subsystem affected**
UI: `AgentConfigForm` (`AdapterTypeDropdown`) and `AdapterMark`
(`ui/src/components/`).

**Current behavior**
The Harness dropdown on `/agents/:id/runtime` omits Google Antigravity
(`antigravity_runtime`) and GitHub Copilot (`copilot_runtime`). Existing
Antigravity agents show `Paperclip Runner` with nested `ACP agents`
pickers instead of `Google Antigravity` with its logo.

**Proposed behavior**
Qualified native ACPX harnesses (`Google Antigravity` and `GitHub
Copilot`) appear directly in the Harness dropdown with their logos,
gated by qualification, server adapter disablement, and Cloud
`availableHarnesses` policy. Selecting one persists `adapterType:
"paperclip_runner"` with `{ provider: "acpx", acpxAgent: "antigravity" |
"copilot", lifecycleMode: "per_turn" }`, exposes all supported
environments (including Daytona and Unikraft plugin computers), and
hides redundant inner Runner/ACP pickers.

**Reason and benefit**
Matches the New Agent picker so users configuring an agent from
`/agents/:id/runtime` see consistent harness choices, logos, model
pickers, and environment options without needing the experimental
`enableNativeRunner` flag.

**Breaking changes**
None. Existing `paperclip_runner` agent records keep the same schema and
stored `adapterConfig`.

## What Changed

- Added qualified `antigravity_runtime` and `copilot_runtime` options to
`AdapterTypeDropdown` in `ui/src/components/AgentConfigForm.tsx`,
respecting server `disabledTypes` and Cloud `availableHarnesses` policy
without requiring `enableNativeRunner`.
- Mapped saved `antigravity_runtime` and `copilot_runtime`
`paperclip_runner` agents to display as their dedicated harness in
`AdapterTypeDropdown`, hid redundant inner Runner/ACP pickers
(`hideRunnerHarness`), and guarded against no-op re-selection clearing
the current model.
- Handled selecting `antigravity_runtime` or `copilot_runtime` in create
and edit modes by setting `adapterType: "paperclip_runner"` and `{
provider: "acpx", acpxAgent, lifecycleMode: "per_turn" }`.
- Fixed a latent bug in `adapterPickerDisabledTypes` where
`disabledTypes` (an array from `useDisabledAdaptersSync`) was checked
with `.has(...)` instead of a `Set`.
- Added `copilot_runtime` light/dark brand icons to
`ui/src/components/AdapterMark.tsx`.
- Added render tests in
`ui/src/components/AgentConfigForm.render.test.tsx` covering Antigravity
selection, logo rendering, Daytona/Unikraft environment availability,
native ACPX save payload, and display of existing Antigravity agents.

## Verification

- `pnpm exec vitest run
ui/src/components/AgentConfigForm.render.test.tsx
ui/src/components/AgentConfigForm.test.ts
ui/src/adapters/codex-local/config-fields.test.tsx` — 58/58 passed.
- `pnpm exec vitest run ui/src/` — 578 test files (7,191 tests) passed.
- `pnpm --filter @paperclipai/ui typecheck` — passed (including
Storybook catalog check).

## Risks

- Low risk. UI-only harness selection change; server-side validation,
Cloud `availableHarnesses` enforcement, and stored `adapterConfig`
format remain unchanged.

## Model Used

- Google Gemini (Antigravity agent with tool use and code execution).

## Checklist

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-26 13:12:44 +00:00
DottaandPaperclip 6fab9e8659 fix(apps): key Antigravity connector to antigravity with Antigravity branding and logo (#23012)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The Connectors catalog and `/apps/connect` setup page let people
connect AI model providers for their agents
> - The Antigravity model-provider connector still used the `google`
slug, the generic Google "G" icon, and "Google" headings and sign-in
copy on `/apps/connect?source=google`
> - Showing "Google" with the generic Google icon on the Antigravity
connection flow makes it easy to confuse with Google Workspace
connectors and hides the Antigravity product identity
> - This pull request moves the catalog slug to `antigravity`, adds the
official Antigravity vector logo, redirects legacy `source=google` and
`source=google-ai` links to `source=antigravity`, and updates the
Connect page copy and icons to Antigravity while preserving the
underlying `google` AI provider storage contract
> - The benefit is that people see clear Antigravity branding, logo, and
URL routing throughout the Antigravity connection flow without breaking
saved accounts or existing links

## Linked Issues or Issue Description

**What existing behavior does this improve?**
Connector routing, branding, and logo presentation for Antigravity on
the Connectors catalog and `/apps/connect` setup page.

**Subsystem affected**
Shared app definitions (`packages/shared`), app brand assets
(`ui/public/brands/apps`), and UI connection setup pages and components
(`ui/src/pages/apps`, `ui/src/components`).

**Current behavior**
The Antigravity model-provider connector uses `?source=google`, displays
the generic Google logo, and shows "Connect Google", "Google", and "Sign
in to Google" on the Connect page.

**Proposed behavior**
The Antigravity connector keys to `?source=antigravity`, displays the
Antigravity logo, and shows "Connect Antigravity", "Antigravity", and
"Sign in to Antigravity" on the Connect page. Legacy links using
`?source=google` or `?source=google-ai` redirect to
`?source=antigravity` while preserving other query parameters.

**Reason and benefit**
This matches the existing `github` -> `github-copilot` catalog
separation pattern: stored `google` AI connections and Gemini API key
compatibility remain unchanged, while the user-facing catalog entry, URL
key, logo, and Connect page copy consistently reflect Antigravity.

**Breaking changes**
None. The underlying `google` AI provider identifier, credential
storage, and grants do not change, and legacy `source=google` /
`source=google-ai` deep links redirect automatically to
`source=antigravity`.

## What Changed

- Added the official transparent Antigravity vector mark at
`ui/public/brands/apps/antigravity.svg` and registered `antigravity` in
`ui/public/brands/apps/manifest.json` (keeping `google` with
`catalogVisible: false` for Google Workspace branding).
- Mapped `aiConnectionCatalogSlug("google")` to `"antigravity"` and
updated `aiProviderSetupPreset` so `antigravity`, `google`, and
`google-ai` all resolve to `{ provider: "google", label: "Antigravity"
}`.
- Replaced `packages/shared/src/app-definitions/google.json` with
`packages/shared/src/app-definitions/antigravity.json`, added
`scripts/app-definition-overrides/antigravity.json`, updated
`scripts/ingest-app-definitions.mjs`,
`packages/shared/src/app-definitions.ts`, and
`packages/shared/src/app-definitions.generated.ts`, and resynced
`tests/runner-e2e/source-sdk-public-inputs.json`.
- Updated `ui/src/pages/apps/app-connect-policy.ts` and
`ui/src/pages/apps/AppsConnect.tsx` to admit and redirect legacy
`source=google` and `source=google-ai` links to `source=antigravity`
while preserving query parameters.
- Updated `AdapterMark`, `AiProviderSetup`, `AgentProviderConnection`,
`AdapterLoginChrome`, `AiConnectionCredentialStep`, `AiConnectionField`,
`ai-connections/model.ts`, and
`ui/storybook/prototypes/AiConnectorPages.tsx` to show Antigravity
branding and `/brands/apps/antigravity.svg`.
- Updated existing unit tests and added
`ui/src/pages/apps/AppsConnect.test.tsx` covering legacy URL redirects
and Antigravity Connect page rendering.

## Verification

- `pnpm --filter @paperclipai/shared build` — passed.
- `node scripts/check-app-brand-assets.mjs` — passed (`Validated 114
brand identities`).
- `pnpm exec vitest run packages/shared/src/` — 120 test files passed.
- `pnpm exec vitest run ui/src/` — 575 test files (7,178 tests) passed;
`pnpm exec vitest run ui/src/pages/apps/AppsConnect.test.tsx` — 3/3
passed.
- `pnpm --filter @paperclipai/server exec vitest run
src/__tests__/ai-connections.test.ts
src/__tests__/connection-intents-service.test.ts` — 208/208 passed.
- `pnpm --filter @paperclipai/shared typecheck && pnpm --filter
@paperclipai/ui typecheck && pnpm --filter @paperclipai/server
typecheck` — passed.
- `node --test scripts/app-definition-overrides.test.mjs
scripts/app-brand-validation.test.mjs scripts/check-test-budget.test.mjs
scripts/storybook-catalog.test.mjs` — passed.
- `node tests/runner-e2e/source-sdk-public-inputs.mjs $(git rev-parse
HEAD) --check` — passed (`changed: false`).

## Risks

- Low risk. The stored AI provider enum (`google`) and database/API
contracts stay unchanged; `aiConnectionSourceSlug` maps previously
stored `google` connections to the `antigravity` catalog entry
automatically.
- Legacy bookmarks or deep links to `/apps/connect?source=google` or
`?source=google-ai` redirect immediately to `?source=antigravity` with
existing query parameters preserved.

## Model Used

- Google Gemini (Antigravity agent with tool use and code execution).

## Checklist

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

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-26 02:25:12 +00:00
scotttongandScott Tong e45340c0cf Align the default-account note with the onboarding API key field (#23009)
## Thinking Path

> - People use Paperclip to manage agents at work.
> - Onboarding connects the first agent to a model provider.
> - When a user enters a new API key, the form explains which account
becomes the default.
> - The note touched the input border. Its text started to the left of
the placeholder.
> - The field now lays out its own note and exposes it as an accessible
description.

## Linked Issues or Issue Description

**What happened?**

The default-account note touched the lower edge of the API key field.
The input had no accessible description.

**Expected behavior**

The note should sit below the field, align with the input text, and wrap
at narrow widths. Assistive technology should announce it with the
field.

**Steps to reproduce**

1. Start onboarding with a new organization that has no saved provider
keys.
2. Name the agent. Choose **Use API key instead**, then **OpenAI**.
3. Inspect the field and note at desktop width and at 320 px.

**Paperclip version or commit**

Reproduced on `e18fe61c8f`. Related PR #19557 added the note.

## What Changed

- Give the shared onboarding field an optional description. Use the
input's horizontal inset and an 8 px vertical gap.
- Associate the description with its input through `aria-describedby`.
- Pass the existing provider-specific sentence from the new-key form.
Add a regression test for fields with and without a description.

## Verification

- The regression test failed on the original field and passed after the
fix. All 17 focused field and saved-credential tests passed.
- The UI typecheck passed. The selected UI suites passed 3,944 tests,
with one skip.
- In Chrome, verified alignment and wrapping at 1280 × 900 and 320 ×
740. Checked the accessible description, password masking, and the
saved-key path with a disposable database.
- Three local CLI worktree tests could not start native PostgreSQL
clusters because the host exhausted its shared-memory slots. The CLI
telemetry test passed on a separate run using its standard environment.

## Risks

The field also serves sign-in flows. The description is optional. Fields
without one retain their existing input markup.

## Model Used

OpenAI Codex (GPT-6) 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
- [ ] 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: Scott Tong <scott@scotts-mbp-m5-max.local>

Co-authored-by: Scott Tong <scott@scotts-mbp-m5-max.local>
2026-11-26 00:44:56 +00:00
scotttongandScott Tong 8aface6cc3 Keep the unselected In Progress status option still (#23008)
## Thinking Path

> - People use Paperclip to manage work with AI agents.
> - The task status picker shows the current status and the other
choices.
> - A spinning ring indicates a task is in progress.
> - The ring also spun when a task was in review and the user opened the
picker.
> - Keep that option still until the user selects In Progress.

## Linked Issues or Issue Description

**What happened?**

The In Progress option rotated while In Review was selected.

**Expected behavior**

Only an active In Progress status should rotate. Reduced motion should
keep the ring still.

**Steps to reproduce**

1. Open a task in review.
2. Open Change status with reduced motion turned off.
3. Watch the blue ring beside In Progress.

**Paperclip version or commit**

Reproduced at `e18fe61c8f`.

Related work includes the shared task glyph mapping in #19329 and the
empty Kanban column case in #15805.

## What Changed

- Apply the static animation class to the unselected In Progress menu
option.
- Add a regression test for the trigger and option with In Review and In
Progress selected.

## Verification

- Ran the focused component test. The inactive row failed on the
baseline. Both cases passed with the fix.
- Used Chromium on the task detail page. The inactive ring went from one
running CSS animation to zero. The selected option and trigger still
rotated with normal motion and stopped with reduced motion.
- Changed the task to In Progress and back to In Review. Both changes
persisted.
- Local affected UI checks had 3,938 passes and one skip. Three CLI
worktree tests failed while initializing embedded PostgreSQL on the
local host. The remaining 534 CLI tests passed.

## Risks

- The visual change is limited to the unused In Progress row in the
status picker. The test covers the selected row and the trigger.

## Model Used

- OpenAI Codex (GPT-6) 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
- [ ] 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: Scott Tong <1504818+scotttong@users.noreply.github.com>
2026-11-26 00:41:10 +00:00
scotttongandScott Tong 17f9105a23 fix(ui): open agent chat from the task transcript (#23004)
## Thinking Path

> - People use Paperclip to manage AI agents and their work.
> - A task shows the agent's name and avatar beside its run status.
> - People can use that identity to follow up with the agent.
> - The link opened the agent's settings. This added a second step to
reach the conversation.
> - This change opens the agent's existing one-on-one chat directly from
the task.

## Linked Issues or Issue Description

**What happened?**

Clicking an agent's name beside its run status in a task opened the
agent overview.

**Expected behavior**

The link should open that agent's chat in the same company.

**Steps to reproduce**

Open a task with an agent run. Click the avatar or name beside the run
status. Check the destination and use browser Back to return to the
task.

**Paperclip version or commit**

Reproduced on e18fe61c8f.

Related work: #13283 introduced the shared task and agent chat surface.

## What Changed

- Use the task's agent roster to build the company-scoped chat link. Use
the agent ID for a missing or terminated roster member.
- Keep the link to the agent overview inside direct chat.
- Add a regression test for task and direct chat links.

## Verification

- The Chromium end-to-end test passed against the built UI. It clicks
the company-scoped agent link in the task, opens the saved conversation,
and checks the overview link inside direct chat.

- The focused task thread suite passed 434 tests and skipped one: `pnpm
exec vitest run ui/src/components/TaskChatThread.test.tsx`.
- In Chrome, clicked the named link beside a native run. Verified the
company, agent, existing conversation, and Back navigation. Verified
keyboard activation, the assignee menu, and the settings link from
direct chat.
- All 224 selected UI test files passed locally before adding the
regression test. Three CLI worktree tests could not start their embedded
PostgreSQL instances because the machine was out of shared-memory slots.

## Risks

The task and direct chat share the identity component. The test checks
both destinations to guard against a self-link inside direct chat.

## Model Used

OpenAI GPT-6 via Codex, with local code execution and browser testing.

## 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

---------

Co-authored-by: Scott Tong <scott@scotts-mbp-m5-max.local>
2026-11-26 00:23:21 +00:00