mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-23 13:13:46 +01:00
fix(observability): pin the Sentry browser SDK and gate the optional Sentry server peer on the exact version (#12270)
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - Paperclip uses separate server and browser packages for runtime
services and the board.
> - Sentry integrations need an exact SDK version and safe optional
loading.
> - A version range can select an SDK that the privacy tests did not
audit.
> - Missing peer metadata does not describe the optional server SDK
contract.
> - This pull request pins the browser SDK and gates the optional server
SDK on its exact version.
> - The benefit is a clear SDK contract with fail-open startup behavior.
## Linked Issues or Issue Description
**What happened?**
The browser package used the range ^10.71.0, so a lockfile refresh could
select a newer SDK. The server loaded @sentry/node dynamically but did
not declare its optional peer contract.
**Expected behavior**
The browser package must use the audited 10.71.0 version. The server
must load @sentry/node only when the installed peer matches 10.71.0. The
server must start when the optional peer is absent.
**Steps to reproduce**
1. Install the project dependencies.
2. Inspect the browser Sentry version and the server package metadata.
3. Start the server without installing @sentry/node.
4. Confirm that the server starts and that the dynamic Sentry bootstrap
does not load an unsupported peer version.
**Paperclip version or commit**
9c57c0f119
**Deployment mode**
Built from source with pnpm dev or pnpm build.
**Installation method**
Built from source.
**Agent adapter(s) involved**
Not adapter-specific (core change).
**Database mode**
Not database-related.
## What Changed
- Pin @sentry/browser to exactly 10.71.0 as a UI development dependency.
- Declare @sentry/node as an optional server peer dependency at 10.71.0.
- Gate the dynamic server bootstrap on the exact peer version.
- Add tests for the browser pin, peer metadata, version gate, and
fail-open loading.
- Document the supported server SDK version.
- Keep the lockfile unchanged because the pull request workflow
regenerates it for manifest changes.
## Verification
- Server tests pass with six expected skips when @sentry/node is absent.
- UI tests pass.
- The UI build emits the lazy Sentry browser chunk.
- git diff --check passes.
- GitHub pull request checks must pass after this pull request opens.
- Greptile must return a 5/5 score with no open findings.
## Risks
The exact version gate prevents Sentry startup when an unsupported SDK
version exists. The integration remains optional and fail-open. The
lockfile workflow must regenerate the lockfile before frozen downstream
jobs run. The label-gated Storybook visual job must not run until it can
restore the generated lockfile artifact.
## Model Used
OpenAI Codex, GPT-5, tool use and code review support, exact context
window details are managed by the execution platform.
## 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
- [x] My branch name describes the change 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>
This commit is contained in:
1 parent
4d82f5eaea
commit
1de105c475
11 files changed
+291
-124
No files matched your search
+14
-6
@@ -148,19 +148,27 @@ imports no Sentry package. The browser fetches no Sentry chunk.
|
||||
|
||||
#### 1. Install the Sentry peer dependency
|
||||
|
||||
Install `@sentry/node` in the server, the same way you install the
|
||||
The supported server SDK version is **`@sentry/node@10.71.0`** — the exact
|
||||
version this feature is audited against (see "Server request data"
|
||||
below). Install it in the server, the same way you install the
|
||||
OpenTelemetry packages above. `@sentry/node` is an *optional peer
|
||||
dependency*: it is not in the default lockfile, and the server loads it
|
||||
dynamically only when `SENTRY_DSN` is set.
|
||||
dynamically only when `SENTRY_DSN` is set. `server/package.json` declares
|
||||
this exact version; installing a different version defeats the audit, so
|
||||
the server checks the installed version against the declared one at
|
||||
startup and logs one diagnostic instead of enabling error monitoring on a
|
||||
mismatch (see "Server request data" below).
|
||||
|
||||
```bash
|
||||
pnpm add @sentry/node
|
||||
pnpm add @sentry/node@10.71.0
|
||||
```
|
||||
|
||||
The browser package, `@sentry/browser`, needs no install step. It is
|
||||
already a development dependency of the `ui` package, so the browser code
|
||||
ships inside every build. A signed-out browser, or a browser with no DSN,
|
||||
never fetches the Sentry chunk — see "DSN delivery to the browser" below.
|
||||
already a development dependency of the `ui` package, pinned to the same
|
||||
exact version, **`10.71.0`**, so the browser code ships inside every
|
||||
build at the audited version. A signed-out browser, or a browser with no
|
||||
DSN, never fetches the Sentry chunk — see "DSN delivery to the browser"
|
||||
below.
|
||||
|
||||
#### 2. Set the environment
|
||||
|
||||
|
||||
Reference in new issue
Block a user