Skip to content

Commit 8e086b4

Browse files
committed
feat: remove respawn capability, it wasn't being used anyhow.
1 parent 2867772 commit 8e086b4

File tree

10 files changed

+10
-257
lines changed

10 files changed

+10
-257
lines changed

docs/github-comment-commands.md

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

docs/release-process.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/tools/agent-tools.md

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

packages/agent/src/core/toolAgent/toolAgentCore.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,13 @@ export const toolAgent = async (
157157
);
158158

159159
// Execute the tools and get results
160-
const { agentDoned, completionResult, respawn } = await executeTools(
160+
const { agentDoned, completionResult } = await executeTools(
161161
toolCalls,
162162
tools,
163163
messages,
164164
localContext,
165165
);
166166

167-
if (respawn) {
168-
logger.info('Respawning agent with new context');
169-
// Reset messages to just the new context
170-
messages.length = 0;
171-
messages.push({
172-
role: 'user',
173-
content: respawn.context,
174-
});
175-
continue;
176-
}
177-
178167
if (agentDoned) {
179168
const result: ToolAgentResult = {
180169
result: completionResult ?? 'Sequence explicitly completed',

packages/agent/src/core/toolAgent/toolExecutor.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,6 @@ export async function executeTools(
3939

4040
logger.verbose(`Executing ${toolCalls.length} tool calls`);
4141

42-
// Check for respawn tool call
43-
const respawnCall = toolCalls.find((call) => call.name === 'respawn');
44-
if (respawnCall) {
45-
// Add the tool result to messages
46-
addToolResultToMessages(messages, respawnCall.id, { success: true }, false);
47-
48-
return {
49-
agentDoned: false,
50-
toolResults: [
51-
{
52-
toolCallId: respawnCall.id,
53-
toolName: respawnCall.name,
54-
result: { success: true },
55-
},
56-
],
57-
respawn: {
58-
context: JSON.parse(respawnCall.content).respawnContext,
59-
},
60-
};
61-
}
62-
6342
const toolResults = await Promise.all(
6443
toolCalls.map(async (call) => {
6544
let toolResult = '';

packages/agent/src/core/toolAgent/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export interface ToolCallResult {
1010
agentDoned: boolean;
1111
completionResult?: string;
1212
toolResults: unknown[];
13-
respawn?: { context: string };
1413
}
1514

1615
export type ErrorResult = {

packages/agent/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export * from './tools/fetch/fetch.js';
44

55
// Tools - System
66
export * from './tools/shell/shellStart.js';
7-
export * from './tools/sleep/sleep.js';
7+
export * from './tools/sleep/wait.js';
88
export * from './tools/agent/agentDone.js';
99
export * from './tools/shell/shellMessage.js';
1010
export * from './tools/shell/shellExecute.js';

packages/agent/src/tools/getTools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { sessionStartTool } from './session/sessionStart.js';
1515
import { listShellsTool } from './shell/listShells.js';
1616
import { shellMessageTool } from './shell/shellMessage.js';
1717
import { shellStartTool } from './shell/shellStart.js';
18-
import { sleepTool } from './sleep/sleep.js';
18+
import { waitTool } from './sleep/wait.js';
1919
import { textEditorTool } from './textEditor/textEditor.js';
2020

2121
// Import these separately to avoid circular dependencies
@@ -49,7 +49,7 @@ export function getTools(options?: GetToolsOptions): Tool[] {
4949
sessionMessageTool as unknown as Tool,
5050
listSessionsTool as unknown as Tool,
5151

52-
sleepTool as unknown as Tool,
52+
waitTool as unknown as Tool,
5353
];
5454

5555
// Only include userPrompt tool if enabled

packages/agent/src/tools/sleep/sleep.test.ts renamed to packages/agent/src/tools/sleep/wait.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
33
import { ToolContext } from '../../core/types';
44
import { getMockToolContext } from '../getTools.test';
55

6-
import { sleepTool } from './sleep';
6+
import { waitTool } from './wait';
77

88
const toolContext: ToolContext = getMockToolContext();
99

@@ -13,7 +13,7 @@ describe('sleep tool', () => {
1313
});
1414

1515
it('should sleep for the specified duration', async () => {
16-
const sleepPromise = sleepTool.execute({ seconds: 2 }, toolContext);
16+
const sleepPromise = waitTool.execute({ seconds: 2 }, toolContext);
1717

1818
await vi.advanceTimersByTimeAsync(2000);
1919
const result = await sleepPromise;
@@ -23,13 +23,13 @@ describe('sleep tool', () => {
2323

2424
it('should reject negative sleep duration', async () => {
2525
await expect(
26-
sleepTool.execute({ seconds: -1 }, toolContext),
26+
waitTool.execute({ seconds: -1 }, toolContext),
2727
).rejects.toThrow();
2828
});
2929

3030
it('should reject sleep duration over 1 hour', async () => {
3131
await expect(
32-
sleepTool.execute({ seconds: 3601 }, toolContext),
32+
waitTool.execute({ seconds: 3601 }, toolContext),
3333
).rejects.toThrow();
3434
});
3535
});

packages/agent/src/tools/sleep/sleep.ts renamed to packages/agent/src/tools/sleep/wait.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const returnsSchema = z.object({
1818
sleptFor: z.number().describe('Actual number of seconds slept'),
1919
});
2020

21-
export const sleepTool: Tool = {
22-
name: 'sleep',
21+
export const waitTool: Tool = {
22+
name: 'wait',
2323
description:
2424
'Pauses execution for the specified number of seconds, useful when waiting for async tools to make progress before checking on them',
2525
logPrefix: '💤',

0 commit comments

Comments
 (0)