Commit Graph
994 Commits
Author SHA1 Message Date
Devin FoleyandPaperclip ad1f7e98ea fix: retain diagnostic reasons for native runner failures (#14481)
Retain bounded reasons for runner identity, harness recovery, and provider-pack read failures. Preserve existing ownership and cleanup proofs and compatibility with receipt-gated chat recovery.

Verified with executor, recovery, diagnostic privacy, typecheck, build, and full CI checks.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:16:19 -07:00
Devin FoleyandPaperclip 4f6cf5b3ff fix: prevent run identity locks from blocking audit checks (#14478)
Use NO KEY UPDATE for identity locks so audit foreign-key checks can proceed while identity writers remain serialized. Preserve task-before-run ordering, company scoping, and foreign keys.

Verified with PostgreSQL concurrency regressions, focused tests, typecheck, build, and full CI.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:16:05 -07:00
Devin FoleyandPaperclip faf72cb1d5 fix: preserve company context across browser hot reload (#14482)
## Thinking Path

> - Paperclip uses a shared company context for browser providers and
consumers.
> - Vite can load a new consumer module while an older provider is
mounted.
> - Recreating the context disconnects that consumer from the mounted
provider.
> - The consumer then reports a missing provider even though one is in
its React ancestry.
> - This change preserves the context object across development module
refreshes.
> - Bounded global error diagnostics distinguish development bundles and
otherwise context-free promise rejections.

## Linked Issues or Issue Description

**What happened?**
A refreshed company consumer can throw `useCompany must be used within a
CompanyProvider`. A real Vite and Chromium reproduction confirms that a
retained provider and a refreshed consumer can hold different context
objects. Global promise rejections also lack the bounded document state
already attached to React boundary errors.

**Expected behavior**
A refreshed consumer should read the mounted provider. Error reports
should identify the loaded bundle mode and bounded browser state while
preserving monitoring opt-in, sign-out, and privacy behavior.

**Steps to reproduce**
Run `pnpm test:e2e:browser-context`. The isolated Vite fixture renders
the real CompanyProvider, imports a new timestamped consumer module, and
renders that consumer below the retained provider. The test fails before
the context change and passes after it. The SDK regression invokes its
real unhandled-rejection handler with an undefined reason.

## What Changed

- Keep the React context object in Vite's per-module `hot.data`. Account
values stay in React.
- Add an isolated browser regression with mocked API responses and no
live instance, discovered by the existing Chrome CI shards.
- Add document-state diagnostics to global errors while preserving
earlier boundary snapshots.
- Tag events with development or production bundle mode and the type of
an unhandled rejected value.
- Document the new test command and diagnostic fields.

## Verification

- Company context, browser context, and Sentry suites: 59 passed.
- `pnpm test:e2e:browser-context`: passed in Chromium. The original
context code fails the reproduction.
- Real SDK tests preserve DSN/sign-out behavior and omit request
context, breadcrumbs, and private DOM data.
- `pnpm check:token-gates`: passed.
- `pnpm -r typecheck`: passed.
- `pnpm build`: passed.
- Local `pnpm test:run` exited in the general-server phase: 13,819
passed, 86 skipped, 21 failures in unchanged filesystem and host-port
suites. Cache permission and long-path failures also reproduce on the
unmodified base; seven other failures involve local runtime port
ownership. This is not a full local pass.
- Full Linux CI and review passed at a0b5270662 (53 successful checks;
two conditional checks skipped). Three jobs interrupted by a runner
shutdown passed on rerun. Greptile is 5/5 with no unresolved comments.
The real browser regression also passed in the normal Chrome CI shard
(3.2 seconds).
- Code-owner approval remains required because the dedicated test
command changes `package.json`.
- Scanned the diff and PR text for credentials and private data before
pushing.

## Risks

The context cache applies only to development hot reload. It retains the
context object, not account state. Production continues to create an
ordinary React context. The diagnostic hook adds only bounded state and
type values, preserves boundary snapshots, and returns the original
event if enrichment fails. It does not suppress errors or restore raw
breadcrumbs. The global rejection diagnostics do not identify the
promise's originating operation by themselves.

## Model Used

OpenAI GPT-6 through Codex, with repository inspection, code editing,
and command execution. The runtime does not expose a more specific model
revision or 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 (focused suites and
Chromium regression; full local limitations documented above)
- [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-09-28 16:15:14 -07:00
0be2afcca6 feat(ui): improve task composer controls and pending input (#14322)
## Thinking Path

> - Paperclip lets operators assign tasks to AI agents and review their
work.
> - The task composer controls the next message and its assigned agent.
> - Operators needed a way to choose that agent's model and effort
without leaving the composer.
> - The old mode selector, upload button, and input cards made the
mobile composer crowded and hid normal messaging during a pending
decision.
> - Harnesses publish different model and effort capabilities, so the
picker must follow the selected agent.
> - This pull request adds one responsive composer flow, keeps pending
cards visible above it, and protects Codex ACP authentication in the
local test path.
> - Operators can choose run settings, send a message, and answer a
pending card as separate actions.

## Linked Issues or Issue Description

**Subsystem affected**

Task composer UI, issue thread interactions, Codex ACP credential
handling, and Storybook.

**Problem or motivation**

The composer did not expose model or effort for the selected agent.
Mobile actions wrapped poorly. Pending questions and confirmations
replaced the composer. A local Codex ACP test could also reuse host
authentication after the managed key was removed.

**Proposed solution**

Put assignee search, model search, exact model IDs, effort, and fast
mode in one picker. Use a mobile dialog. Replace the direct-upload plus
action and separate mode selector with an Add menu and removable Plan or
Ask chips. Place pending interaction cards above the usable composer.
Keep these cards pending after an ordinary message unless their creator
asks for comment superseding. Replace managed ACP auth files atomically
and isolate the test key from host credentials.

**Roadmap alignment**

ROADMAP.md does not list an overlapping composer milestone. This change
improves the existing task and review flows.

## What Changed

- Added the combined assignee, model, and effort picker to both task
composers. Search matches agent name, role, and harness. The server uses
a curated Codex list by default and honors instance-declared models.
Manual IDs remain available.
- Added an effort slider for known model capabilities, a conditional
Codex fast control, and reset. The picker opens in a modal on mobile.
- Added the Add menu for files, supported goals, Plan mode, and Ask
mode. Plan and Ask are exclusive removable chips. Keyboard mode cycling
remains available.
- Adjusted mobile spacing, avatars, wrapping, and Send placement.
Removed the composer divider.
- Moved pending question, confirmation, review, and related cards above
the composer. Ordinary comments now leave question and confirmation
cards pending by default. The onboarding prompt retains explicit comment
superseding.
- Updated the Storybook composer group with responsive states and the
production picker. Added UI, service, route, and browser regression
coverage.
- Isolated Codex ACP API-key authentication, skipped subscription auth
merge and shared-home copy-back for remote API-key runs, and replaced
the managed auth file atomically.

## Verification

- `pnpm -r typecheck` — passed on the final local head.
- `pnpm check:token-gates` — passed on the final local head.
- `pnpm exec vitest run server/src/__tests__/adapter-models.test.ts
ui/src/components/task-chat/ComposerRunSettingsPicker.test.tsx` — 31
tests passed, including role and harness search, declared Codex models,
and filtering general OpenAI models.
- `pnpm exec vitest run
server/src/__tests__/issue-thread-interactions-service.test.ts` — 74
tests passed.
- `pnpm exec vitest run
packages/adapters/codex-local/src/server/acp.test.ts` — 42 tests passed,
including remote API-key copy-back isolation.
- `pnpm test:run` — attempted locally; the embedded PostgreSQL test
database could not initialize on macOS. The isolated
`heartbeat-run-event-sequencing` suite reproduced that environment
failure. GitHub CI runs the full test matrix for this head.
- `pnpm build` — passed on the final head. `pnpm build-storybook` passed
after the last UI change; only server code, tests, and docs changed
afterward.
- Live local test drive — Codex ACP ran a task with a managed API key.
The test agent was restored to its default ACP configuration afterward.
- Review the interactive stories under the top-level Composer group with
`pnpm storybook`. Check a narrow desktop width and mobile Plan, Ask,
picker, and pending-question states.

## Risks

- A pending card stays open when an ordinary comment changes the
discussion. Its creator can set `supersedeOnUserComment: true` when a
new comment should replace it.
- Model and effort overrides persist on the task until reset or changed.
An unlisted manual model ID may fail when the provider runs it.
- Some harness catalogs do not report effort support. The picker hides
effort for those models.
- 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 GPT-6 via Codex. This runtime does not expose the exact model ID
or context window to the task. The model used code execution and browser
tools.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [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>
Co-authored-by: OpenAI Codex <codex@openai.com>
2026-09-28 23:02:39 +00:00
Dotta 32100dc6df Merge branch 'codex/runner-copilot-acp' into codex/runner-pi-acp
* codex/runner-copilot-acp:
  docs(runner): report rich ACP capabilities and paid qualification
2026-09-28 17:42:54 -05:00
Dotta fd75cf6c13 Merge branch 'codex/runner-cursor-acp' into codex/runner-copilot-acp
* codex/runner-cursor-acp:
  docs(runner): report rich ACP capabilities and paid qualification
2026-09-28 17:42:46 -05:00
Dotta 2eeedcd7f3 Merge branch 'codex/runner-rich-acp' into codex/runner-cursor-acp
* codex/runner-rich-acp:
  docs(runner): report rich ACP capabilities and paid qualification
2026-09-28 17:42:43 -05:00
Dotta d97ef47a81 docs(runner): report rich ACP capabilities and paid qualification 2026-09-28 17:42:39 -05:00
DottaandPaperclip ddeee41ee6 docs(runner): retain Pi v5 security and paid control proofs
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 17:42:05 -05:00
DottaandPaperclip aec26ad83f fix(runner): pin patched Undici and Node in Pi profile v5
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 17:33:50 -05:00
DottaandPaperclip a9bfd5f602 docs(runner): retain paid Pi v4 native control qualification
Record correlated denial, active steering, queued follow-up, terminal usage and settled exclusive-key billing; preserve earlier proofs and hold further paid work for dependency remediation.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 17:24:39 -05:00
DottaandPaperclip 0459722049 docs(runner): diagnose the Pi fixture semaphore exhaustion
Retain a credential-free same-binary initdb reproduction with unchanged IPC totals and verified child/temp cleanup.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 17:18:01 -05:00
DottaandPaperclip 57b4d6a5f9 docs(runner): retain the Pi v4 pre-provider infrastructure failure
Record canonical database bootstrap failure, zero-prompt billing observations and independent cleanup without weakening the Product matcher or retrying automatically.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 17:17:07 -05:00
DottaandPaperclip 92bcd6f07a docs(runner): retain the verified Pi v4 pack and startup proof
Record frozen runtime trees, combined repository checks, complete pack integrity, the network-denied native handshake and timely full Runner missing-credential rejection.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 17:13:59 -05:00
DottaandPaperclip f556110d58 Merge branch 'codex/runner-copilot-acp' into codex/runner-pi-acp
* codex/runner-copilot-acp:
  Document Cursor prompt-image implementation gap

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 17:09:21 -05:00
DottaandPaperclip a05c4ee3b0 fix(runner): scope Pi tool identities to native model iterations
Preserve exact delivery retries while separating reused native IDs across warm prompts. Add pinned SDK ordering, real semantic bridge, lifecycle and history regressions, and bump the verified Pi profile to v4.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 17:09:12 -05:00
Dotta 78b81ed3d7 Merge branch 'codex/runner-cursor-acp' into codex/runner-copilot-acp
* codex/runner-cursor-acp:
  Document Cursor prompt-image implementation gap
2026-09-28 16:58:30 -05:00
DottaandPaperclip bdbbd4cbfc Document Cursor prompt-image implementation gap
Distinguish the native image capability advertisement from the runner's text-only turn contract and assign the missing attachment conversion an explicit P1 follow-up.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:55:53 -05:00
DottaandPaperclip 3c2c272d76 test(runner): retain Pi warm plan call identity failure
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:49:52 -05:00
DottaandPaperclip c5a34cce65 test(runner): retain Pi v3 paid behavior and projection evidence
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:36:55 -05:00
DottaandPaperclip 7ab4636970 Integrate all three ACP providers through the shared verified registry
Retain each native builder, profile installer, extension adapter and image-content input. Update the pack dispatch test now that Pi is installed alongside Cursor and Copilot. Combined ACP tests pass 616 cases; actual distribution/wrapper package checks pass 34 cases.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:32:10 -05:00
DottaandPaperclip a55422a48d Integrate Cursor prerequisite without losing Copilot registrations
Combine both pinned native builders, isolated profile installers, capabilities, extension adapters and complete Daytona content inputs. Verify dispatch remains isolated between the two native installation factories.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:26:55 -05:00
DottaandPaperclip 9cd42f6df9 Record Pi v3 immutable pack and timely startup proof
Retain version 2 paid/runtime evidence separately. Record complete closure reproduction, 95 focused tests, 25 package checks, 16 native Rust tests and zero-prompt launch results.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:16:34 -05:00
DottaandPaperclip 7710736ca3 Retain Pi denial proof and failed file qualification accounting
Preserve the original version 2 source, missing file oracle and terminal receipt, and aggregate billing attribution across the delayed charge.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:13:23 -05:00
DottaandPaperclip 96a9725f34 test(runner): retain isolated Linux Copilot image initialization proof
Record exact image, pack and executable digests with no credentials, network, fixture requests or model prompts. Keep Daytona Product qualification pending.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:11:55 -05:00
DottaandPaperclip 06cf356a8b Preserve Pi validation failures and structured Bash output
Bump the immutable Pi profile to version 3 and reject prior warm snapshots. Bound and redact authenticated MCP validation errors while retaining failure status; preserve standard ACP tool values alongside terminal metadata.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:10:15 -05:00
DottaandPaperclip f676c9d2c8 docs(runner): record offline Cursor Linux image verification
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:06:05 -05:00
DottaandPaperclip e405de788a test(runner): bind Copilot denial oracle to exact native write target
Reject unrelated edits and command mentions, normalize the private workspace path, and replay retained paid evidence offline without another prompt.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 16:02:12 -05:00
DottaandPaperclip 87c7fdaca7 test(runner): retain Copilot plan and restart qualification evidence
Preserve the separate question marker failure and unknown provider USD alongside successful plan approval and controller recovery. Keep the candidate pending.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:59:48 -05:00
DottaandPaperclip 72f8887709 docs(runner): record Cursor native EOF lifecycle limit
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:57:45 -05:00
DottaandPaperclip e450bc4346 test(runner): retain Cursor native denial and billing evidence
Preserve the original grader failure and assess the same captured turn through exact tool-call correlation without another prompt.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:55:37 -05:00
DottaandPaperclip 829686b0c8 Record successful serialized Cursor question restart recovery
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:46:51 -05:00
DottaandPaperclip 06e3bae33b Retain Pi local hello pass and model admission proof
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:44:14 -05:00
DottaandPaperclip c06fc5fccc docs(runner): retain real Copilot denial and settlement proof
Record native permission ID0, denial without filesystem effects, detached async command completion before terminal, process cleanup and externally reconciled unknown credit granularity.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:43:20 -05:00
DottaandPaperclip d35b83074a Retain native Cursor question availability qualification failure
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:41:32 -05:00
DottaandPaperclip 697e20562e docs(runner): retain final Copilot packaging checkpoint
Record exact merged source, repeated dependency lock resolution, matched immutable daemon, and credential-free native registry proof separately from live qualification.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:35:42 -05:00
DottaandPaperclip d9321659d4 Refresh Cursor packaged launch proof after shared integration
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:19:19 -05:00
DottaandPaperclip 25fb1b5b31 Pin final Cursor lock graph and reconcile bounded product usage
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:33 -05:00
DottaandPaperclip 8aa867b64d docs(runner): retain Copilot file pass and question failure
Record actual GitHub billing attribution, unpriced receipts, answered question continuation with failed exact marker, and pre-provider plan infrastructure failure. Candidate qualification stays pending.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip 2663e4af7c docs(runner): retain Copilot Product proof and accounting defect
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip 986af2854d Retain first real Copilot semantic qualification evidence
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip 08cabb1f2e test(runner): retain authenticated Copilot model discovery
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip a989354a5e Refresh Copilot package proof through final launch-boundary fixes
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip a72d9b8073 Refresh Copilot proof after credential-boundary review
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip 7343bfffd1 Refresh Copilot pack evidence after foundation integration
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip f36adb3edb Document Copilot tool diff and location preservation gaps
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip f61f17e8f8 Retain Copilot packaged launch evidence and complete capability gaps
Record the exact verified provider pack, native initialize metadata, zero-spend offline probe attempts, and missing-credential preflight. Explicitly account for unused terminal authentication, image/context inputs, session management and SSE capabilities.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip 4fc5dbd4ec Connect Copilot candidate installation, events, diagnostics and pack registries
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip 2b19bd22be Build Copilot packs from verified immutable native archives
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00
DottaandPaperclip fe3b7e6fb8 Project Copilot native events into attributed runner activity
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-28 15:17:09 -05:00