GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — test(cloudflare): Add Flue E2E test that deploys a real Worker and sends to Sentry by JPeer264 · Pull Request #24816 · getsentry/sentry-javascript Conversation
|
size-limit report 📦
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
c1a82e2 to
360c698
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
looks good. one thing: the PR description is stale, the last paragraph says the attribute checks, the manual-span nesting and the dataloader check go away pending fetchSpanAttributes from #24514. that helper is on develop already and all three are asserted in the tests here, so worth updating before the squash
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| { | ||
| "$schema": "./node_modules/wrangler/config-schema.json", | ||
| // Placeholder only: every test run deploys under a unique name, see global-setup.ts. | ||
| "name": "cloudflare-flue", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
l: rename the placeholder to match the directory
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
done in dcb678c (this PR)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
360c698 to
2fff275
Compare
…nds to Sentry cloudflare-flue-send-to-sentry deploys a Flue agent as a real Worker, runs real model turns, and polls the E2E project through the sentry CLI. It is optional, like the other apps that need the Cloudflare secrets. It replaces cloudflare-flue, which ran the same agent locally behind the event proxy. Flue runs the turn from a Durable Object alarm, and the SDK starts a new trace for each alarm, so the test cannot send the trace id with the request. It reads the conversation id from Flue and finds the trace by `gen_ai.conversation.id` through the events API (`findTraceIdOfSpan`), because `sentry span list` returns no trace id for a project search. `sentry api` caches GET responses and has no `--fresh` flag, so the CLI now runs with `SENTRY_NO_CACHE=1`. Without it, every poll got the first empty answer again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and sends to Sentry Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and sends to Sentry Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and sends to Sentry Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and sends to Sentry Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and sends to Sentry Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and sends to Sentry Co-Authored-By: Claude Opus 5.5 <[email protected]>
d6498f5 to
dcb678c
Compare
| run: ({ data }) => | ||
| Sentry.startSpan({ name: 'resolve-weather', attributes: { 'weather.source': 'static-table' } }, () => { | ||
| return `It is 21 degrees and sunny in ${city}.`; | ||
| return `It is 21 degrees and sunny in ${data.city}.`; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Bug: The run callback for the get_weather tool incorrectly destructures its input as ({ data }) instead of ({ city }), which will cause a TypeError at runtime.
Severity: HIGH
Change the parameter destructuring in the run callback from ({ data }) => ... data.city to ({ city }) => ... city. This aligns the function signature with the tool's input definition and prevents the runtime error.
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
dev-packages/e2e-tests/test-applications/cloudflare-flue-send-to-sentry/src/agents/hello.ts#L20-L22
Potential issue: The `run` callback for the `get_weather` tool in `hello.ts`
destructures its input as `({ data })` and then accesses `data.city`. However, the
tool's input schema is defined as `v.object({ city: v.string() })`, and the runtime
passes the arguments directly, not nested within a `data` object. This mismatch will
cause the `data` parameter to be `undefined`, leading to a `TypeError` when `data.city`
is accessed. This will cause the E2E tests, which explicitly invoke this tool, to fail.
Did we get this right? 👍 / 👎 to inform future reviews.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
An e2e app that uses the Flue integration the way a user does and sends the data to a real Sentry project, per #24753. Cloudflare already has one (`cloudflare-flue-send-to-sentry`, #24816), so this covers Node. **Stacked on #25549.** Without that fix every turn after the first lands in the first request's trace, which these tests catch. This PR targets its branch and retargets to `develop` once it merges. **The app.** A built Flue server, with `Sentry.init` imported first and `@sentry/node/import` preloaded, runs real tool-calling turns through OpenRouter. The router answers `202` before a turn runs, so the tests find each trace by the `gen_ai.conversation.id` Flue reports back, as the Cloudflare app does. `@flue/runtime` is pinned to 2.0.5 like `node-flue`, with a `(latest)` variant. `hello.ts` is a `'use agent'` module, so `@flue/vite` binds its identity at build time, which the integration suite cannot reproduce. **`node-flue`** now checks that each turn sits under the request that sent it. Its weather tool also reads `({ data })`, the way Flue 2 passes tool input, so it stops answering "sunny in undefined". Closes #24753 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.