Commit Graph
3546 Commits
Author SHA1 Message Date
Dotta c2824ce7f7 docs(runner): specify phase 4b live codex web ui 2026-08-08 03:19:05 +00:00
DottaandPaperclip eef193508d fix(runner): stabilize warmed Codex isolation evidence
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 03:11:05 +00:00
DottaandPaperclip 373b609ff1 fix(runner): reject cross-channel result conflicts
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 02:25:41 +00:00
DottaandPaperclip 3a8d4b3e21 fix(runner): persist exact-turn recovery state
Bind Codex reconciliation to the persisted active turn and retain semantic-result and terminal fingerprints across transport recovery. Align Phase 4 docs with content-idempotent retry behavior.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 02:13:44 +00:00
DottaandPaperclip 8d4ffe7f2b fix(runner): isolate Codex credentials and hostile output
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 02:07:33 +00:00
DottaandPaperclip 6391608e8f fix(runner): enforce phase 4 status authority
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 01:53:48 +00:00
DottaandPaperclip 2161ddcc4a feat(runner): add skillless Codex app-server tracer
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 01:33:36 +00:00
Dotta 6f179780e2 docs(runner): authorize phase 4 work 2026-08-08 00:39:54 +00:00
DottaandPaperclip abb5ceb6b6 fix(runner): close bootstrap auth race
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 00:03:08 +00:00
DottaandPaperclip 5da7172af5 feat(runner): expand recovery diagnostics
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 23:59:43 +00:00
DottaandPaperclip 816aedb561 docs(runner): document authenticated phase 3 transport
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 23:52:43 +00:00
DottaandPaperclip 313c40cd9b fix(runner): close phase 3 security integrity gaps
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 23:51:38 +00:00
DottaandPaperclip 486069e369 docs(runner): record Phase 3 recovery evidence
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 23:37:40 +00:00
DottaandPaperclip b6ec51df04 feat(runner): add durable Phase 3 recovery transport
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 23:37:33 +00:00
Dotta 3aa01325a2 docs(runner): authorize phase 3 recovery tracer 2026-08-07 23:11:04 +00:00
DottaandPaperclip a9e6db06e0 fix(runner): address phase 2 tutorial QA
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 22:13:41 +00:00
DottaandPaperclip bfef34393c fix(runner): harden phase 2 local boundaries
Enforce loopback/same-origin transport and bounded browser resources, frame harness output before allocation, and reconcile terminal state from runner-owned facts.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 21:32:24 +00:00
DottaandPaperclip 90daf4ff00 fix(runner): polish live browser diagnostics
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 21:31:46 +00:00
DottaandPaperclip 7e0c8632da docs(runner): document Phase 2 verification
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 21:09:28 +00:00
DottaandPaperclip f32331a567 feat(runner): add Phase 2 local harness loop
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 21:09:14 +00:00
Dotta 77fce1a6ed docs(runner): authorize phase 2 and clarify tutorials 2026-08-07 20:30:06 +00:00
DottaandPaperclip 1222f5fc53 chore(runner): phase 1 checkpoint
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 19:13:10 +00:00
DottaandPaperclip a4af3caea7 docs(runner): record phase 1 replay evidence
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 19:13:07 +00:00
DottaandPaperclip 1b51f95c6c feat(runner): add phase 1 static replay contract
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 19:13:00 +00:00
DottaandPaperclip a86edda579 fix(runner): establish phase 0 rust boundary
Add the production-direction Cargo workspace, make the Rust tracer the default Phase 0 path, and enforce shared-fixture parity with the TypeScript reference. Extend standalone boundary checks and record the correction in the implementation plan and OKF journal.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 18:12:48 +00:00
DottaandPaperclip 1daa51d9eb test(runner): reconcile phase 5 status fixtures
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 16:37:47 +00:00
DottaandPaperclip 164e44ef4e feat(runner): add standalone phase 0 skeleton
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 16:33:01 +00:00
DottaandPaperclip 9349db8438 docs(runner): add status authority phase 5 conformance
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 16:24:58 +00:00
DottaandPaperclip 56606e1d16 docs(runner): reconcile resume-line order and add happy-path screenshot
UX review PAP-16714 findings applied:
- Resume line now normatively precedes the response control (UX doc 2.3),
  matching OPX-4/OPX-F3 DOM-order gates and the doc's own acceptance
  criterion 4; the PAP-16712 mockup footer placement is noted as
  non-normative.
