@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 34 lines 1.15 KB
Raw
1 import { assert } from "@effect/vitest";
2 import type { ProviderReplayTranscript } from "@t3tools/contracts";
3
4 import type { OrchestratorV2ScenarioResult } from "../../OrchestratorScenario.ts";
5 import {
6 assertBaseProjection,
7 assertSemanticProjectionIntegrity,
8 assertVisibleUserMessagesExclude,
9 assertVisibleUserMessagesInclude,
10 OPENCODE2_REVERT_FIRST_PROMPT,
11 OPENCODE2_REVERT_SECOND_PROMPT,
12 projectionFor,
13 } from "../shared.ts";
14
15 export function assertOpenCode2RevertOutput(
16 result: OrchestratorV2ScenarioResult,
17 transcript: ProviderReplayTranscript,
18 ) {
19 assertBaseProjection({
20 result,
21 transcript,
22 runCount: 2,
23 runStatuses: ["completed", "rolled_back"],
24 });
25 const projection = projectionFor(result, transcript.scenario);
26 assertSemanticProjectionIntegrity(projection);
27 assertVisibleUserMessagesInclude(projection, [OPENCODE2_REVERT_FIRST_PROMPT]);
28 assertVisibleUserMessagesExclude(projection, [OPENCODE2_REVERT_SECOND_PROMPT]);
29 const kept = projection.providerTurns.find((turn) => turn.ordinal === 1);
30 assert.equal(
31 projection.providerThreads[0]?.nativeConversationHeadRef?.nativeId,
32 kept?.nativeTurnRef?.nativeId,
33 );
34 }