@@ -15,6 +15,7 @@ import * as Effect from "effect/Effect";
1515
1616import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts" ;
1717import { CursorProviderCapabilitiesV2 } from "@t3tools/provider-cursor/testing" ;
18+ import { makeGrokAcpAdapterFlavor } from "@t3tools/provider-grok/testing" ;
1819import * as CommandPolicy from "./CommandPolicy.ts" ;
1920
2021const 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+
214237it . each ( [ "/compact" , " /LOGOUT " ] ) ( "queues a steer sent while %s runs" , ( text ) => {
215238 const projection = dispatchProjection ( baseCapabilities ) ;
216239 const maintenance = {
0 commit comments