@@ -20,6 +20,7 @@ import * as ProviderEventLoggers from "@t3tools/provider-core/server/ProviderEve
2020import * as ProviderMaintenance from "@t3tools/provider-core/server/maintenanceResolver" ;
2121import * as OpenCodeRuntime from "./OpenCodeRuntime.ts" ;
2222import {
23+ OPENCODE_1_RESPONSES ,
2324 OPENCODE_2_RESPONSES ,
2425 OPENCODE_2_WORKSPACE_RESPONSES ,
2526 replayOpenCodeServer ,
@@ -112,6 +113,36 @@ it.layer(layer)("OpenCodeDriver runtime selection", (it) => {
112113 } ) . pipe ( Effect . scoped ) ,
113114 ) ;
114115
116+ it . effect ( "keeps an OpenCode 1.x workspace's commands pending when listing them fails" , ( ) =>
117+ Effect . gen ( function * ( ) {
118+ const openCode1Runtime = {
119+ connectToOpenCodeServer : ( ) =>
120+ Effect . succeed ( {
121+ url : "http://127.0.0.1:4096" ,
122+ version : "1.18.32" ,
123+ exitCode : null ,
124+ external : true ,
125+ } ) ,
126+ createOpenCodeSdkClient : ( ) => ( {
127+ command : { list : ( ) => Promise . reject ( new Error ( "command.list failed" ) ) } ,
128+ } ) ,
129+ loadOpenCodeSkills : ( ) =>
130+ Effect . succeed ( [ { name : "plum" , location : "/work/.opencode/skills/plum/SKILL.md" } ] ) ,
131+ } as unknown as OpenCodeRuntime . OpenCodeRuntimeShape ;
132+ const instance = yield * create (
133+ { serverUrl : "http://127.0.0.1:4096" , serverPassword : "secret" } ,
134+ replayOpenCodeServer ( OPENCODE_1_RESPONSES , "secret" ) ,
135+ ) . pipe ( Effect . provideService ( OpenCodeRuntime . OpenCodeRuntime , openCode1Runtime ) ) ;
136+
137+ const workspace = yield * instance . snapshotForCwd ! ( "/work" ) ;
138+ assert . deepStrictEqual (
139+ workspace . skills . map ( ( skill ) => skill . name ) ,
140+ [ "plum" ] ,
141+ ) ;
142+ assert . strictEqual ( workspace . slashCommandsPending , true ) ;
143+ } ) . pipe ( Effect . scoped ) ,
144+ ) ;
145+
115146 it . effect ( "answers capability reads without waiting on an unreachable server" , ( ) =>
116147 Effect . gen ( function * ( ) {
117148 const hang = HttpClient . make ( ( ) => Effect . never ) ;
0 commit comments