@@ -452,19 +452,21 @@ function makeLocalCommandHarness(input: {
452452 ( input : RunExecutionService . RunExecutionServiceV2StartRootRunInput ) => Effect . Effect < void >
453453 > ( ( controls ) =>
454454 input . successfulNativeTurn === true
455- ? controls . session . startTurn ( {
456- appThread : controls . appThread ,
457- threadId : controls . appThread . id ,
458- runId : controls . run . id ,
459- runOrdinal : controls . run . ordinal ,
460- providerTurnOrdinal : controls . providerTurnOrdinal ,
461- attemptId : controls . attemptId ,
462- rootNodeId : controls . rootNode . id ,
463- providerThread : controls . providerThread ,
464- message : controls . message ,
465- modelSelection : controls . modelSelection ,
466- runtimePolicy : controls . runtimePolicy ,
467- } )
455+ ? controls . session
456+ . startTurn ( {
457+ appThread : controls . appThread ,
458+ threadId : controls . appThread . id ,
459+ runId : controls . run . id ,
460+ runOrdinal : controls . run . ordinal ,
461+ providerTurnOrdinal : controls . providerTurnOrdinal ,
462+ attemptId : controls . attemptId ,
463+ rootNodeId : controls . rootNode . id ,
464+ providerThread : controls . providerThread ,
465+ message : controls . message ,
466+ modelSelection : controls . modelSelection ,
467+ runtimePolicy : controls . runtimePolicy ,
468+ } )
469+ . pipe ( Effect . orDie )
468470 : input . failReadsAfterRunning === true
469471 ? Effect . void
470472 : Effect . die ( "A local command must not start a native turn." ) ,
@@ -479,7 +481,7 @@ function makeLocalCommandHarness(input: {
479481 ) ;
480482 const tryHandlePromptCommand = vi . fn ( ( ) =>
481483 input . logoutFailure === undefined
482- ? Effect . succeed ( true )
484+ ? Effect . succeed ( input . successfulNativeTurn !== true )
483485 : Effect . fail (
484486 new ProviderSetupError ( {
485487 instanceId : oldInstanceId ,
@@ -927,3 +929,32 @@ effectIt.effect("delivers frozen workspace context in an ordinary native provide
927929 expect ( harness . events . some ( ( event ) => event . type === "context-handoff.updated" ) ) . toBe ( false ) ;
928930 } ) ,
929931) ;
932+
933+ for ( const text of [
934+ "/goal" ,
935+ "/goal edit" ,
936+ "/goal pause" ,
937+ "/goal resume" ,
938+ "/goal clear" ,
939+ "/goal fix tests" ,
940+ ] ) {
941+ effectIt . effect ( `keeps workspace Codex command ${ text } available to the native adapter` , ( ) =>
942+ Effect . gen ( function * ( ) {
943+ const harness = makeLocalCommandHarness ( {
944+ text,
945+ workspace : {
946+ filePath : "/meta/all.code-workspace" ,
947+ workspaceRoot : "/meta" ,
948+ folders : [ { id : "first" , name : "First" , path : "/meta/first" } ] ,
949+ repositories : [ ] ,
950+ } ,
951+ successfulNativeTurn : true ,
952+ } ) ;
953+ yield * harness . start ;
954+ expect ( harness . startTurn ) . toHaveBeenCalledOnce ( ) ;
955+ expect ( harness . startTurn . mock . calls [ 0 ] ?. [ 0 ] . message . text ) . toBe ( text ) ;
956+ expect ( harness . getTurnStartHistory ) . not . toHaveBeenCalled ( ) ;
957+ expect ( harness . events . some ( ( event ) => event . type === "context-handoff.updated" ) ) . toBe ( false ) ;
958+ } ) ,
959+ ) ;
960+ }
0 commit comments