- 18.12.13 screenshot matrix gains the accepted happy path
  (completion_contract_satisfied -> Done, four layers in agreement).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 16:13:03 +00:00
DottaandClaude Opus 5 90dc06f5d2 docs(runner): specify operator and reviewer read models
Phase 4 of the 18.3 status authority track (PAP-16713). Adds spec section
18.12, the binding contract between the arbitration/attention contracts
(18.3-18.11) and the approved operator UX reference.

- Ten presentation invariants (OPX-1..OPX-10) stated as testable criteria.
- Persistence prerequisites: attention_requests, attention_request_attempts,
  and attention_budgets, which 18.3.1 described but 18.7 never defined, plus
  the index the board summary needs.
- Read models: NativeOutcomeLayers carries all four authority layers as one
  embedded object, plus StatusDecisionView, RunFinalizationView,
  AttentionRequestView, and the compact list/board summaries.
- livePathIntegrity makes "every waiting state names an owner" a server
  assertion rather than a UI convention.
- Adds the missing attention read routes; specifies envelope asOf,
  authorization, and a whitelist redaction table.
- Client derivation rules, component data contracts, a requirement ->
  field -> component -> gate coverage matrix, degraded/legacy/error
  renderings, and gates OPX-F1..OPX-F11.

pnpm check:runner-phase4-spec enforces reason-code copy totality, read-model
coverage, gate reachability, invariant enforcement, route agreement,
backing persistence, and the claim copy law across both documents.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 16:06:00 +00:00
DottaandPaperclip b3699eb78f docs(runner): add approved status/attention operator UX reference
Extract the board-approved PAP-16712 UX design into
spec/paperclip-runner-status-attention-ux.md: layered outcome vocabulary
(turn/run/claim/status), OutcomeChipRow / StatusDecisionCard /
AttentionRequestCard / FinalizationErrorCard, five desktop board flows,
the v1 reason-code copy table, and token-system notes.

