remove dead code (+ dont reset shellReady unless restarting) (#156)

This commit is contained in:
Olcan 2025-04-24 13:24:15 -07:00 committed by GitHub
parent d394a9f39f
commit deb11efa89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 6 deletions

View File

@ -42,7 +42,6 @@ interface QueuedCommand {
params: TerminalToolParams; params: TerminalToolParams;
resolve: (result: ToolResult) => void; resolve: (result: ToolResult) => void;
reject: (error: Error) => void; reject: (error: Error) => void;
confirmationDetails: ToolExecuteConfirmationDetails | false;
} }
export class TerminalTool extends BaseTool<TerminalToolParams, ToolResult> { export class TerminalTool extends BaseTool<TerminalToolParams, ToolResult> {
@ -183,16 +182,16 @@ Use this tool for running build steps (\`npm install\`, \`make\`), linters (\`es
`Persistent bash process exited (code: ${code}, signal: ${signal})`, `Persistent bash process exited (code: ${code}, signal: ${signal})`,
), ),
); );
this.shellReady = new Promise((resolve, reject) => {
this.resolveShellReady = resolve;
this.rejectShellReady = reject;
});
this.clearQueue( this.clearQueue(
new Error( new Error(
`Persistent bash process exited unexpectedly (code: ${code}, signal: ${signal}). State is lost. Queued commands cancelled.`, `Persistent bash process exited unexpectedly (code: ${code}, signal: ${signal}). State is lost. Queued commands cancelled.`,
), ),
); );
if (signal !== 'SIGINT') { if (signal !== 'SIGINT') {
this.shellReady = new Promise((resolve, reject) => {
this.resolveShellReady = resolve;
this.rejectShellReady = reject;
});
setTimeout(() => this.initializeShell(), 1000); setTimeout(() => this.initializeShell(), 1000);
} }
}); });
@ -286,7 +285,6 @@ Use this tool for running build steps (\`npm install\`, \`make\`), linters (\`es
llmContent: `Internal tool error for command: ${params.command}\nError: ${error.message}`, llmContent: `Internal tool error for command: ${params.command}\nError: ${error.message}`,
returnDisplay: `Internal Tool Error: ${error.message}`, returnDisplay: `Internal Tool Error: ${error.message}`,
}), }),
confirmationDetails: false,
}; };
this.commandQueue.push(queuedItem); this.commandQueue.push(queuedItem);
setImmediate(() => this.triggerQueueProcessing()); setImmediate(() => this.triggerQueueProcessing());