mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-30 16:32:03 +00:00
fix(core): strengthen background shell guidance (#45843)
This commit is contained in:
parent
5743537945
commit
e12e04f482
2 changed files with 3 additions and 3 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue