fix(core): keep model-facing background instruction out of rendered shell output

This commit is contained in:
Kit Langton 2026-07-02 09:22:11 -04:00
commit 9b5f689b4e
2 changed files with 15 additions and 7 deletions

View file

@ -513,9 +513,14 @@ describe("ShellTool", () => {
const structured = settled.output?.structured as Record<string, unknown> | undefined
const shellID = typeof structured?.shellID === "string" ? structured.shellID : undefined
expect(settled.output?.structured).toMatchObject({ truncated: false })
expect(settled.output?.content[0]).toMatchObject({
// content[0] is rendered by clients; the model-facing instruction stays in content[1].
expect(settled.output?.content[0]).toEqual({
type: "text",
text: expect.stringContaining("moved to the background"),
text: "The command was moved to the background.",
})
expect(settled.output?.content[1]).toMatchObject({
type: "text",
text: expect.stringContaining("DO NOT sleep, poll"),
})
expect(shellID).toStartWith("sh_")