Skip to content

Commit 3bc47c5

Browse files
galkleinmanclaude
andcommitted
fix: update test name to accurately reflect behavior
Changed test name from "should use default 'run.ai' span name" to "should preserve original AI SDK span name" to accurately reflect that we now preserve the original AI SDK span names (ai.generateText, etc.) when no agent metadata is provided, rather than transforming to "run.ai" Created new test recording to match updated test name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ec097de commit 3bc47c5

File tree

2 files changed

+13
-13
lines changed
  • packages/traceloop-sdk

2 files changed

+13
-13
lines changed

packages/traceloop-sdk/recordings/Test-AI-SDK-Agent-Integration-with-Recording_2039949225/should-use-default-run-ai-span-name-when-no-agent-metadata-is-provided_1300307112/recording.har renamed to packages/traceloop-sdk/recordings/Test-AI-SDK-Agent-Integration-with-Recording_2039949225/should-preserve-original-AI-SDK-span-name-when-no-agent-metadata-is-provided_1735519430/recording.har

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"log": {
3-
"_recordingName": "Test AI SDK Agent Integration with Recording/should use default 'run.ai' span name when no agent metadata is provided",
3+
"_recordingName": "Test AI SDK Agent Integration with Recording/should preserve original AI SDK span name when no agent metadata is provided",
44
"creator": {
55
"comment": "persister:fs",
66
"name": "Polly.JS",
@@ -36,7 +36,7 @@
3636
"content": {
3737
"mimeType": "application/json",
3838
"size": 2246,
39-
"text": "{\n \"id\": \"resp_09a32c8fb2b9078a00692c6917b6a08194843f095e9729f08b\",\n \"object\": \"response\",\n \"created_at\": 1764518167,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"fc_09a32c8fb2b9078a00692c691872d4819485b977dcc6ca8809\",\n \"type\": \"function_call\",\n \"status\": \"completed\",\n \"arguments\": \"{\\\"operation\\\":\\\"add\\\",\\\"a\\\":10,\\\"b\\\":5}\",\n \"call_id\": \"call_nCxNZlDZ4CNu6U1Wrb6QWExI\",\n \"name\": \"calculate\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"prompt_cache_retention\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"description\": \"Perform basic mathematical calculations\",\n \"name\": \"calculate\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"operation\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\",\n \"subtract\",\n \"multiply\",\n \"divide\"\n ],\n \"description\": \"The mathematical operation to perform\"\n },\n \"a\": {\n \"type\": \"number\",\n \"description\": \"First number\"\n },\n \"b\": {\n \"type\": \"number\",\n \"description\": \"Second number\"\n }\n },\n \"required\": [\n \"operation\",\n \"a\",\n \"b\"\n ],\n \"additionalProperties\": false\n },\n \"strict\": false\n }\n ],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 79,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 22,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 101\n },\n \"user\": null,\n \"metadata\": {}\n}"
39+
"text": "{\n \"id\": \"resp_0344a918ad130e3500692c6b9b6c6c81948d2136ba18a4b7da\",\n \"object\": \"response\",\n \"created_at\": 1764518811,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"fc_0344a918ad130e3500692c6b9c484c81949e4d78cd2cd5e3f1\",\n \"type\": \"function_call\",\n \"status\": \"completed\",\n \"arguments\": \"{\\\"operation\\\":\\\"add\\\",\\\"a\\\":10,\\\"b\\\":5}\",\n \"call_id\": \"call_bUdyZcVeNChXGxWMEhK4d1yC\",\n \"name\": \"calculate\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"prompt_cache_retention\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"description\": \"Perform basic mathematical calculations\",\n \"name\": \"calculate\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"operation\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\",\n \"subtract\",\n \"multiply\",\n \"divide\"\n ],\n \"description\": \"The mathematical operation to perform\"\n },\n \"a\": {\n \"type\": \"number\",\n \"description\": \"First number\"\n },\n \"b\": {\n \"type\": \"number\",\n \"description\": \"Second number\"\n }\n },\n \"required\": [\n \"operation\",\n \"a\",\n \"b\"\n ],\n \"additionalProperties\": false\n },\n \"strict\": false\n }\n ],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 79,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 22,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 101\n },\n \"user\": null,\n \"metadata\": {}\n}"
4040
},
4141
"cookies": [
4242
{
@@ -46,7 +46,7 @@
4646
"path": "/",
4747
"sameSite": "None",
4848
"secure": true,
49-
"value": "Ik4fQXWCEGLanoaMfEsjj7p0oS0y5cCFoiIlbaXW7xs-1764518169971-0.0.1.1-604800000"
49+
"value": "qhF6jlfO3kBMCCEAUYYudNtdTel7T9a5wnIXPIIsHQ0-1764518813656-0.0.1.1-604800000"
5050
}
5151
],
5252
"headers": [
@@ -60,7 +60,7 @@
6060
},
6161
{
6262
"name": "cf-ray",
63-
"value": "9a6b8872cab80bed-TLV"
63+
"value": "9a6b982abaa5935b-TLV"
6464
},
6565
{
6666
"name": "connection",
@@ -76,15 +76,15 @@
7676
},
7777
{
7878
"name": "date",
79-
"value": "Sun, 30 Nov 2025 15:56:09 GMT"
79+
"value": "Sun, 30 Nov 2025 16:06:53 GMT"
8080
},
8181
{
8282
"name": "openai-organization",
8383
"value": "traceloop"
8484
},
8585
{
8686
"name": "openai-processing-ms",
87-
"value": "2301"
87+
"value": "2161"
8888
},
8989
{
9090
"name": "openai-project",
@@ -100,7 +100,7 @@
100100
},
101101
{
102102
"name": "set-cookie",
103-
"value": "_cfuvid=Ik4fQXWCEGLanoaMfEsjj7p0oS0y5cCFoiIlbaXW7xs-1764518169971-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
103+
"value": "_cfuvid=qhF6jlfO3kBMCCEAUYYudNtdTel7T9a5wnIXPIIsHQ0-1764518813656-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
104104
},
105105
{
106106
"name": "strict-transport-security",
@@ -116,7 +116,7 @@
116116
},
117117
{
118118
"name": "x-envoy-upstream-service-time",
119-
"value": "2307"
119+
"value": "2163"
120120
},
121121
{
122122
"name": "x-ratelimit-limit-requests",
@@ -144,7 +144,7 @@
144144
},
145145
{
146146
"name": "x-request-id",
147-
"value": "req_daf0381385814905bcc24f1392bba285"
147+
"value": "req_96d279fdabd64f3abe3f1805c8183b32"
148148
}
149149
],
150150
"headersSize": 958,
@@ -153,16 +153,16 @@
153153
"status": 200,
154154
"statusText": "OK"
155155
},
156-
"startedDateTime": "2025-11-30T15:56:07.341Z",
157-
"time": 2500,
156+
"startedDateTime": "2025-11-30T16:06:51.063Z",
157+
"time": 2435,
158158
"timings": {
159159
"blocked": -1,
160160
"connect": -1,
161161
"dns": -1,
162162
"receive": 0,
163163
"send": 0,
164164
"ssl": -1,
165-
"wait": 2500
165+
"wait": 2435
166166
}
167167
}
168168
],

packages/traceloop-sdk/test/ai-sdk-agent-integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ describe("Test AI SDK Agent Integration with Recording", function () {
236236
}
237237
});
238238

239-
it("should use default 'run.ai' span name when no agent metadata is provided", async () => {
239+
it("should preserve original AI SDK span name when no agent metadata is provided", async () => {
240240
// Define a simple calculator tool
241241
const calculate = tool({
242242
description: "Perform basic mathematical calculations",

0 commit comments

Comments
 (0)