| 1 | import type { OrchestratorFixtureInput } from "../shared.ts"; |
| 2 | |
| 3 | export const GROK_BACKGROUND_BASH_TICKS = ["tock 1", "tock 2", "tock 3"] as const; |
| 4 | |
| 5 | export const GROK_BACKGROUND_BASH_PROMPT = |
| 6 | "Start this shell command as a background task (run it in the background, do not wait for it, do not use the Monitor tool): 'for i in 1 2 3; do sleep 8; echo tock $i; done'. As soon as it has started, end your turn by replying exactly ROOT_DONE. When it finishes, reply exactly with its last line."; |
| 7 | |
| 8 | /** The first frame of Grok's own `task-completed-*` wake turn after the command ended. */ |
| 9 | const GROK_BACKGROUND_BASH_WAKE_LABEL = |
| 10 | "notification:session/update:agent_thought_chunk:task-completed-00000000-0000-4000-8000-000000000002"; |
| 11 | |
| 12 | // The root prompt settles while the backgrounded command still runs, so run 1 |
| 13 | // is held open until `x.ai/task_completed`. Grok's own reply to the finished |
| 14 | // command replays as a continuation run. |
| 15 | export function grokBackgroundBashInput(): OrchestratorFixtureInput { |
| 16 | return { |
| 17 | steps: [ |
| 18 | { type: "message", text: GROK_BACKGROUND_BASH_PROMPT }, |
| 19 | { type: "finish_held_run", targetRunIndex: 1, status: "completed" }, |
| 20 | { type: "release_replay_gate", label: GROK_BACKGROUND_BASH_WAKE_LABEL }, |
| 21 | { type: "finish_held_run", targetRunIndex: 2, status: "completed" }, |
| 22 | ], |
| 23 | }; |
| 24 | } |