Skip to content

fix(adk): langgraph graph nodes look up tools by the wrong names and always fail - #41

Open
yakimoto wants to merge 2 commits into
mainfrom
fix/langgraph-tool-names
Open

yakimoto wants to merge 2 commits into
mainfrom
fix/langgraph-tool-names

Conversation

@yakimoto

@yakimoto yakimoto commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

User description

createStreamMonitorNode and createClipNode look up their tool by name — with the wrong names.

const monitorTool = tools.find((t) => t.name === 'monitor_stream');   // real name: wave_monitor_stream
const clipTool    = tools.find((t) => t.name === 'create_clip');      // real name: wave_create_clip

AgentToolkit.getTools() prefixes every tool with wave_, so neither lookup can succeed. Both nodes fall into their if (!tool) branch on every invocation, return an error object, and never make a network call. Anyone wiring createStreamMonitorNode into a LangGraph StateGraph gets a node that silently does nothing.

This is live on npm

Not theoretical — it's in the published artifact today:

$ curl -sL <@wave-av/adk@1.0.14 tarball> | tar xz
$ grep -o "monitor_stream tool not found\|create_clip tool not found" package/dist/index.cjs | sort -u
create_clip tool not found
monitor_stream tool not found

Regression tests, proven non-vacuous

The existing adapters.test.ts only asserts the shape of createLangGraphTools — nothing invoked the two graph-node factories, which is exactly why this shipped. The new tests assert the absence of the tool not found error.

I verified they actually catch it rather than passing for free:

# old names reintroduced
 × createStreamMonitorNode finds wave_monitor_stream
 × createClipNode finds wave_create_clip
 Tests  2 failed | 8 passed (10)

# fix restored
 Tests  10 passed (10)

Verification

tsc --noEmit                # clean (the one pre-existing @wave-av/kernel resolution error
                            #  goes away once the workspace sibling is built)
vitest run                  # 27 passed | 2 skipped, 0 failed
vitest run adapters.test.ts # 10 passed

The sibling LiveKit adapter already used the correct wave_monitor_stream, which is why this stayed isolated to the LangGraph adapter.

Related — please read, it's bigger than this PR

While tracing this I found that @wave-av/adk exists in three places and this repo is the one that actually publishes:

Location Version Publishes?
wave-av/sdkssdk-typescript/packages/adk 1.0.14 yes — publish-npm.yml, matches the npm artifact
wave-av/wave-surfer-connectpackages/adk 1.0.14 the pre-carve origin
wave-av/adk (standalone repo) 1.0.2 has a publish.yml, but is 12 versions behind

The standalone wave-av/adk repo is a stale fork: single-entry build, no ERROR-CODES.md, and its .wave/repo.json describes a package that is not the one on npm — it declares the 6 subpath exports as planned/"not built", when this repo builds and ships all six. I opened wave-av/adk#59 against that fork before realising it doesn't publish; this PR is the one that fixes what users install. Filing the fork problem separately.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
Narrow string lookup fix in the LangGraph adapter with regression tests; no auth or data-model changes.

Overview
Fixes a live bug where createStreamMonitorNode and createClipNode looked up monitor_stream and create_clip while AgentToolkit registers wave_monitor_stream and wave_create_clip. Every invocation hit the “tool not found” branch and never called the handlers.

The adapter now uses the correct wave_ names and updates the error strings to match. Regression tests invoke both node factories and assert error is absent (and expected state fields are present), so a wrong lookup cannot ship again via shape-only coverage.

Reviewed by Cursor Bugbot for commit 605abb4. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Fixes a live bug in @wave-av/adk where LangGraph nodes never resolved their tools and returned a "tool not found" error on every invocation without making a network call. Nodes now find the correct wave_-prefixed tools and execute as expected.

  • Bug Fixes
    • createStreamMonitorNode now looks up wave_monitor_stream (was monitor_stream), and createClipNode now looks up wave_create_clip (was create_clip).
    • Added regression tests that assert the "tool not found" error never appears; verified they fail if the old names are reintroduced.

Written for commit 605abb4. Summary will update on new commits.

Review in cubic


CodeAnt-AI Description

Fix LangGraph stream monitoring and clip creation

What Changed

  • Stream monitoring nodes now find the available monitoring tool and return stream health instead of always reporting that the tool is missing
  • Clip creation nodes now find the available clip tool and return the created clip instead of always failing
  • Added regression tests covering successful tool resolution and node results

Impact

✅ Working stream monitoring in LangGraph
✅ Working clip creation in LangGraph
✅ Fewer false “tool not found” errors

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…always fail

createStreamMonitorNode and createClipNode searched for "monitor_stream" and "create_clip", but AgentToolkit names every tool with a wave_ prefix. Neither lookup could succeed, so both nodes returned { error: "<name> tool not found" } on every invocation and never made a network call.

This is live in the published package: grepping @wave-av/adk@1.0.14 from the npm registry finds both "monitor_stream tool not found" and "create_clip tool not found" in dist/index.cjs.

Adds regression tests that assert the ABSENCE of that error. Verified they are not vacuous: reintroducing the old names fails both (2 failed | 8 passed), restoring the fix passes 10/10. A shape-only test misses this entirely, which is how it shipped.

The sibling livekit adapter already used the correct wave_monitor_stream, which is why this stayed isolated to langgraph.
@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 76fc70e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_1da30505-9aac-4965-8361-7a759d2dafea)

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 19 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 95 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: f3732785-197a-4e54-b1ee-5b28e916b207

📥 Commits

Reviewing files that changed from the base of the PR and between 8838c2e and 605abb4.

📒 Files selected for processing (2)
  • sdk-typescript/packages/adk/src/__tests__/adapters.test.ts
  • sdk-typescript/packages/adk/src/adapters/langgraph.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/langgraph-tool-names
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/langgraph-tool-names

Comment @coderabbitai help to get the list of available commands.

@codeant-ai

codeant-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 605abb4 Sep 08, 2026 · 18:21 18:23

@codeant-ai

codeant-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@cursor

cursor Bot commented Sep 8, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_bee11400-62b6-4d54-975e-0b8a3bdd9f65)

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Sep 8, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 8, 2026

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This is a narrow regression fix that aligns LangGraph node lookups with the toolkit’s actual names and adds focused coverage. Both changed files are explicitly owned by the SDK owners, while the author owns neither, so designated-owner review is warranted.

Not approved because:

  • Credit balance exhausted. Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

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
👍 | 👎

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

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant