Skip to content

Commit 008162e

Browse files
test(server): replay currency-sigil skill mentions through Codex startTurn and steerTurn
The table test only called codexSkillMentionText, so dropping the call from toCodexInput left every test green. Replay a scripted turn that sends `€review do it` and steers with `then £ship it`, and expect the outbound turn/start and turn/steer frames to carry `$` mentions. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent f2e540e commit 008162e

1 file changed

Lines changed: 62 additions & 1 deletion

File tree

‎apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts‎

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,8 @@ function codexReplayPreamble(input: {
13681368
readonly nativeThreadId: string;
13691369
readonly nativeTurnId: string;
13701370
readonly prompt: string;
1371+
/** Text the adapter should send, when it differs from what the user typed. */
1372+
readonly sentPrompt?: string;
13711373
}): Array<CodexReplay.CodexAppServerReplayEntry> {
13721374
return [
13731375
{
@@ -1451,7 +1453,7 @@ function codexReplayPreamble(input: {
14511453
method: "turn/start",
14521454
params: {
14531455
threadId: input.nativeThreadId,
1454-
input: [{ type: "text", text: input.prompt }],
1456+
input: [{ type: "text", text: input.sentPrompt ?? input.prompt }],
14551457
cwd: "/workspace",
14561458
model: "gpt-5.4",
14571459
approvalPolicy: "never",
@@ -1960,6 +1962,65 @@ describe("CodexAdapterV2 post-settle continuation", () => {
19601962
}).pipe(Effect.scoped, Effect.provide(Layer.merge(idAllocatorLayer, NodeServices.layer))),
19611963
);
19621964

1965+
it.effect("sends currency-sigil skill mentions to Codex as $ mentions", () =>
1966+
Effect.gen(function* () {
1967+
const nativeThreadId = "skill-sigil-thread";
1968+
const nativeTurnId = "skill-sigil-turn";
1969+
const transcript = makeCodexReplayTranscript({
1970+
scenario: "skill-sigil-canonicalized",
1971+
entries: [
1972+
...codexReplayPreamble({
1973+
nativeThreadId,
1974+
nativeTurnId,
1975+
prompt: "€review do it",
1976+
sentPrompt: "$review do it",
1977+
}),
1978+
{
1979+
type: "expect_outbound",
1980+
label: "turn/steer",
1981+
frame: {
1982+
id: 4,
1983+
method: "turn/steer",
1984+
params: {
1985+
expectedTurnId: nativeTurnId,
1986+
input: [{ type: "text", text: "then $ship it" }],
1987+
threadId: nativeThreadId,
1988+
},
1989+
},
1990+
},
1991+
{
1992+
type: "emit_inbound",
1993+
label: "turn/steer",
1994+
frame: { id: 4, result: { turnId: nativeTurnId } },
1995+
},
1996+
],
1997+
});
1998+
const harness = yield* makeCodexReplayHarness(transcript);
1999+
const turnInput = makeCodexTestTurnInput({
2000+
threadId: harness.threadId,
2001+
providerThread: harness.providerThread,
2002+
now: yield* DateTime.now,
2003+
attemptId: RunAttemptId.make("skill-sigil-attempt"),
2004+
text: "€review do it",
2005+
});
2006+
yield* harness.runtime.startTurn(turnInput);
2007+
yield* harness.runtime.steerTurn({
2008+
threadId: harness.threadId,
2009+
runId: turnInput.runId,
2010+
providerThread: harness.providerThread,
2011+
providerTurnId: (yield* IdAllocatorV2).derive.providerTurn({
2012+
driver: CODEX_DRIVER_KIND,
2013+
nativeTurnId,
2014+
}),
2015+
message: {
2016+
...turnInput.message,
2017+
messageId: MessageId.make("message-skill-sigil-steer"),
2018+
text: "then £ship it",
2019+
},
2020+
});
2021+
}).pipe(Effect.scoped, Effect.provide(Layer.merge(idAllocatorLayer, NodeServices.layer))),
2022+
);
2023+
19632024
const assistantMessages = (events: ReadonlyArray<ProviderAdapterV2Event>) =>
19642025
events.filter(
19652026
(event): event is Extract<ProviderAdapterV2Event, { type: "message.updated" }> =>

0 commit comments

Comments
 (0)