Commit Graph
5064 Commits
Author SHA1 Message Date
DottaandPaperclip 2c477fa4ed Keep owned stdin valid until command completion on Boat
Boat invalidates descriptors for unlinked backing files, causing Node startup to abort. Retain the0600 stdin spool until normal cleanup, and reap abandoned command spools only after exact-owner retirement stops its cgroup.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:28:34 -05:00
DottaandPaperclip 61badce4a9 Use isolated computer storage paths during restart reattachment
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:24:18 -05:00
DottaandPaperclip ada4a0d521 Synchronize isolated Boat runtime assets with backend review
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* codex/boat-environment-core:
  Isolate persistent computer runtime assets by agent session
2026-10-10 10:23:10 -05:00
DottaandPaperclip 8d0beb8c0b Isolate persistent computer runtime assets by agent session
Root runner binaries, harness installs, provider packs, and session state under the trusted persistent agent home and normalized session. Keep the shared project working directory unchanged and preserve existing sandbox paths.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:22:38 -05:00
DottaandPaperclip 5a16ef77c0 Isolate persistent computer runtime assets by agent session
Root runner binaries, harness installs, provider packs, and session state under the trusted persistent agent home and normalized session. Keep the shared project working directory unchanged and preserve existing sandbox paths.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:21:55 -05:00
DottaandPaperclip 9eb02247bb Keep Boat runtime and acceptance reviews in sync
Retain the complete acceptance coverage in the combined qualification branch while the core PR remains under its review file limit.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:19:11 -05:00
DottaandPaperclip 4d2113e188 fix(runtime): retain safe private Codex installation diagnostics
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:17:35 -05:00
DottaandPaperclip 180bfdcb0a Keep extended runner acceptance cases in the stacked feature PR
Preserve the original baseline suites on the backend branch while the full Boat feature branch retains all added runtime-context, transport, and SSH acceptance coverage.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:17:23 -05:00
DottaandPaperclip 00d1d4ea61 fix(runtime): bind persistent computer homes into Claude runtime context
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:17:23 -05:00
DottaandPaperclip 2cbe65e971 fix(runtime): retain safe private Codex installation diagnostics
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:17:02 -05:00
DottaandPaperclip 51e52d5849 fix(runtime): bind persistent computer homes into Claude runtime context
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:16:34 -05:00
DottaandPaperclip b52863e616 Authenticate Boat initial checkouts with run-scoped Git credentials
Pass the existing workspace credential provider through computer realization separately from durable metadata, and supply its URL-scoped helper only to the clone subprocess. Verify authenticated clone behavior and credential non-retention.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:16:34 -05:00
DottaandPaperclip ec80163f2f fix(computers): delete large agent files without downloading
Hash remote files through confined descriptors in bounded chunks before editor mutations. Preserve the remote compare-and-swap removal check and read-size cap; cover a real 17 MiB file, stale deletion, and path confinement.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:16:15 -05:00
DottaandPaperclip 03542b0845 Authenticate Boat initial checkouts with run-scoped Git credentials
Pass the existing workspace credential provider through computer realization separately from durable metadata, and supply its URL-scoped helper only to the clone subprocess. Verify authenticated clone behavior and credential non-retention.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:16:15 -05:00
DottaandPaperclip 7315159c3d fix(computers): delete large agent files without downloading
Hash remote files through confined descriptors in bounded chunks before editor mutations. Preserve the remote compare-and-swap removal check and read-size cap; cover a real 17 MiB file, stale deletion, and path confinement.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:15:51 -05:00
DottaandPaperclip 25c12848a2 fix(runtime): allow supervised identity reads within startup deadline
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:11:01 -05:00
DottaandPaperclip b43a695170 fix(runtime): allow supervised identity reads within startup deadline
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:10:36 -05:00
DottaandPaperclip fa9c3451a0 Preserve the backend split in the Boat qualification branch
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* codex/boat-environment-core:
  Add persistent Boat computer environments and runner ownership
