| 1 | import type { OrchestratorFixtureInput } from "../shared.ts"; |
| 2 | |
| 3 | export const GROK_MONITOR_TICKS = ["tick 1", "tick 2", "tick 3"] as const; |
| 4 | |
| 5 | export const GROK_MONITOR_PROMPT = |
| 6 | "Use the Monitor tool to watch this command: 'for i in 1 2 3; do sleep 8; echo tick $i; done'. Do not wait for the monitor to finish; as soon as it has started, end your turn by replying exactly ROOT_DONE."; |
| 7 | |
| 8 | /** First reply Grok streams after the monitor ended (its own `notifications-*` wake turn). */ |
| 9 | const GROK_MONITOR_WAKE_LABEL = |
| 10 | "notification:session/update:agent_message_chunk:notifications-01a0d754-c2a6-7e51-b5d9-710c43051847"; |
| 11 | |
| 12 | // The root prompt settles while the monitor still runs, so run 1 is held open |
| 13 | // until `_x.ai/task_completed`, then finishes through the adapter's debounce. |
| 14 | // Grok's own reply to the finished monitor is held until run 1 settled and |
| 15 | // replays as a continuation run, like Claude and Codex background wakes. |
| 16 | export function grokMonitorInput(): OrchestratorFixtureInput { |
| 17 | return { |
| 18 | steps: [ |
| 19 | { type: "message", text: GROK_MONITOR_PROMPT }, |
| 20 | { type: "finish_held_run", targetRunIndex: 1, status: "completed" }, |
| 21 | { type: "release_replay_gate", label: GROK_MONITOR_WAKE_LABEL }, |
| 22 | { type: "finish_held_run", targetRunIndex: 2, status: "completed" }, |
| 23 | ], |
| 24 | }; |
| 25 | } |