[AI] Collapse NativeToolBinder to a single bind() entry (#20051)

The binder doesnt need an agent or full tool context -- just a model and
options.
Single `bind(model, options)` entry!


Builds on #20022.
This commit is contained in:
nitin
2026-04-27 20:05:59 +05:30
committed by GitHub
parent 13aaea597e
commit bb5f294c5a
6 changed files with 13 additions and 44 deletions
@@ -150,7 +150,6 @@ export class AgentAsyncExecutorService {
rolePermissionConfig: effectiveRoleConfig ?? { unionOf: [] },
authContext,
actorContext,
agent: agent as unknown as ToolProviderContext['agent'],
userId:
isDefined(authContext) && isUserAuthContext(authContext)
? authContext.user.id
@@ -169,8 +168,10 @@ export class AgentAsyncExecutorService {
},
);
const nativeTools =
await this.nativeToolBinder.bind(toolProviderContext);
const nativeTools = this.nativeToolBinder.bind(registeredModel, {
webSearchEnabled:
agent.modelConfiguration?.webSearch?.enabled === true,
});
tools = {
...registryTools,