Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: runtime unresolved tool calls (#17044)

Rylan Caia5b1e526416d
diff --git a/apps/server/src/modules/AgentRuntime/__tests__/RuntimeExecutors.test.ts b/apps/server/src/modules/AgentRuntime/__tests__/RuntimeExecutors.test.ts
index eb1f69bbcc7..1a854844d34 100644
--- a/apps/server/src/modules/AgentRuntime/__tests__/RuntimeExecutors.test.ts
+++ b/apps/server/src/modules/AgentRuntime/__tests__/RuntimeExecutors.test.ts
@@ -315,7 +315,7 @@ describe('RuntimeExecutors', { timeout: 60_000 }, () => {
);
});
- it('should restrict context tools and resolved tool calls to allowedToolNames', async () => {
+ it('should restrict context tools to allowedToolNames', async () => {
const toolNameResolver = new ToolNameResolver();
const readToolName = toolNameResolver.generate('workspace', 'read', 'builtin');
const writeToolName = toolNameResolver.generate('workspace', 'write', 'builtin');
@@ -328,11 +328,6 @@ describe('RuntimeExecutors', { timeout: 60_000 }, () => {
id: 'read-call',
type: 'function',
},
- {
- function: { arguments: '{}', name: writeToolName },
- id: 'write-call',
- type: 'function',
- },
],
});
return new Response('done');
diff --git a/packages/context-engine/src/engine/tools/ToolNameResolver.ts b/packages/context-engine/src/engine/tools/ToolNameResolver.ts
index c2ad93dbc1f..173c3c1e58c 100644
--- a/packages/context-engine/src/engine/tools/ToolNameResolver.ts
+++ b/packages/context-engine/src/engine/tools/ToolNameResolver.ts
@@ -129,8 +129,6 @@ export class ToolNameResolver {
} else {
return null;
}
- } else if (offeredSet && !offeredSet.has(toolCall.function.name)) {
- return null;
}
// Step 1: Resolve hashed identifier if needed
diff --git a/packages/context-engine/src/engine/tools/__tests__/ToolNameResolver.test.ts b/packages/context-engine/src/engine/tools/__tests__/ToolNameResolver.test.ts
index 4e372ff2833..0f31e3439a9 100644
--- a/packages/context-engine/src/engine/tools/__tests__/ToolNameResolver.test.ts
+++ b/packages/context-engine/src/engine/tools/__tests__/ToolNameResolver.test.ts
@@ -897,32 +897,6 @@ describe('ToolNameResolver', () => {
expect(result).toEqual([]);
});
- it('should drop fully-qualified tool names that were not offered this turn', () => {
- const toolCalls = [
- {
- function: { arguments: '{}', name: 'workspace____write' },
- id: 'call_1',
- type: 'function',
- },
- ];
-
- const manifests = {
- workspace: {
- api: [
- { description: '', name: 'read', parameters: {} },
- { description: '', name: 'write', parameters: {} },
- ],
- identifier: 'workspace',
- meta: {},
- type: 'builtin' as const,
- },
- };
-
- const result = resolver.resolve(toolCalls, manifests, ['workspace____read']);
-
- expect(result).toEqual([]);
- });
-
it('should treat an enabled call as unique when a disabled duplicate would have made it ambiguous', () => {
const toolCalls = [
{