Skip to content

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

Merged
aozherelyeva merged 2 commits intoJetBrains:developfrom
hxreborn:fix/1705-ktor-register-tools
Apr 10, 2026
Merged

fix(koog-ktor): rename registerTools parameter to avoid Builder.build() shadowing (#1705)#1721
aozherelyeva merged 2 commits 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

@aozherelyeva aozherelyeva merged commit 257ebd1 into JetBrains:develop Apr 10, 2026
29 of 31 checks passed
Fant1k34 pushed a commit that referenced this pull request Apr 11, 2026
…() shadowing (#1705) (#1721)

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

Co-authored-by: Briliantov Vadim <[email protected]>
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

3 participants