Skip to content

fix(go-agent): normalize canvas tool names - #17768

Merged
yuzhichang merged 1 commit into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/agent-tool-codeexec
Aug 4, 2026
Merged

yuzhichang merged 1 commit into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/agent-tool-codeexec

Conversation

@Harry-Hz-Zhang

Copy link
Copy Markdown
Contributor

Summary

  • Normalize Canvas component names before resolving Go Agent tools and parameters.
  • Add regression coverage for CodeExec and other Canvas tool mappings.

Testing

  • CGO_ENABLED=0 go test -count=1 ./internal/agent/tool ./internal/agent/component

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Aug 4, 2026
@Harry-Hz-Zhang Harry-Hz-Zhang added ci Continue Integration agent labels Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 135f5253-9f94-4dc6-a7b1-cacc5bb8f9f8

📥 Commits

Reviewing files that changed from the base of the PR and between 79a57d2 and fd57cbf.

📒 Files selected for processing (3)
  • internal/agent/component/agent_test.go
  • internal/agent/tool/registry.go
  • internal/agent/tool/registry_test.go

📝 Walkthrough

Walkthrough

The tool registry now normalizes Canvas component names to canonical keys. Multi-tool construction uses canonical parameter keys first. Tests cover Canvas aliases, Google Scholar parameters, CodeExec Agent construction, and updated registry expectations.

Changes

Canvas tool resolution

Layer / File(s) Summary
Canonical tool resolution
internal/agent/tool/registry.go
The registry maps Canvas component names to canonical tool keys. BuildByName and BuildAll use the normalized names and parameter keys.
Canvas tool construction coverage
internal/agent/tool/registry_test.go, internal/agent/component/agent_test.go
Tests cover Canvas name resolution, Google Scholar parameter aliases, CodeExec Agent construction, and removal of the obsolete queritsearch expectations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: wangq8

Poem

A rabbit hops through names in a row,
Canonical keys make the tools go.
CodeExec runs with ears held high,
Scholar keeps top_n nearby.
Tests check each alias in sight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: normalizing Canvas tool names in the Go agent.
Description check ✅ Passed The description includes the required Summary section and provides relevant testing details for the normalization changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@yuzhichang

Copy link
Copy Markdown
Member

LGTM

@yuzhichang
yuzhichang merged commit 539eb47 into infiniflow:main Aug 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants