Skip to content

Commit 9cdc5b9

Browse files
RulaKhaledclaude
andcommitted
test(cloudflare): Assert the Think agent span keeps the user's class name
Depends on #24700, which stops the Vite transform from renaming the wrapped class. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 3a11aac commit 9cdc5b9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • dev-packages/e2e-tests/test-applications/cloudflare-think/tests

‎dev-packages/e2e-tests/test-applications/cloudflare-think/tests/think.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ test('captures the invoke_agent / generate_content / execute_tool hierarchy for
3838

3939
expect(attr(invokeAgent, 'sentry.origin')).toBe('auto.vercelai.channel');
4040
expect(attr(invokeAgent, 'gen_ai.operation.name')).toBe('invoke_agent');
41+
// Think passes `this.constructor.name` to the AI SDK as the `functionId`, so this only holds while
42+
// the build-time wrapper leaves the user's class name alone (#24700).
43+
expect(invokeAgent?.name).toBe('invoke_agent ThinkAgent');
44+
expect(attr(invokeAgent, 'gen_ai.function_id')).toBe('ThinkAgent');
4145
expect(attr(invokeAgent, 'gen_ai.provider.name')).toBe('openrouter');
4246
expect(typeof attr(invokeAgent, 'gen_ai.usage.input_tokens')).toBe('number');
4347
expect(typeof attr(invokeAgent, 'gen_ai.usage.output_tokens')).toBe('number');

0 commit comments

Comments
 (0)