Skip to content

Commit 31862b4

Browse files
committed
Delete send_agent_message tool
1 parent 9d31e1b commit 31862b4

File tree

14 files changed

+157
-320
lines changed

14 files changed

+157
-320
lines changed

backend/src/run-agent-step.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,6 @@ export const runAgentStep = async (
212212
// Update status to running for existing agents
213213
asyncAgentManager.updateAgentState(agentState, 'running')
214214
}
215-
216-
// Check for pending messages from other agents
217-
const pendingMessages = asyncAgentManager.getAndClearMessages(
218-
agentState.agentId,
219-
)
220-
for (const message of pendingMessages) {
221-
toolResults.push({
222-
toolName: 'send_agent_message',
223-
toolCallId: generateCompactId(),
224-
result: `Message from agent ${message.fromAgentId}:\n\nPrompt: ${message.prompt}${message.params ? `\n\nParams: ${JSON.stringify(message.params, null, 2)}` : ''}`,
225-
})
226-
}
227215
}
228216

229217
const agentTemplate = await getAgentTemplate(agentType, localAgentTemplates)

backend/src/templates/agents/superagent.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ export const superagent = (
1919
},
2020
outputMode: 'last_message',
2121
includeMessageHistory: false,
22-
toolNames: [
23-
'spawn_agents',
24-
'spawn_agents_async',
25-
'send_agent_message',
26-
'end_turn',
27-
'think_deeply',
28-
],
22+
toolNames: ['spawn_agents', 'spawn_agents_async', 'end_turn', 'think_deeply'],
2923
subagents: allAvailableAgents
3024
? (allAvailableAgents as any[])
3125
: [
@@ -50,8 +44,6 @@ If you are gathering information, spawn the "ask" agent synchronously (spawn_age
5044
5145
If you are delegating a coding task, spawn the "base" agent *asynchronously* (spawn_agents_async) so you can help the user with other tasks while the spawned agent works on the code.
5246
53-
Prefer sending a message to a previous agent over spawning a new agent, especially if that agent was previously working on a similar task.
54-
5547
Feel free to ask the user for clarification if you are unsure what to do.
5648
`.trim(),
5749
stepPrompt:

backend/src/tools/definitions/list.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { readDocsTool } from './tool/read-docs'
1111
import { readFilesTool } from './tool/read-files'
1212
import { runFileChangeHooksTool } from './tool/run-file-change-hooks'
1313
import { runTerminalCommandTool } from './tool/run-terminal-command'
14-
import { sendAgentMessageTool } from './tool/send-agent-message'
1514
import { setMessagesTool } from './tool/set-messages'
1615
import { setOutputTool } from './tool/set-output'
1716
import { spawnAgentsTool } from './tool/spawn-agents'
@@ -39,7 +38,6 @@ const toolDescriptions = {
3938
read_files: readFilesTool,
4039
run_file_change_hooks: runFileChangeHooksTool,
4140
run_terminal_command: runTerminalCommandTool,
42-
send_agent_message: sendAgentMessageTool,
4341
set_messages: setMessagesTool,
4442
set_output: setOutputTool,
4543
spawn_agents: spawnAgentsTool,

backend/src/tools/definitions/tool/send-agent-message.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

backend/src/tools/definitions/tool/spawn-agents-async.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const spawnAgentsAsyncTool = {
88
description: `
99
Use this tool to spawn subagents asynchronously to help you complete the user request. Unlike spawn_agents, this tool does not wait for the agents to complete and allows the parent agent to continue execution. The subagents can continue to run even if the parent agent ends its turn.
1010
11-
The spawned agents run independently and can communicate back to the parent using send_agent_message. The parent agent can also send further messages to the async agents. The parent agent can end its turn without waiting for the async agents to complete. If so, async children will wake the parent when they send a message.
11+
The spawned agents run independently. The parent agent can end its turn without waiting for the async agents to complete.
1212
1313
Prefer to use spawn_agents unless you really need this ability to spawn asynchronous agents.
1414

backend/src/tools/handlers/list.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { handleReadDocs } from './tool/read-docs'
99
import { handleReadFiles } from './tool/read-files'
1010
import { handleRunFileChangeHooks } from './tool/run-file-change-hooks'
1111
import { handleRunTerminalCommand } from './tool/run-terminal-command'
12-
import { handleSendAgentMessage } from './tool/send-agent-message'
1312
import { handleSetMessages } from './tool/set-messages'
1413
import { handleSetOutput } from './tool/set-output'
1514
import { handleSpawnAgents } from './tool/spawn-agents'
@@ -45,7 +44,6 @@ export const codebuffToolHandlers = {
4544
read_files: handleReadFiles,
4645
run_file_change_hooks: handleRunFileChangeHooks,
4746
run_terminal_command: handleRunTerminalCommand,
48-
send_agent_message: handleSendAgentMessage,
4947
set_messages: handleSetMessages,
5048
set_output: handleSetOutput,
5149
spawn_agents: handleSpawnAgents,

backend/src/tools/handlers/tool/send-agent-message.ts

Lines changed: 0 additions & 73 deletions
This file was deleted.

common/src/tools/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const toolNames = [
2020
'read_files',
2121
'run_file_change_hooks',
2222
'run_terminal_command',
23-
'send_agent_message',
2423
'set_messages',
2524
'set_output',
2625
'spawn_agents',

common/src/tools/list.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { readDocsParams } from './params/tool/read-docs'
99
import { readFilesParams } from './params/tool/read-files'
1010
import { runFileChangeHooksParams } from './params/tool/run-file-change-hooks'
1111
import { runTerminalCommandParams } from './params/tool/run-terminal-command'
12-
import { sendAgentMessageParams } from './params/tool/send-agent-message'
1312
import { setMessagesParams } from './params/tool/set-messages'
1413
import { setOutputParams } from './params/tool/set-output'
1514
import { spawnAgentsParams } from './params/tool/spawn-agents'
@@ -35,7 +34,6 @@ export const llmToolCallSchema = {
3534
read_files: readFilesParams,
3635
run_file_change_hooks: runFileChangeHooksParams,
3736
run_terminal_command: runTerminalCommandParams,
38-
send_agent_message: sendAgentMessageParams,
3937
set_messages: setMessagesParams,
4038
set_output: setOutputParams,
4139
spawn_agents: spawnAgentsParams,
@@ -71,7 +69,6 @@ export const clientToolCallSchema = {
7169

7270
browser_logs: ['type', 'url', 'waitUntil'],
7371

74-
send_agent_message: ['target_agent_id', 'prompt', 'params'],
7572
spawn_agents: ['agents'],
7673
spawn_agents_async: ['agents'],
7774
spawn_agent_inline: ['agent_type', 'prompt', 'params'],

common/src/tools/params/tool/send-agent-message.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)