Skip to content

test(cloudflare): Add Workers AI tracing tests for Clef - #25027

Open
JPeer264 wants to merge 2 commits into
developfrom
jp/cloudflare-workers-ai-clef-test
Open

JPeer264 wants to merge 2 commits into
developfrom
jp/cloudflare-workers-ai-clef-test

Conversation

@JPeer264

@JPeer264 JPeer264 commented Oct 5, 2026

Copy link
Copy Markdown
Member

Cloudflare documents Clef (@cf/cloudflare/clef) as a drop-in for Jev with the same state + questions request shape, so it already goes through the evaluate path from #24833. Only Jev had tests, so this adds a Clef integration test and a real-Worker E2E test.

The integration mock returns the documented Clef response, which has no { state, result } wrapper (the Jev binding response has one). That makes it cover the unwrapped branch of the evaluate response handling, which the Jev test does not reach. The E2E test calls the real model, so it is the one that confirms what the binding actually returns. The docs do not give a model value for the response, so it only asserts that it contains clef.

Fixes #25011

🤖 Generated with Claude Code

Cloudflare documents Clef as compatible with the Jev API, but only Jev
calls had tracing tests. The integration test mock returns the documented
Clef response, which has no `{ state, result }` wrapper, so it also covers
that branch of the evaluate response handling. The E2E test calls the real
model to verify the response shape that the binding returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 marked this pull request as ready for review October 5, 2026 06:24
@JPeer264
JPeer264 requested a review from a team as a code owner October 5, 2026 06:24
@JPeer264
JPeer264 requested review from andreiborza and mydea and removed request for a team October 5, 2026 06:24
@JPeer264 JPeer264 self-assigned this Oct 5, 2026
status: 'ok',
is_segment: false,
attributes: {
'sentry.origin': { value: 'auto.ai.cloudflare.workers_ai', type: 'string' },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: sentry.origin / sentry.op / sentry.is_localhost should all be in conventions so we could use the consts from there directly

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 enabled auto-merge (squash) October 5, 2026 09:34

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Workers AI tracing test for Clef

2 participants