Skip to content

Commit 08b8689

Browse files
fix(provider-grok): Grok follow-ups queue instead of cancelling the running tool (#36422)
1 parent aaa3dba commit 08b8689

4 files changed

Lines changed: 25 additions & 73 deletions

File tree

‎apps/server/src/orchestration-v2/CommandPolicy.test.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import * as Effect from "effect/Effect";
1515

1616
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
1717
import { CursorProviderCapabilitiesV2 } from "@t3tools/provider-cursor/testing";
18+
import { makeGrokAcpAdapterFlavor } from "@t3tools/provider-grok/testing";
1819
import * as CommandPolicy from "./CommandPolicy.ts";
1920

2021
const commandId = CommandId.make("command-policy-test");
@@ -211,6 +212,28 @@ it("queues a steer for a provider that cannot steer either way", () => {
211212
);
212213
});
213214

215+
// regression: #27014 a Grok follow-up cancels the foreground tool the user wanted to finish
216+
it("does not steer a Grok follow-up by interrupting its running turn", () => {
217+
const grok = makeGrokAcpAdapterFlavor(
218+
{ makeRuntime: () => Effect.never } as unknown as Parameters<
219+
typeof makeGrokAcpAdapterFlavor
220+
>[0],
221+
"/home/ada",
222+
).capabilities;
223+
const projection = dispatchProjection(grok);
224+
for (const deliveryIntent of ["auto", "steer"] as const) {
225+
const mode = CommandPolicy.resolveMessageDispatchIntent(
226+
projection,
227+
{ type: "start_immediately" },
228+
deliveryIntent,
229+
);
230+
assert.isFalse(
231+
mode.type === "steer_active" && !grok.turns.supportsActiveSteering,
232+
`${deliveryIntent} follow-up resolved to ${mode.type} by interrupt-restart`,
233+
);
234+
}
235+
});
236+
214237
it.each(["/compact", " /LOGOUT "])("queues a steer sent while %s runs", (text) => {
215238
const projection = dispatchProjection(baseCapabilities);
216239
const maintenance = {

‎apps/server/src/orchestration-v2/testkit/fixtures/index.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,12 +1779,6 @@ export const ORCHESTRATOR_REPLAY_FIXTURES: ReadonlyArray<OrchestratorReplayFixtu
17791779
modelSelection: CURSOR_MODEL_SELECTION,
17801780
assertOutput: assertCursorMessageSteeringOutput,
17811781
},
1782-
{
1783-
driver: ProviderDriverKind.make("grok"),
1784-
transcriptFile: new URL("./message_steering/grok_transcript.ndjson", import.meta.url),
1785-
modelSelection: GROK_MODEL_SELECTION,
1786-
assertOutput: assertGrokMessageSteeringOutput,
1787-
},
17881782
{
17891783
driver: ProviderDriverKind.make("fx"),
17901784
transcriptFile: new URL("./message_steering/fx_transcript.ndjson", import.meta.url),

0 commit comments

Comments
 (0)