Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2fbe908 to
c74cfe6
Compare
7fb178a to
49d10be
Compare
The Cloudflare test plugin still used an older Miniflare/workerd than Wrangler, so updating the direct dependency alone left different runtimes in local and integration tests. Switch to `@cloudflare/vitest-plugin` 1.4.6 and align Miniflare/workerd with Wrangler. Miniflare 5 removed `fetchMock`; an Undici outbound service preserves the existing fixtures and `disableNetConnect()` policy. This is the prerequisite for #1670 (HTTP Code Mode), followed by #1675 (agent evals). Only seven test/dependency files move here; the broker, permissions and production integration remain in #1670. Validated independently on Node 24: **443 Cloudflare tests across 34 files**, root typechecks, lint and frozen install. The earlier full workspace run had unrelated CLI fixture/platform failures; CLI fixes are excluded. No deployment performed.
c74cfe6 to
9be4926
Compare
Bound broker access and HTTP work to one execution so unawaited calls and late authorization cannot start writes after the result. Cover cleanup and the real deadline with Worker integration tests.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 645c16d. Configure here.
| ]); | ||
| this.assertOpen(); | ||
| return result; | ||
| } |
There was a problem hiding this comment.
Execution gate leaves unhandled rejections
Medium Severity
ExecutionGate.run() races work against a derived promise that throws when the gate later closes. After a successful run, close() still resolves that waiter, so the losing then rejects with no handler. Each API call adds another waiter, so a finished execution can emit many unhandled rejections during cleanup.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 645c16d. Configure here.
There was a problem hiding this comment.
Verified against the current head (645c16d2): this is a false positive.
Promise.race() attaches fulfillment and rejection handlers to every input, including the promise returned by #whenClosed.then(...). Those handlers remain attached after another input wins. When close() subsequently resolves #whenClosed, the derived rejection is therefore handled; rejecting the already-settled race is a no-op. The internal rejection handler returns undefined, so its own derived promise fulfills as well. This follows ECMAScript's PerformPromiseRace algorithm. Both production callers also await ExecutionGate.run() inside try/catch.
Validated using the actual execution.ts source, with TypeScript types stripped and no behavioral changes:
- Seven scenarios in both Node 24 and local workerd: success then close, 20 sequential successes, 20 concurrent successes, work rejection, close followed by a late work rejection, synchronous throw, and execution after closure.
- Additional workerd checks: 20 nested concurrent calls followed by closure, and the actual 30-second deadline followed by a late work rejection. The deadline fired after 30,003 ms and the abort signal was set.
- Zero unhandled rejections in these scenarios. A deliberately unhandled rejection was detected as a positive control in both runtimes.
No code change is needed for this finding.


Code Mode is the MCP equivalent of
sentry api: agents can use published API operations without a dedicated MCP tool.The client's agent writes JavaScript; our Cloudflare sandbox executes authenticated HTTP calls and returns the result.
For example: “Copy this dashboard for two projects, preserving its widgets and filters.” The existing tool catalog cannot do this; Code Mode can.
search_sentry_apidiscovers the schema andexecute_sentry_coderuns the program. This version is HTTP-only; the SDK remains future work.Prerequisite #1676 is merged. Stack: this PR → #1675 (agent evals). Runtime and permission safety tests remain here.
Permissions
The Sentry token authenticates API calls; its OAuth scopes and the user's Sentry permissions set the maximum access.
The permission screen controls which of those actions this MCP connection may perform, without changing the token or its scopes.
/mcpcovers organizations authorized by the Sentry token;/mcp/{org}is restricted to that organization. Project-scoped connections do not expose Code Mode.Validation and before production
Executions now close pending RPC, abort in-flight HTTP and block requests whose authorization finishes after execution ends. Programs must await API calls before returning; accepted writes cannot be rolled back. See the lifecycle validation.
Passed locally: 474 hosted Cloudflare tests + 27 isolated runtime/access tests, 1,836 core tests (six skipped), 89 stdio tests, build/typechecks, lint and documentation links. Coverage includes a real 30-second timeout that closes the upstream connection while preserving an accepted write.
Pending before production: real hosted OAuth-to-API authorization and Cloudflare CPU/termination/concurrency enforcement. Local workerd tests do not establish these platform guarantees. No production deployment performed. GitHub CI now passes the complete workspace suite, including CLI, plus smoke tests, repository quality and security checks on
645c16d2. Warden code review, MCP audit and security review also pass, with no new findings. No CLI fixes were included.