mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-06 21:05:21 +02:00
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - Native run reconciliation repairs saved execution outcomes after
interruptions.
> - The sweep also visits runs whose final results are already
committed.
> - An unchanged failed run still received a new status delivery ID on
every sweep.
> - The browser treated each delivery as a new failure after its short
duplicate window expired.
> - This pull request makes unchanged projections a no-op and suppresses
repeated or historical run toasts.
> - Operators receive fresh failure alerts without repeated alerts for
old work.
## Linked Issues or Issue Description
**What happened?**
An old failed run repeatedly produced failure toasts while the browser
remained open. The task could already be cancelled. Reconciliation
rewrote the same failed outcome and queued another status broadcast.
**Expected behavior**
An unchanged committed run must not queue a new status notification.
Repeated deliveries must still refresh cached state without another
toast.
**Steps to reproduce**
1. Finalize a native run with a failed result and successful workspace
finalization.
2. Deliver its pending execution status and cancel its task.
3. Replay finalization and status delivery on each periodic sweep.
4. Observe another failure broadcast for every sweep before this fix.
**Paperclip version or commit**
Reproduced against source commit c65fc9e3c. The new regression produced
three extra broadcasts in three sweeps before the fix.
**Deployment mode**
Authenticated hosted deployment. The database regression also reproduces
with isolated embedded PostgreSQL.
Related context: #13104 established contextual run notifications. This
change fixes duplicate delivery after finalization. No matching open fix
was found.
## What Changed
- Add a database predicate that skips unchanged committed run
projections. Preserve real status repairs, pending delivery IDs, and
ownership checks.
- Track observed company/run/status outcomes in the live update
provider. Keep this bounded history across socket reconnects.
- Suppress terminal toasts delivered more than five minutes after
completion, using server timestamps.
- Add regressions for cancelled tasks, concurrent replay, incomplete
projection repair, repeated broadcasts, historical failures, and
reopening a window.
- Document the notification behavior in DESIGN.md.
## Verification
- 103 focused server and UI tests passed before rebase. The new server
regression failed on the original implementation and passed with the
fix.
- Server and UI TypeScript checks passed before rebase.
- UI production build and `pnpm check:token-gates` passed before rebase.
- Full workspace `pnpm -r typecheck` passed locally after rebase. Full
tests, typecheck, and build passed in CI on the exact PR head; the
redundant local full-suite run was stopped after CI completed.
- All current-head CI checks passed, including all eight browser shards.
Browser shard 4 passed on one unchanged-code rerun after an initial
chat-page navigation timeout (blank screenshot, slow loads, no
JavaScript crash).
- Greptile reviewed the current head at 5/5 with no actionable findings
or open review threads.
## Risks
- The UI intentionally omits transient toasts for outcomes delivered
more than five minutes after completion. Run history and cache updates
remain available.
- The observed-outcome cache holds at most 2,000 identities. Historical
timestamps also protect fresh page loads.
- No schema changes. Recovery still repairs missing completion metadata
and stale successful-run errors. Existing ownership gates remain
enforced.
## Model Used
OpenAI GPT-6 through Codex, with code editing, shell tools, browser
inspection, and test execution. The exact deployment identifier 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
- [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>
@paperclipai/ui
Published static assets for the Paperclip board UI.
What gets published
The npm package contains the production build under dist/. It does not ship the UI source tree or workspace-only dependencies.
Storybook
Storybook config, stories, and fixtures live under ui/storybook/.
pnpm --filter @paperclipai/ui storybook
pnpm --filter @paperclipai/ui build-storybook
Typical use
Install the package, then serve or copy the built files from node_modules/@paperclipai/ui/dist.