diff --git a/packages/core/src/tool/plugin/shell.ts b/packages/core/src/tool/plugin/shell.ts index 7409b6acd43..6b7fd1d70c0 100644 --- a/packages/core/src/tool/plugin/shell.ts +++ b/packages/core/src/tool/plugin/shell.ts @@ -19,7 +19,7 @@ export const name = "shell" export const DEFAULT_TIMEOUT_MS = 2 * 60 * 1_000 const BACKGROUND_INSTRUCTION = - "You will be notified automatically when the command finishes. Avoid sleep commands or polling for completion; if you need the output before then, read the file directly." + "You will be notified automatically when the command finishes. The notification will include the command's output. DO NOT run sleep commands or poll the output file to check for completion. You can read from the file when its current output would be useful, such as when inspecting logs from a background server. Otherwise, continue with other work or end your response." const OS = process.platform === "darwin" ? "macOS" diff --git a/packages/core/test/tool-shell.test.ts b/packages/core/test/tool-shell.test.ts index 4de9ff16dea..198b9e8b657 100644 --- a/packages/core/test/tool-shell.test.ts +++ b/packages/core/test/tool-shell.test.ts @@ -1295,7 +1295,7 @@ describe("ShellTool", () => { }, { type: "text", - text: "You will be notified automatically when the command finishes. Avoid sleep commands or polling for completion; if you need the output before then, read the file directly.", + text: "You will be notified automatically when the command finishes. The notification will include the command's output. DO NOT run sleep commands or poll the output file to check for completion. You can read from the file when its current output would be useful, such as when inspecting logs from a background server. Otherwise, continue with other work or end your response.", }, ]) expect((yield* shell.list()).map((info) => info.id)).toContain(id) @@ -1535,7 +1535,7 @@ describe("ShellTool", () => { }) expect(settled.content?.[1]).toEqual({ type: "text", - text: "You will be notified automatically when the command finishes. Avoid sleep commands or polling for completion; if you need the output before then, read the file directly.", + text: "You will be notified automatically when the command finishes. The notification will include the command's output. DO NOT run sleep commands or poll the output file to check for completion. You can read from the file when its current output would be useful, such as when inspecting logs from a background server. Otherwise, continue with other work or end your response.", }) yield* Effect.sleep(Duration.millis(100)) expect((yield* shell.get(id)).status).toBe("running")