Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions sdk-typescript/packages/adk/src/__tests__/adapters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,35 @@ describe('Kernel adapter', () => {
expect(playwrightTool?.parameters.code?.required).toBe(true);
});
});

describe('LangGraph graph nodes resolve their tools', () => {
// Regression: both factories looked up 'monitor_stream' / 'create_clip', but AgentToolkit names
// every tool with a wave_ prefix. The lookups could never succeed, so each node returned
// { error: '<name> tool not found' } on every invocation and never made a network call. Asserting
// the ABSENCE of that error is the point — a shape-only test misses it entirely, which is how it
// shipped in @wave-av/adk@1.0.14.
it('createStreamMonitorNode finds wave_monitor_stream', async () => {
const { createStreamMonitorNode } = await import('../adapters/langgraph');
const node = createStreamMonitorNode({
apiKey: 'test-key',
streamId: '00000000-0000-4000-8000-000000000000',
});

const result = await node({});
expect(result.error).toBeUndefined();
expect(result.streamId).toBe('00000000-0000-4000-8000-000000000000');
});

it('createClipNode finds wave_create_clip', async () => {
const { createClipNode } = await import('../adapters/langgraph');
const node = createClipNode({ apiKey: 'test-key' });

const result = await node({
streamId: '00000000-0000-4000-8000-000000000000',
clipStart: 0,
clipEnd: 10,
});
expect(result.error).toBeUndefined();
expect(result).toHaveProperty('clip');
});
});
8 changes: 4 additions & 4 deletions sdk-typescript/packages/adk/src/adapters/langgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ export function createStreamMonitorNode(config: {

return async (state: Record<string, unknown>): Promise<Record<string, unknown>> => {
const tools = toolkit.getTools();
const monitorTool = tools.find((t) => t.name === 'monitor_stream');
const monitorTool = tools.find((t) => t.name === 'wave_monitor_stream');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The corrected lookup now invokes validation, so the documented stream_abc example throws a Zod error instead of returning a node result. [api mismatch]

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** sdk-typescript/packages/adk/src/adapters/langgraph.ts
**Line:** 76:76
**Comment:**
	*Api Mismatch: The corrected lookup now invokes validation, so the documented `stream_abc` example throws a Zod error instead of returning a node result.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎


if (!monitorTool) {
return { ...state, error: 'monitor_stream tool not found' };
return { ...state, error: 'wave_monitor_stream tool not found' };
}

const health = await monitorTool.handler({ streamId: config.streamId });
Expand All @@ -102,10 +102,10 @@ export function createClipNode(config: {

return async (state: Record<string, unknown>): Promise<Record<string, unknown>> => {
const tools = toolkit.getTools();
const clipTool = tools.find((t) => t.name === 'create_clip');
const clipTool = tools.find((t) => t.name === 'wave_create_clip');

if (!clipTool) {
return { ...state, error: 'create_clip tool not found' };
return { ...state, error: 'wave_create_clip tool not found' };
}

const clip = await clipTool.handler({
Expand Down
Loading