2026-10-10 10:10:36 -05:00
DottaandPaperclip f6aade3bae Add persistent Boat computer environments and runner ownership
Introduce company-scoped computer attachments, bounded runner and viewer ownership, persistent files and worktrees, Boat ingress, and native and legacy runtime integration behind the experimental Boat flag. Keep desktop UI and extended acceptance cases in the stacked feature branch.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:07:51 -05:00
DottaandPaperclip 88750b687c test(runtime): type the complete computer bridge fixture
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 10:00:56 -05:00
DottaandPaperclip 3017b50a07 Preserve native runner shell arguments through systemd
Disable systemd environment expansion so the shell receives its identity marker variables and positional arguments unchanged.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:58:15 -05:00
Dotta 4cf9c56441 fix(runtime): retry inconclusive remote process observations 2026-10-10 09:55:57 -05:00
DottaandPaperclip b7806aed05 docs: record Boat qualification evidence and remaining checks
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:54:19 -05:00
DottaandPaperclip 8c1f3cb7e0 Explain when a task dev server is unavailable
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:52:21 -05:00
DottaandPaperclip 52a90ad969 Preserve requested Boat branches and bound remote file enumeration
Keep worktree branch creation separate from the starting ref. Return capped directory results with truncation, use exact metadata lookups for previews, and adopt existing personal homes without enumerating their contents.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:51:13 -05:00
Dotta e498b05159 fix(runtime): bound shared uploads and restrict computer tools to writable tasks 2026-10-10 09:50:16 -05:00
DottaandPaperclip 9ef482b1d0 Fence computer admission when task work mode changes
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:50:16 -05:00
DottaandPaperclip e450faf402 fix: preserve pinned Boat credentials on environment edits
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:50:07 -05:00
DottaandPaperclip eaf6be127b Preserve external instruction authority on Boat environments
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:46:56 -05:00
DottaandPaperclip d1e5e6340c test: recognize computer lease capability traits
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:44:14 -05:00
Dotta cb9aba69b7 fix(runtime): bind retained GitHub bridge to computer process authority 2026-10-10 09:42:05 -05:00
Dotta d7221a2fc8 test(runtime): cover admitted computer replacement across configuration changes 2026-10-10 09:39:38 -05:00
Dotta c772081310 fix(runtime): retain anonymous computer launchers across warm turns 2026-10-10 09:39:38 -05:00
Dotta 9abc54f48c fix(runtime): upload large runner binaries in bounded parallel chunks 2026-10-10 09:39:38 -05:00
DottaandPaperclip 651092fbdc Include credential and tool refresh identity in computer admission
Known native cache invalidations must choose a fresh computer owner before handing off the previous owner's generation.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:36:55 -05:00
DottaandPaperclip 800f1d4190 Merge master and preserve Boat execution through heartbeat extraction
Port remote branch validation and scoped startup cancellation into executeHeartbeatRuntime. Keep persistent workspace preparation at the heartbeat orchestration boundary.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:35:58 -05:00
Dotta 1412a62aff test: include computer in environment capability registry 2026-10-10 09:25:39 -05:00
Dotta a5142d1f68 test: explicitly select fake Codex for native recovery fixture 2026-10-10 09:22:59 -05:00
Dotta 1c5058a98e Budget remote artifact upload and preserve safe failure diagnostics 2026-10-10 09:20:43 -05:00
Dotta f9e1172494 Handle SSH input pipe failures without crashing the controller 2026-10-10 09:16:04 -05:00
Dotta 1bbc019965 Exclude macOS metadata sidecars from remote provider archives 2026-10-10 09:14:06 -05:00
DottaandPaperclip 19e9facc5b perf(chat): wake delivery queues from commits and deadlines (#15802)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Chat connectors store incoming messages and outgoing publications in
durable queues.
> - The app checks these queues every second, even when they are empty.
> - Empty scans keep the database active and hinder instance sleep.
> - This pull request wakes three queue workers after transactions
settle and at known retry or recovery deadlines.
> - Empty queues stop scheduling checks. Existing rows retain their
ordering, retry, and recovery rules.

## Linked Issues or Issue Description

**What existing behavior does this improve?**

Idle database activity from incoming chat deliveries, outgoing
publications, and Slack upload receipt recovery.

**Subsystem affected**

`server/` — chat delivery and background work scheduling.

**Current behavior**

The app's one-second chat timer scans the three queues together with
provider and action maintenance. Empty queues continue to query
PostgreSQL.

**Proposed behavior**

Register three independent workers with the existing delivery
coordinator. Producers announce work inside their database transactions.
Commit wakes the corresponding worker. Startup restores outstanding
work; persisted retries and stale claims supply the next deadline. An
empty queue has no recurring scan.

**Reason and benefit**

Remove avoidable queue reads without requiring a new table, an external
scheduler, or a persistent PostgreSQL listener.

**Breaking changes**

No schema or public API change. Work notifications are scoped to the
app's shared database owner. Direct SQL and independent database roots
do not send these notifications; startup still scans durable work.

**Additional context**

Refs #15625, #15750, and #15757 for the preceding sleep work. Related:
#15153 reduces chat query allocation while retaining polling. This PR
changes when the three queue workers run; it does not add query caching.

## What Changed

- Register independent incoming delivery, publication, and Slack receipt
workers on the shared scheduler.
- Add transaction work signals at queue writes, endpoint state changes,
and action transitions that unblock publications. Keep provider I/O
outside the added transactions.
- Restore deadlines from durable retry times, abandoned claims, and
publication lease expiry. Share publication and receipt eligibility
rules between dispatch and deadline queries. Respect incoming
conversation order and lifecycle dependencies.
- Exclude publications blocked by unresolved Slack tool sends. Wake them
when the tool receipt changes.
- Wake publication dispatch when an endpoint send finishes so free slots
refill. Preserve per-endpoint concurrency, conversation order, and
conservative handling of uncertain sends.
- Wake receipt recovery when a stale publication becomes
`delivery_unknown`, and wake queues when a provider connection recovers.
- Commit interaction publications with their callback tokens so dispatch
cannot see an incomplete card.
- Keep provider runtimes, other action outboxes, milestone and
wake-notice projection, Teams protocol maintenance, GitHub recovery, and
Slack session synchronization on their existing maintenance cadence.
This PR does not make the whole chat subsystem idle.
- Update the instance sleep inventory with this partial migration and
its remaining work.

## Verification

- All 1,225 PostgreSQL chat integration cases passed across the three
hosted chat shards. These cover retry and lease deadlines, blocked
followers, unresolved Slack sends, provider recovery, commit visibility,
and endpoint slot refill.
- 32 local app-wiring, queue-worker, and delivery-coordinator tests
passed after updating the wiring assertion for event-driven dispatch.
Fake timers cover an hour of idle time without queue scans.
- Related publication, interaction, receipt, and wake-notice tests
passed locally. The 13 interaction integration cases include atomic
rollback when callback-token storage fails.
- Local `pnpm typecheck`, `pnpm build`, and final server typecheck
passed. All hosted checks passed on the final commit, including build,
typecheck, test shards, release registry checks, and the canary dry run
(54 successful checks; two Storybook checks skipped for this backend
change).
- The last local PostgreSQL rerun was skipped because the embedded
database startup probe failed after five attempts. The hosted PostgreSQL
cases ran successfully; their skips only partition cases across shards.
- `git diff --check` passed. Greptile is 5/5 on the final commit with no
unresolved findings.

## Risks

- Every producer that makes queued work eligible must send a transaction
work signal. The tests exercise commit visibility, concurrent wakes,
worker failures, and restart recovery. Future direct SQL writers must
participate in this contract.
- The existing database work-signal layer reconciles uncertain
transaction outcomes. This PR adds no work-signal table or schema
migration.
- Provider and action maintenance still polls. Further changes are
required before an idle chat-enabled instance can sleep.
- Tests use real PostgreSQL with simulated provider responses; they do
not send messages through live provider accounts.

## Model Used

OpenAI Codex, based on GPT-6, with reasoning, tool use, and code
execution. The exact serving model ID and context-window size are not
exposed in this session.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [ ] 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 09:13:44 -05:00
Dotta 853351c0a1 Expect disabled Boat flag when normalizing legacy settings 2026-10-10 09:13:15 -05:00
Dotta 4db5d95ecc Report bounded provider pack upload progress in run logs 2026-10-10 09:12:27 -05:00
Dotta 63a9e1a168 Expose trusted persistent agent homes to native Codex shells 2026-10-10 09:11:24 -05:00
DottaandPaperclip 1fb3f9746e refactor(heartbeat): extract prepared runtime execution (#15803)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Heartbeat prepares, dispatches, and completes each agent run.
> - After the runtime-selection extraction, the main service still had
7,295 lines.
> - Provider dispatch and workspace finalization formed one large block
with shared cleanup rules.
> - This pull request moves that block into a typed runtime-execution
module.
> - The service now has 6,417 lines. Readers can follow admission and
outer cleanup without reading the provider execution details.

## Linked Issues or Issue Description

Follow-up to #15746. I searched open heartbeat PRs and issues. I found
no competing runtime-execution extraction.

**What existing behavior does this improve?**

The organization and test coverage of native and legacy heartbeat
execution.

**Current behavior**

The heartbeat service contains a 912-line block for provider dispatch,
usage capture, workspace finalization, and instruction cleanup.

**Proposed behavior**

Move that block to `server/src/services/heartbeat/runtime-execution.ts`.
Keep the atomic dispatch gate, admission, terminal run status, and outer
lease cleanup in the service. Preserve run behavior.

**Reason and benefit**

This gives runtime execution a named boundary and direct tests. It
removes 878 lines from the main service in one bounded change.

**Breaking changes**

None intended. There are no schema, API, or policy changes.

## What Changed

- Add `executeHeartbeatRuntime` for prepared native and legacy
execution, usage capture, workspace finalization, and
gateway/instruction cleanup.
- Return an explicit dispatch result. Update outer ownership state
through immediate callbacks, including before exceptions. Read
instruction state through live getters.
- Move the two internal recovery error classes with their existing
behavior. The caller imports the same classes for `instanceof` checks.
- Add 15 database-backed execution tests. Keep the existing heartbeat
regression suites.
- Repair the native Stop acceptance fixture: installed Codex now takes
precedence over `PATH`. A test-only loader pins the fake provider. An
isolated home and dummy key keep readiness offline. Add four loader
tests.
- Document the module boundary and fixture setup.

## Verification

- Passed: eight focused heartbeat suites (483 distinct tests, including
15 new execution tests). The boundary suite passed again after adding
the failed-restore retention case from review.
- Passed: `node --test
tests/e2e/fixtures/composer-stop-codex-loader.test.mjs` (four tests).
- Passed: `pnpm -r typecheck` and `pnpm build`.
- Passed: AST comparison of all 912 moved lines after the explicit
boundary substitutions. SQL template text, recovery class bodies, public
exports, and the rest of the executor match the baseline.
- Passed: browser Stop journeys for legacy process and native Paperclip
Runner (two tests). The native fixture log proves provider `turn/start`
before Stop and `turn/interrupt` after Stop.
- Passed: all three ACP continuation browser journeys (same-session
queued input, no replay of an interrupted write, and a new direction
after composer Stop). Five relevant browser journeys passed in total.
- Passed: the full CI test groups, including all server, chat,
workspace, serialized-server, runner, and browser shards.
- Local full-suite limitation: `pnpm test:run` first hit the macOS
shared-memory segment limit while starting embedded PostgreSQL. After
releasing only this task’s unused acceptance-server segments, the retry
progressed without reported failures. I stopped that duplicate run after
the full CI test groups passed.

- Passed: all 56 PR checks/statuses on
`8694c116e8d43ed8ac11bc4c58623ea3af34a675`. Greptile is 5/5 with no
unresolved review threads.

## Risks

- Cleanup depends on state written before an error. The module reports
dispatch, retention, and recovery ownership immediately. Tests cover
early returns and exceptional cleanup.
- Instruction callbacks can replace saved metadata during execution.
Live getters preserve those changes.
- Native acceptance uses a real server, database, browser, and Rust
runner with a deterministic provider. It does not verify a live provider
service.

## Model Used

OpenAI Codex, GPT-6 family, with reasoning and repository/tool access.
The exact serving model ID and context-window limit were not exposed in
this session.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [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 09:10:53 -05:00
Dotta 440482b396 Recognize remote computer state during exact warm handoff 2026-10-10 09:09:12 -05:00
Dotta 46fd97371a Wait for terminal computer turn cleanup before admitting follow-ups 2026-10-10 09:09:12 -05:00
Dotta dd8a5c38af Document computer routes and restore experimental setting order 2026-10-10 09:05:04 -05:00
DottaandPaperclip 1c4d403044 test: group computer environment selection with driver contracts
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 09:05:04 -05:00