| 1 | import { assert } from "@effect/vitest"; |
| 2 | import type { ProviderReplayTranscript } from "@t3tools/contracts"; |
| 3 | |
| 4 | import type { OrchestratorV2ScenarioResult } from "../../OrchestratorScenario.ts"; |
| 5 | import { assertPlanQuestionsOutputBase } from "./codex_output.ts"; |
| 6 | import { projectionFor } from "../shared.ts"; |
| 7 | |
| 8 | export function assertOpenCodePlanQuestionsOutput( |
| 9 | result: OrchestratorV2ScenarioResult, |
| 10 | transcript: ProviderReplayTranscript, |
| 11 | ) { |
| 12 | // The shared assertions cover the runtime-request lifecycle. OpenCode owns |
| 13 | // its question identifiers, so assert its normalized native header instead |
| 14 | // of Codex's fixture-specific id. |
| 15 | assertPlanQuestionsOutputBase(result, transcript); |
| 16 | const projection = projectionFor(result, transcript.scenario); |
| 17 | const requestItem = projection.turnItems.find((item) => item.type === "user_input_request"); |
| 18 | assert.equal(requestItem?.questions[0]?.id, "question-0-schema-vs-flexibility"); |
| 19 | assert.equal(requestItem?.status, "completed"); |
| 20 | assert.lengthOf( |
| 21 | projection.turnItems.filter( |
| 22 | (item) => item.type === "dynamic_tool" && item.toolName === "question", |
| 23 | ), |
| 24 | 0, |
| 25 | ); |
| 26 | } |