Skip to content

Commit 659fb0e

Browse files
bettercleverclaude
andcommitted
fix(e2e): use correct AI SDK property names in debug logging
Tool calls use `input` (not `args`) and tool results use `output` for the dynamic MCP tool types in AI SDK v6. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
1 parent 37d3e23 commit 659fb0e

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

e2e-tests/studio-mcp/studio-mcp-agent.test.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,29 @@ e2eDescribe('Studio MCP: AI SDK Integration', () => {
173173
],
174174
});
175175

176+
// DEBUG: show agent behavior
177+
console.log('\n=== TEST 2: list_components agent ===');
178+
console.log(`Steps: ${response.steps.length}`);
179+
for (const [i, step] of response.steps.entries()) {
180+
console.log(`\n--- Step ${i + 1} ---`);
181+
if (step.toolCalls?.length) {
182+
for (const tc of step.toolCalls) {
183+
console.log(` Tool call: ${tc.toolName}(${JSON.stringify((tc as Record<string, unknown>).input ?? {})})`);
184+
}
185+
}
186+
if (step.toolResults?.length) {
187+
for (const tr of step.toolResults) {
188+
const raw = JSON.stringify((tr as Record<string, unknown>).output ?? tr) ?? '';
189+
console.log(` Tool result: ${raw.slice(0, 500)}`);
190+
}
191+
}
192+
if (step.text) {
193+
console.log(` Text: ${step.text.slice(0, 500)}`);
194+
}
195+
}
196+
console.log(`\nFinal response: ${response.text.slice(0, 1000)}`);
197+
console.log('=== END TEST 2 ===\n');
198+
176199
expect(response.steps).toBeDefined();
177200
expect(response.steps.length).toBeGreaterThan(0);
178201

@@ -263,6 +286,29 @@ e2eDescribe('Studio MCP: AI SDK Integration', () => {
263286
],
264287
});
265288

289+
// DEBUG: show agent behavior
290+
console.log('\n=== TEST 3: workflow operations agent ===');
291+
console.log(`Steps: ${response.steps.length}`);
292+
for (const [i, step] of response.steps.entries()) {
293+
console.log(`\n--- Step ${i + 1} ---`);
294+
if (step.toolCalls?.length) {
295+
for (const tc of step.toolCalls) {
296+
console.log(` Tool call: ${tc.toolName}(${JSON.stringify((tc as Record<string, unknown>).input ?? {})})`);
297+
}
298+
}
299+
if (step.toolResults?.length) {
300+
for (const tr of step.toolResults) {
301+
const raw = JSON.stringify((tr as Record<string, unknown>).output ?? tr) ?? '';
302+
console.log(` Tool result: ${raw.slice(0, 500)}`);
303+
}
304+
}
305+
if (step.text) {
306+
console.log(` Text: ${step.text.slice(0, 500)}`);
307+
}
308+
}
309+
console.log(`\nFinal response: ${response.text.slice(0, 1000)}`);
310+
console.log('=== END TEST 3 ===\n');
311+
266312
expect(response.steps).toBeDefined();
267313
expect(response.steps.length).toBeGreaterThan(0);
268314

0 commit comments

Comments
 (0)