Stop computer bash commands on the computer itself
The sandbox ignores sandbox_execute_bash's timeout and runs every call in one shared shell session, so a command that never ended (a network read without a timeout, a prompt) kept running after the call gave up, and every later command on that computer, from any run, timed out behind it. Each command now runs in its own bash under coreutils timeout (at most ComputerCommandMaxSeconds, below McpToolTimeoutMs), reading no input, and says when it was stopped. Replies' env list says where each key comes from and that workspace, computer and install-wide envs reach every bot there, so bots stop telling users a workspace's keys must be set per bot. The computer prompt says installed programs may be gone after a restart. An empty open-only task list says closed tasks aren't shown, and update_task says when a status was already set. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -12,6 +12,7 @@ import type { HarnessTool } from "../../types";
|
||||
import computerDirsShell from "./computer-dirs-shell";
|
||||
import captureSecretTool from "./capture-secret-tool";
|
||||
import runComputerCommand from "./run-computer-command";
|
||||
import withCommandTimeout from "./with-command-timeout";
|
||||
import withComputerDirs from "./with-computer-dirs";
|
||||
import withComputerEnv from "./with-computer-env";
|
||||
import writeComputerEnv from "./write-computer-env";
|
||||
@@ -65,7 +66,8 @@ export type OpenComputer = {
|
||||
* shell, files, code and browser. Its envs (`grabComputerEnvs`) are written
|
||||
* to the computer and loaded by the shell and code tools; secret values are
|
||||
* redacted from everything the tools return. Every tool is kept in the
|
||||
* run's folders (`withComputerDirs`), which are created first. Screenshots
|
||||
* run's folders (`withComputerDirs`), which are created first, and every
|
||||
* bash command is stopped on the computer (`withCommandTimeout`). Screenshots
|
||||
* come back as readings from the media reading harness. Call `close` when the run ends.
|
||||
* Throws when the computer can't be reached, which the queue retries.
|
||||
*/
|
||||
@@ -125,7 +127,7 @@ export default async function openComputerTools({
|
||||
return {
|
||||
name: target.name,
|
||||
tools: [
|
||||
...tools.map((tool) => withComputerDirs({ tool: withComputerEnv({ tool, ...paths }), dirs })),
|
||||
...tools.map((tool) => withComputerDirs({ tool: withComputerEnv({ tool: withCommandTimeout({ tool }), ...paths }), dirs })),
|
||||
...(user_id && bot_id && onSecretRef
|
||||
? [
|
||||
captureSecretTool({
|
||||
|
||||
Reference in New Issue
Block a user