Skip to content

fix(koog-ktor): rename registerTools parameter to avoid Builder.build() shadowing (#1705)#1721

Open
hxreborn wants to merge 1 commit intoJetBrains:developfrom
hxreborn:fix/1705-ktor-register-tools
Open

fix(koog-ktor): rename registerTools parameter to avoid Builder.build() shadowing (#1705)#1721
hxreborn wants to merge 1 commit intoJetBrains:developfrom
hxreborn:fix/1705-ktor-register-tools

Conversation

@hxreborn
Copy link
Copy Markdown
Contributor

In KoogAgentsConfig.registerTools, the lambda parameter was named build. Inside the ToolRegistry { } block (where this is ToolRegistry.Builder), calling build() resolves to the member function Builder.build() instead of the lambda, because Kotlin member functions always shadow extension-like lambdas. So tools passed through the ktor plugin config never actually got registered.

Renamed the parameter from build to block to avoid the shadowing. It's a lambda param so this is source-compatible.

Fixes #1705

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Koog-ktor does not register tools during plugin config

1 participant