Core spec changes are pointers only: 18.3 names the reference doc as the
normative Phase 4 presentation, and the 18.11 UI-surfaces row now requires
the Phase 4 read models to carry every field that design renders.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 15:54:08 +00:00
DottaandPaperclip 35e1f4cd8c docs(runner): clarify interaction response cursors
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 15:52:44 +00:00
Dotta d358cf0ae8 docs(runner): extract tracer implementation plan 2026-08-07 15:51:16 +00:00
DottaandPaperclip 6ae4312262 docs(runner): reconcile interaction and status contracts
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 15:34:25 +00:00
DottaandPaperclip 7b15955ad8 docs(runner): design native status arbitration
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 15:32:09 +00:00
DottaandPaperclip d0234099ec docs(runner): inventory issue-thread interactions
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 15:14:19 +00:00
Dotta f39ed8f263 docs: require runner workspace compatibility 2026-08-07 14:05:53 +00:00
Dotta 3f19808815 docs: prioritize AgentCore and Cursor runner targets 2026-08-07 13:37:43 +00:00
Dotta 7ca755a071 docs: consolidate runner spec and cover MCP apps 2026-08-07 12:18:33 +00:00
Dotta 54651f650b docs: refine runner control boundaries 2026-08-07 12:03:07 +00:00
Dotta 2416cd5898 Merge remote-tracking branch 'origin/PAP-16679-paperclip-runner' into PAP-16679-paperclip-runner 2026-08-07 11:44:01 +00:00
Dotta 0fa3c589c8 docs: ground runner storage and remote providers 2026-08-07 11:44:01 +00:00
DottaandPaperclip 566c5e8411 docs: preserve native terminal dispositions
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 08:43:10 +00:00
DottaandPaperclip 6e623c7add docs: resolve native runner review findings
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 08:38:14 +00:00
DottaandPaperclip abc3495da5 docs: revise paperclip runner architecture spec
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 08:38:14 +00:00
DottaandPaperclip 15dce43e6b docs: add paperclip runner spike spec
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 08:38:14 +00:00
github-actions[bot]andlockfile-bot 4683f26c97 chore(lockfile): refresh pnpm-lock.yaml (#11036)
Auto-generated lockfile refresh after dependencies changed on master.
This PR only updates pnpm-lock.yaml.

Co-authored-by: lockfile-bot <lockfile-bot@users.noreply.github.com>
2026-08-07 03:07:55 -05:00
TonioandClaude Opus 5 11e56654f8 feat(ui): port onboarding flow from prototype; add cloud + local variants (#10786)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - First-run onboarding is the subsystem that turns a brand-new install
into a working company: it creates the company, its goal, a lead agent,
and that agent's first task
> - The existing `OnboardingWizard` carried all of that wiring
correctly, but its UI had drifted from the current design direction, and
a separate design prototype (`paperclip-onboard`) existed as a
standalone visual mock with no backend
> - Porting the prototype's *logic* would have thrown away working,
well-tested backend orchestration; leaving the two apart meant the
design never shipped
> - Separately, cloud and local (self-hosted) installs need meaningfully
different first runs — local has no sign-in and must let the user pick a
locally-installed CLI adapter — so a single linear wizard could not
serve both
> - This pull request rebuilds the presentational layer from the
prototype on top of the existing backend orchestration, and splits it
into two thin flow containers over a shared core
> - The benefit is that the shipped onboarding matches the intended
design, cloud and local can diverge without duplicating logic, and each
can later ship to a different app version while sharing one set of step
components

## Linked Issues or Issue Description

No existing issue — describing inline (feature request).

**What problem does this solve?**
Onboarding is the first thing a new user sees, and the shipped wizard
had drifted from the current design. In parallel, cloud and local
installs need different first-run paths: local has no hosted sign-in,
and its agent runs on a CLI adapter installed on the user's machine,
which the cloud path never has to ask about. There was no way to express
that difference without either forking the whole wizard or bolting
conditionals onto a single linear flow.

**Proposed solution**
Extract the onboarding step views and shell into a shared core, then
compose two thin flow containers (cloud and local) over it. Keep all
backend orchestration in the existing `useOnboardingFlow` hook so no
working logic is rewritten.

**Alternatives considered**
- *Single flow with a `variant` prop* — most DRY, but the two flows are
intended to ship on different app versions, and a shared file would have
to be split later anyway.
- *Two fully independent copies* — simplest per-flow, but every shared
refinement (spacing, motion, copy) would have to be made twice and would
drift.

## What Changed

- **Shared core** under `ui/src/components/onboarding/`:
`OnboardingScaffold` owns the full-screen shell and the single
`AnimatePresence` step crossfade, so both flows transition identically;
step views (Start / Company / Agent / Task), `FooterNav`, `AgentPreview`
and the motion constants are extracted for reuse.
- **`CloudOnboardingFlow`** — `start → company → agent → task`; mounted
in the real app via `OnboardingWizardVariant`. Behaviour matches the
retired wizard, including `previewMock` and the existing-company ("add
an agent") entry point.
- **`LocalOnboardingFlow`** — skips sign-in and adds an optional email
ask (with a privacy assurance), a local model/adapter step that hires
with `requireEnvProbe: true`, and a "star us on GitHub" interstitial
before completing. **Harness-only for now** — the real app still mounts
the cloud flow.
- **Deleted `OnboardingWizard.tsx`** (1,786 lines); updated its
Storybook stories and the `OnboardingWizardVariant` test to the new
components.
- **Orbiting 3D paperclip backdrop** behind the auth and welcome screens
(`three`), code-split so it only downloads on those screens; honours
`prefers-reduced-motion` and disposes its GL context on unmount.
- **`motion`** added for step transitions and the agent-capsule
choreography.
- Visual values routed through design tokens per `DESIGN.md`; `Stepper`
generalized to take a step total (backward compatible); `/design-guide`
page and the component index updated.
- **Standalone preview harness** (`ui/onboarding-preview.html`) with
`?flow=` and `?step=` for backend-free review, wired as a second Vite
rollup input.
- **Adapter env probe bound to the adapter it ran against.**
`hireLeadAgent` reused `adapterEnvResult` for any adapter, so when a
hire failed and the user picked a *different* local adapter and retried,
the previous adapter's verdict satisfied the `requireEnvProbe` guard
while the hire posted the new adapter's config — hiring it unprobed. The
cache is now keyed on the adapter type plus the exact config posted to
the test endpoint, the config is built once and shared by probe and
hire, a failed probe clears the cache, and `clearAdapterEnvResult()`
(called on adapter change) stops the step displaying a stale verdict.
Cloud is unaffected — it hires with `requireEnvProbe: false`. Reported
by Greptile.
- **E2E specs re-pointed at the new flow.** Four specs still drove the
deleted wizard (`onboarding`, `conference-room-typing-intro`,
`planning-mode-visual-verification`, `nux-phase4-screenshots`) and
failed with `element(s) not found` on `"Name your company"` /
`input[placeholder="Acme Corp"]`. Rather than repeat the new drive
sequence four times, `tests/e2e/onboarding-flow.ts` adds one driver per
step (`startCloudOnboarding`, `completeCompanyStep`,
`completeAgentStep`, `completeTaskStep`, `completeCloudOnboarding`) and
the specs import it, so the next flow change touches a single file. Two
now-dead `**/test-environment` route stubs went with it — the cloud flow
hires with `requireEnvProbe: false`, so that probe never fires.

## Verification

- `pnpm --filter @paperclipai/ui typecheck` — clean.
- `npx vitest run` over the onboarding suites
(`OnboardingWizardVariant`, `AgentCapsule`, `onboarding-launch`,
`onboarding-goal`, `onboarding-route`, `onboarding-adapter-config`) — 33
tests pass.
- `pnpm --filter @paperclipai/ui build` — succeeds; the three.js chunk
splits out separately (522 kB raw / 133 kB gzip) rather than entering
the main bundle.
- Both flows driven end-to-end in the preview harness in `previewMock`
(no database writes), plus the cloud flow rendered in the real
authenticated app at `/onboarding` to confirm the mount swap.
- The four re-pointed e2e specs pass locally against the new flow.
- New `ui/src/hooks/useOnboardingFlow.test.tsx` — 4 cases pinning the
adapter-probe cache (switch-adapter retry, cold path, explicit clear,
and the cloud flow's `requireEnvProbe: false`). Verified non-vacuous:
the switch-adapter case fails against the pre-fix code.
- Rebased onto current `master`; `pnpm-lock.yaml` is deliberately
**not** committed — `.github/workflows/pr.yml` regenerates it when a
manifest changes and shares it with downstream jobs as the `pr-lockfile`
artifact.

## Risks

- **Deleting `OnboardingWizard.tsx` is the one change that alters
existing app behaviour.** The cloud flow is intended to be
behaviour-equivalent, and its entry points are covered by the updated
`OnboardingWizardVariant` test, but this is the area to review most
closely.
- **Conflict risk with open PRs that touch the old wizard**: #9900,
#9501, #8982 and #6636 all modify
`ui/src/components/OnboardingWizard.tsx`, which this PR removes.
Whichever lands second will need its change re-applied to the new step
components. Flagging so ordering can be decided deliberately.
- **New dependencies**: `motion` and `three` (+ `@types/three`). `three`
is large, so it is lazily imported and code-split — it does not affect
the main bundle. Both are MIT.
- The **local flow is not reachable in the app** yet (harness/canary
only), so it carries no runtime risk today; wiring it up is a follow-up.
- The auth screens remain **presentational only** — they are not wired
to real auth, unchanged from before this PR.
- **Pre-existing, not introduced here:** `OnboardingWizardVariant`
renders outside `<Routes>` in `App.tsx`, so its `useParams()` never
resolves `:companyPrefix` and `/{prefix}/onboarding` opens the welcome
screen instead of jumping to the agent step. `master` has the identical
structure, so this PR faithfully ports existing behaviour; the working
"add an agent" entry is the launcher card behind the overlay, which is
what the screenshot spec drives. Worth a separate fix.

## Model Used

Claude Opus 5 (`claude-opus-5`) via Claude Code, with extended thinking
and tool use (repo search/edit, local test + build execution, and
browser-driven visual verification of the rendered flows). Portions of
the session also ran on `claude-opus-4-8` and `claude-fable-5`.

## Checklist

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

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
canary/v2026.807.0-canary.7
2026-08-06 23:35:05 -07:00
b67c512f82 feat(ui): live run label → run detail, running row → task detail (#11034)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The agent detail page has a Dashboard tab. The Dashboard tab shows a
"Live Run" section for the agent's current heartbeat.
> - The "Live Run" section has two clickable pieces: the section heading
and the running row. Both pieces linked to the same run detail page.
> - Two controls that go to the same place waste a navigation affordance
and hide the task the agent runs.
> - This pull request splits the two destinations. The heading goes to
the run. The running row goes to the task.
> - The benefit is that a user reaches the run internals from the label
and the work item from the row, in one click each.

## Linked Issues or Issue Description

No public GitHub issue exists for this change. The description follows
the enhancement issue template.

**What existing behavior does this improve?**
The "Live Run" section on the agent detail page, Dashboard tab (the
`LatestRunCard` component in `ui/src/pages/AgentDetail.tsx`).

**Current behavior**
The "Live Run" heading and the running row both link to the run detail
page (`/agents/:agentId/runs/:runId`). The row shows the run code and an
invocation-source chip. There is a separate "View details →" link that
also goes to the run detail page. A user cannot reach the task the run
works on from this section.

**Proposed behavior**
The heading becomes a link to the run detail page and appends the short
run code, shown as `Live Run · <run code>`. The redundant "View details
→" link is removed. The running row links to the task detail page when
the run's context snapshot resolves to a known issue, and the row then
shows the task status glyph, the task slug, and the task title. A pure
timer heartbeat with no resolvable task keeps the previous behavior: run
code plus source chip, linking to the run detail page.

**Reason and benefit**
The heading and the row now go to distinct, intuitive destinations. A
user reaches the run internals from the label and the work item from the
row, each in a single click. The fallback keeps heartbeats with no task
readable and avoids a blank or broken row.

## What Changed

- Made the "Live Run" / "Latest Run" heading a `Link` to the run detail
page and appended the short run code (`run.id.slice(0, 8)`) in a mono
span, formatted `Live Run · <run code>`. Kept the pulsing live dot.
- Removed the redundant "View details →" link.
- Changed the running row `Link` target to the task detail page
(`/issues/:identifier`) when a task resolves, falling back to the run
detail page otherwise.
- Resolved the task from the run context snapshot
(`contextSnapshot.issueId`, falling back to `contextSnapshot.taskId`)
against a `Map` of the agent's assigned issues threaded in from
`AgentOverview`.
- When a task resolves, replaced the run code and source chip in the row
with the task status glyph (`StatusGlyph`), the task slug, and the task
title. Kept the running spinner, the run status badge, and the
timestamp.

## Verification

- `pnpm check:token-gates` → 3/3 gates clean.
- `pnpm --filter ui typecheck` → passes.
- `pnpm --filter ui exec vitest run
src/pages/AgentDetail.progress.test.ts
src/pages/AgentDetail.instructions.test.tsx` → 10/10 pass.
- Manual (needs a reviewer with a browser): open an agent detail page →
Dashboard tab.
- For a live issue-execution run: the heading reads `Live Run · <run
code>` and opens the run detail page; the row shows the task status
icon, slug, and title and opens the task detail page.
- For a pure timer heartbeat with no task: the row falls back to run
code + source chip and opens the run detail page. No blank row.
  - Confirm both states in light and dark mode.

## Risks

Low risk. The change is presentational and scoped to one component. The
task lookup is defensive: it reads the context snapshot with a fallback
key and only renders the task row when the issue is present in the
already-loaded assigned-issue set, so an unknown or missing issue
degrades to the previous run-detail behavior rather than breaking.

## Model Used

- Provider: Anthropic (Claude).
- Model: claude-opus-4-8 (Opus 4.8).
- Context window: 200K.
- Reasoning mode: extended thinking, tool use.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] 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>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
canary/v2026.807.0-canary.6
2026-08-06 23:18:32 -07:00
Nicky LeachandPaperclip 4e76227f12 feat(plugin-daytona): stream session command logs behind useLogStream (#11021)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Sandbox provider plugins let agents run commands in remote
environments.
> - The Daytona provider polls the exit code while it waits for command
logs.
> - Polling delays log delivery and does not support long-lived streamed
commands.
> - This pull request adds an opt-in Daytona log stream with one
reconnect and a poll fallback.
> - The benefit is faster log delivery while the existing default path
stays unchanged.

## Linked Issues or Issue Description

Refs: #10941

**Subsystem affected**

packages/plugins — sandbox provider plugins.

**Problem or motivation**

The Daytona provider polls the command exit code every 50 milliseconds
while it waits for logs. This delays output and does not support a
long-lived streamed command.

**Proposed solution**

Add the `useLogStream` provider option. Stream stdout and stderr from
the Daytona callback log form, read the exit code after the stream ends,
retry the read with bounded backoff, and fall back to the existing poll
path after a disconnect.

**Alternatives considered**

Keep polling for all commands. This keeps the current behavior but does
not provide timely logs or a path for long-lived commands.

**Roadmap alignment**

This supports the roadmap item for cloud and sandbox agents, including
Daytona.

## What Changed

- Add the opt-in `useLogStream` option with a default of `false`.
- Stream stdout and stderr from the Daytona callback log form.
- Drop replayed log prefixes by delivered byte offset after reconnect.
- Retry once after disconnect, then use the existing poll path.
- Read the exit code once after a successful stream and retry when the
code is not ready.
- Add tests for ordered output, exit-code reads, disconnect fallback,
and reconnect replay handling.

## Verification

- Run `node_modules/.bin/vitest run --config
packages/plugins/sandbox-providers/daytona/vitest.config.ts
packages/plugins/sandbox-providers/daytona/src/plugin.test.ts`.
- Confirm that the full Daytona plugin test project passes with 127
tests.
- Confirm that the changed files type-check against Daytona SDK 0.203.0
types.
- Review the PR against parent PR #10941 before it reaches `master`.

## Risks

- The stream path changes behavior only when `useLogStream` is `true`.
- A stream failure can add one reconnect attempt before the existing
poll fallback.
- The stream path has no command deadline because it supports long-lived
commands.
- No endpoint, stored data, telemetry shape, authentication rule, or
result shape changes.

## Model Used

OpenAI Codex, GPT-5, tool use and code execution. The context window and
reasoning mode are not exposed by this run.

## 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>
canary/v2026.807.0-canary.5
2026-08-06 22:56:21 -07:00