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