Commit Graph
2239 Commits
Author SHA1 Message Date
Dotta 72042f165c fix(boat): coalesce concurrent readiness requests 2026-10-11 04:03:52 -05:00
Dotta 4e489a1014 Diagnose artifact upload phases with opt-in bounded records 2026-10-11 03:27:30 -05:00
Dotta 086a9dbbd8 fix: expose computer retirement grace through module boundary 2026-10-11 03:08:05 -05:00
Dotta d14578ad13 fix: preserve authoritative warm computers during orphan lease sweep 2026-10-11 03:00:55 -05:00
Dotta 8198c9a571 fix: share Boat upload capacity before command admission 2026-10-11 02:59:57 -05:00
Dotta b1030f6233 Avoid duplicate diagnostics for immediate native session close failure 2026-10-11 01:45:01 -05:00
Dotta 3812ccfebb Record scoped warm retirement failure diagnostics 2026-10-11 01:29:37 -05:00
Dotta 4bddd14a2b Resolve task computer from current environment selection 2026-10-11 00:21:48 -05:00
Dotta d7d7808302 Merge upstream and regenerate Boat migration as 0333 2026-10-10 23:57:20 -05:00
Devin FoleyandPaperclip b36960b758 fix(server): permit verified question-delivery history to sleep (#15851)
Treat completed question-response deliveries as history only after their exact same-company handoff finishes. Preserve missing evidence, retries, accounting debt, and idle-sleep fences.

Add a concurrent all-state question history index with interrupted-build repair. Keep migrations serialized without waiting snapshots that deadlock concurrent index builds.

Validated by 118 focused sleep tests, six migration/snapshot tests, full repository typecheck, all CI gates, and Apex 5/5.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 21:47:55 -07:00
Dotta 9a31fa2746 fix: preserve admitted user turns across legacy recovery sweeps 2026-10-10 23:21:25 -05:00
Dotta 3e90f36fa7 fix: preserve pre-provider recovery after verification outages 2026-10-10 23:04:31 -05:00
Dotta 280bad9d15 fix: preserve Stop through computer admission retry races 2026-10-10 23:01:52 -05:00
Dotta c1273036d5 fix: allow bounded cold verification of persistent computer packs 2026-10-10 22:50:03 -05:00
Dotta a5cc05d2c3 fix: resume new input after paused computer admission retries 2026-10-10 22:48:08 -05:00
Dotta fd3ec56106 fix: distinguish provider cache mismatches from unavailable verification 2026-10-10 22:36:14 -05:00
Dotta 11ccf7b1a2 fix: preserve Boat wait ownership and honor Stop across retries 2026-10-10 22:27:53 -05:00
Dotta a4c864a062 fix: defer Boat admission while provider stop is pending 2026-10-10 22:06:55 -05:00
Dotta 44b1b52362 Preserve controller-owned provider pack authority across cold resume 2026-10-10 21:19:44 -05:00
Dotta 60908b902b Keep Boat reconnect unavailable until attachment succeeds 2026-10-10 21:02:58 -05:00
Dotta 80decfdc10 Validate retained packages against the active provider contract 2026-10-10 21:02:41 -05:00
Dotta 66ac692e44 fix(boat): retain verified ACPX provider packs across deployments 2026-10-10 20:44:45 -05:00
Dotta a946f0a084 fix(boat): scope native cleanup to the remote owner 2026-10-10 20:34:41 -05:00
DottaandPaperclip ee2a01063e fix: classify computer checkpoint recovery rejection safely
Preserve every settlement and ownership gate while exposing fixed reason codes for checkpoint mismatches and prior authority verification. Cover each diagnostic branch without logging evidence values.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 19:13:26 -05:00
Devin FoleyandPaperclip 07f3536e37 fix(connections): discover Sentry OAuth through its MCP resource (#15837)
Correct Sentry OAuth discovery and cover new and saved client registration.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 17:10:23 -07:00
DottaandPaperclip 754a4e792e fix(computers): authorize scoped cleanup of previous viewers
Preserve the full route regression suite in the stacked acceptance proof branch. Cleanup remains fenced by company, environment, current user, and exact owner generation.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 16:18:01 -05:00
DottaandPaperclip 5c3cd777df fix(computers): expose persistent instructions and managed CLI skills
Integrate the scoped production correction and existing config test from 2700054c6a. Full Claude and Codex execute regressions remain in the stacked acceptance PR.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 15:32:22 -05:00
DottaandPaperclip d22b935d29 fix(computers): select latest task admission for previews
Integrate the production route correction from 5af1eb0762; its full route regression suite remains in the stacked acceptance PR.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 15:17:11 -05:00
DottaandPaperclip 1b53cdce80 fix(computers): refresh desktop credentials on explicit connect
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 15:05:31 -05:00
DottaandPaperclip 5e5fe7a708 fix: discard inaccessible computer write receipts safely
Preserve removed, replaced, or permission-restricted temp parents while allowing unrelated file operations to continue. Keep unknown I/O failures visible.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 14:22:43 -05:00
DottaandPaperclip d2235865bb fix: retain Boat search results when child folders disappear
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 14:12:58 -05:00
DottaandPaperclip 61888f6d58 fix: reclaim recorded interrupted computer saves
Keep an exact inode receipt under the existing editor lock before writing temporary content. Recover only that recorded inode on the next operation and preserve replacements and unknown files.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 14:12:49 -05:00
DottaandPaperclip 47b4bc1d4e fix: enforce file operation deadlines inside the remote process group
Apply GNU timeout after SSH admission deducts queue time. Verify a delayed remote-shaped Python write is killed independently of local SSH termination.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 13:59:39 -05:00
DottaandPaperclip ff2598c3d8 fix: preserve automatic workspace fallback for missing Boat files
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 13:56:40 -05:00
DottaandPaperclip 9c583bf39d fix: share one bounded lifetime across computer file operations
Propagate the admitted operation deadline through readiness, claims, and SSH commands. Keep only a bounded transport-settlement hold, and expire a short file waiter without cancelling shared SSH initialization.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 13:56:40 -05:00
DottaandPaperclip 2c09c8c16d Merge master into Boat core and regenerate migration after fast responses
Preserve the exact deployed Boat SQL hash under generated migration 0332 so existing staging databases recognize its history. Keep additive schema and shared exports from both branches.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 13:43:07 -05:00
DottaandPaperclip 5db007c6f5 fix: initialize persistent Boat instruction bundles safely
Apply the reviewed initialization fix; acceptance coverage remains in the stacked UI PR.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 13:36:00 -05:00
DottaandPaperclip b1ebe3de3c perf(chat): wake action queues from commits and deadlines (#15808)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Chat keeps durable rows for provider actions and setup messages.
> - Five action queues still scan the database every second when empty.
> - Empty scans add idle database traffic and prevent cost savings from
sleep.
> - This pull request wakes these queues when their writes commit or
their next deadline arrives.
> - Existing rows retain retry and restart recovery. Empty queues stop
scanning.

## Linked Issues or Issue Description

Refs #15802, #15625, #15750, #15757. Related allocation work: #15153.

**What existing behavior does this improve?**

Idle chat reconciliation for Slack Board messages, Slack slash-command
task starts, Slack setup verification messages, receipt reactions, and
Slack session stops.

**Current behavior**

The app runs these five queue scans through chat maintenance every
second, including when no work exists.

**Proposed behavior**

Each queue has an independent worker on the existing scheduler.
Producers and foreground claim/retry/settlement writes announce work
inside their database transaction. The worker wakes after the outer
transaction settles. Startup restores durable work. Shared dispatch and
deadline predicates select real retries and abandoned claims. Empty
queues disarm.

**Subsystem affected**

Server chat services. No schema or migration changes.

## What Changed

- Register five action workers alongside the three delivery workers from
#15802. Remove their scans from periodic app maintenance.
- Share action eligibility between dispatch and deadline selection. Park
paused Board messages and task starts until endpoint changes. Preserve
uncertain-send quarantine.
- Wake setup verification after account, welcome, registration, or
authenticated callback changes. Exclude prerequisites that need another
event.
- Persist a retry time for failed provider-confirmed task admission. Its
own commit notification cannot cause an immediate retry loop.
- Reuse the existing transaction signals and scheduler registration
code. Provider calls remain outside database transactions.
- Update the instance-sleep inventory and add scheduler and PostgreSQL
regression coverage.

## Verification

- Passed: 37 scheduler, coordinator, and app-wiring tests, including an
idle hour with no further scans or timers.
- Passed: seven focused PostgreSQL chat cases. These cover deadline
eligibility, startup recovery, outer-commit wakes, actual producer
signals, and signed-callback verification without maintenance polling.
- Passed: `pnpm typecheck`.
- Passed: full chat integration suite and related
publication/coordinator tests, **1,278 tests** across six files,
including **1,228 chat integration cases**.
- Passed: `pnpm build`.
- After the review fix, seven focused PostgreSQL integration cases and
the server typecheck passed again. Deadline and dispatch queries now
exclude completed action history.
- Greptile: **5/5** on `35a979fce6bb9ab910fab3373ec8e537fc2d01a9`, with
the prior finding resolved and no new findings.
- Fixed a CI timing failure in the GitHub mention integration test:
asynchronous admission now has an explicit ten-second assertion deadline
instead of the default one second. The failure reproduced locally; all
five mention variants and all 398 cases in the matching CI shard pass
after the fix.
- Hosted CI passed on `35a979fce6bb9ab910fab3373ec8e537fc2d01a9`: **54
successful checks**, two intentionally skipped Storybook checks, no
failures or pending checks.

Provider responses are simulated in the integration suite. PostgreSQL,
transactions, service dispatch, and scheduling are real. No live Slack
workspace was used.

## Risks

- Every producer that changes runnable state must emit a transaction
signal. This change covers the five queues and their foreground
dispatch/retry paths. Direct SQL and independent DB owners still need
explicit integration or startup recovery.
- Missing retry or claim deadlines can strand work. Tests compare the
dispatch and deadline behavior, including paused and uncertain states.
- Other provider maintenance, sockets, and scheduled jobs remain. This
change does not establish full instance sleep.
- No new tables, migrations, or provider credentials are required.

## Model Used

OpenAI Codex (GPT-6), with repository inspection, code execution, and
automated tests.

## 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-10-10 13:14:23 -05:00
DottaandPaperclip a7dd5284b5 feat: add company fast-response acknowledgements (#15748)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Human messages start agent work through task, chat, and
external-channel intake.
> - Agent startup can delay the first visible response.
> - A small direct model call can acknowledge the request while normal
work starts.
> - This response must remain separate from evidence that the agent
answered or completed work.
> - This pull request adds optional company-wide fast responses with
durable receipts, access checks, and cost accounting.
> - Users receive prompt acknowledgement without changing the agent
execution path.

## Linked Issues or Issue Description

**Subsystem affected**

Cross-cutting: database, shared contracts, server orchestration,
connections, and UI.

**Problem or motivation**

Users can wait for an agent to start before they receive a contextual
response. Generic progress messages do not confirm what the user asked.
An acknowledgement must not falsely complete work or satisfy an
unanswered turn.

**Proposed solution**

Add a disabled-by-default experimental fast-response model using an
existing shared API connection. Generate one short acknowledgement for
each accepted human turn. Use the existing agent identity and external
publication outboxes. Retain platform provenance and account for the
inference independently.

**Alternatives considered**

Running the acknowledgement through the agent runtime adds startup
latency. Restricting implementation to OpenRouter leaves other existing
API connections unsupported. This change supports all existing API
connections and uses OpenRouter for live verification.

**Roadmap alignment**

This extends existing agent communication and connection settings.
ROADMAP.md and open pull requests were checked. No duplicate
fast-response implementation was found. The maintainer supplied the
feature plan directly.

## What Changed

- Add Experimental fast responses to instance settings. Keep the feature
off by default. Enforce the flag at intake, dispatch, and publication.
- Move Decision model and Fast response setup to company Settings →
Connections when the experiment is enabled. Place Connections below
Environments. Separate the model sections with clear headings and a
divider. Keep Decision model in General when the experiment is off.
Route Costs setup links to the available settings page.
- Make the acknowledgement prompt a multiline template string. Ask for a
brief, positive response in the user’s language.

- Add settings, connection/model selection, sponsorship, fixed-sample
testing, and Costs history.
- Add a Vercel AI SDK text service for existing native, routed, Bedrock,
and local API connections.
- Add durable per-turn requests, a bounded worker, a three-second
admission deadline, and one inference attempt.
- Integrate task creation, task and agent chat, steering, queued
follow-ups, experimental board chat, shared chat intake, and email.
- Preserve receipt provenance and exclude receipts from completion,
recovery, interaction resolution, and agent wakeups.
- Recheck authorization, source validity, real replies, budgets, and
destination binding before publication. Preserve accounting for
suppressed or uncertain outcomes.
- Add provider contracts, database race tests, channel outbox tests, UI
tests, Stories, and documentation. Keep decision-model execution
unchanged.

## Verification

- Local `pnpm -r typecheck`, `pnpm build`, and UI token gates pass after
rebase. The UI typecheck and build also pass after the final navigation
fixes. All 37 focused navigation tests pass. The first full local `pnpm
test:run` invocation reported seven chat failures. All seven passed in
isolated reruns after fixture updates and host cleanup. This invocation
was stopped after the full final-head CI suite passed.
- Initial local database tests hit macOS shared-memory exhaustion. A
diagnostic confirmed `shmget: No space left on device` with the system
limit of 32 IDs. Three abandoned, unattached PostgreSQL IPC headers were
reclaimed. The isolated rerun passed all 31 fast-response and channel
tests. The two additional Slack regression cases also passed in a
separate rerun. No active database was stopped.
- UI token gates pass. Provider contract tests cover all supported API
connection types. Fast-response tests cover uniqueness, authorization,
budgets, expiry, cancellation, restart, real-reply races, and the
experimental flag.
- The test drive verified that disabling the experiment hides
Connections and redirects its direct URL. Enabling it restores the saved
OpenRouter setup. After restart on the final commit, the OpenRouter
settings sample returned “Sure, I’ll take care of fixing the border
around the settings panel.” in 428 ms. It used 260 input and 31 output
tokens and recorded $0.0000576 in reported cost.
- Earlier live OpenRouter verification produced a receipt in 1.013
seconds for a new task. The real agent then supplied its substantive
answer. A separate settings test took 1.34 seconds, used 246 input and
23 output tokens, and recorded $0.0000361.
- Live Slack verification on final commit
`24016fa525961ebc7a4acffdc5019ce123970549` passed for a fresh initial
task and a follow-up in a disposable bot DM. The initial acknowledgement
appeared 2.405 seconds after the Slack message and 1.413 seconds after
durable acceptance; the follow-up appeared in 2.322 seconds and 1.160
seconds respectively. The recorded generation/settlement durations were
898 ms and 697 ms. The initial call used 291 input / 39 output tokens
and cost $0.00006705; the follow-up used 281 / 47 and cost $0.00007035.
- The Slack acknowledgements retained the assigned agent identity and
`origin: fast_response`, source-turn references, and no fabricated run
ID. A status snapshot after the initial receipt showed the task still
`in_progress` with its real execution run. The agent then read the CSV
fixture and correctly reported two ready items, two blockers, and their
owners. Both replies stayed in the originating DM, and no duplicate
generic working message followed the delivered contextual
acknowledgements. The `new` command started a fresh conversation session
without generating a fast response.
- An earlier eligible Slack turn generated a response but suppressed
publication. Its reported cost was retained, generic progress remained,
and the real agent completed the requested result. This is recorded
separately from the two delivered acknowledgements; the history did not
expose a precise suppression reason.
- Slack verification used real signed provider events, the existing
intake/publication paths, and a user-approved temporary webhook-only
HTTPS tunnel. Subscriptions were limited to direct-message events. The
test bot was paused and the tunnel stopped afterward. Live
channel/group-thread and GitHub journeys remain unverified; their mocked
tests cover intake, destination binding, publication, and continued
underlying work.
- Greptile reviewed final commit
`24016fa525961ebc7a4acffdc5019ce123970549` at 5/5. Both new review
findings are fixed and all threads are resolved. [Final-head CI
run](https://github.com/paperclipai/paperclip/actions/runs/38060015730)
passed. This includes grouped server/chat/workspace tests, serialized
suites, runner checks, browser journeys, typecheck, build, release
registry, policy, and the canary dry run.
- Manual check: enable Experimental fast responses. Open company
Settings → Connections. Select a shared API connection and model. Save
and use Test response. Submit a task message and confirm that its
receipt does not complete the task.

## Risks

- The migration adds receipt and configuration tables plus accounting
references. It uses idempotent statements and follows the current
migration sequence.
- A slow provider, authorization change, or real-agent reply can
suppress an acknowledgement. Existing progress feedback remains
available.
- Unknown provider billing retains a reservation until reconciliation.
External deliveries with uncertain outcomes must not be blindly
repeated.
- Live Slack initial-task and follow-up DM journeys pass. Live Slack
channel/group-thread and GitHub journeys remain unverified. The PR
remains a draft and records these gaps. Final-head repository CI and
automated review pass.

## Model Used

OpenAI Codex, based on GPT-6, with reasoning, repository tools, code
execution, and browser interaction. The runtime does not expose an exact
model snapshot ID or context-window size; these are not asserted.

## 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-10-10 13:09:17 -05:00
DottaandPaperclip eb8044bccc fix: separate workspace origin from replaced process authority
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:36:30 -05:00
DottaandPaperclip ce107d4710 fix: validate persisted warm origin run identity
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:27:56 -05:00
DottaandPaperclip cfa2b81539 fix(computers): allocate listeners outside guest ephemeral ports
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:27:30 -05:00
DottaandPaperclip d91b4fef7b fix(computers): keep shared desktop input outside agent ownership
Launch repaired IBus in a collected app.slice service so native owner retirement cannot kill the shared desktop daemon. Presence renewal refreshes credentials without repeating input readiness; explicit Connect still prepares the desktop.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:21:34 -05:00
DottaandPaperclip d4047f2fef fix(computers): reserve lifecycle traffic capacity during workspace setup
Route project setup and file operations through ordinary SSH admission, retaining reserved control capacity for owned-port inspection and lifecycle operations.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:19:06 -05:00
DottaandPaperclip d3fc9db89e fix: verify original workspace lineage after warm retirement
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:13:40 -05:00
DottaandPaperclip 43b818a39a test: synchronize remote upload concurrency assertions
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:11:49 -05:00
DottaandPaperclip 546dcb9daf Keep remote instructions usable in large persistent folders
Use bounded partial directory pages with a global metadata limit and explicit listing/export warnings. Always inspect the configured entry directly so it remains readable beyond the first page.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:10:52 -05:00
DottaandPaperclip fe619aa13a fix(computers): prune retired desktop viewers during reconciliation
Keep active viewer leases and retired runner process proof, while removing expired or disconnected viewer records from the host ledger.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:08:58 -05:00
DottaandPaperclip 6726f78238 fix(computers): serialize shared project checkout setup
Hold a confined per-project flock across clone, repository validation, checkout, and worktree creation so another agent cannot observe partially created Git state.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 12:08:58 -05:00
DottaandPaperclip 469da8b2c2 fix(boat): stage immutable context per bootstrap attempt
Bind generated instructions and skills to fresh attempt-owned snapshot paths, retaining old immutable snapshots without touching persistent user files or provider HOME. Record possible process dispatch only at the actual launch RPC boundary so preparation failures can retire their exact owner safely.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 11:56:53 -05:00