Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): give slow OpenCode version probes more time #11093

Closedmdiniz97(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/11093/headopened View on GitHub

Showing 2 changed files with 25 additions and 4 deletions.

x
0 of 2 viewed, 2 left
24 additions and 3 deletionsapps/server/src/provider/Layers/OpenCodeProvider.test.tsModified
View file
@@ -37,6 +37,7 @@
state: {
runVersionError: null as Error | null,
runVersionPending: false,
+ runVersionDelayMs: null as number | null,
versionStdout: DEFAULT_VERSION_STDOUT,
inventoryError: null as Error | null,
connectionError: null as Error | null,
@@ -56,6 +57,7 @@
reset() {
this.state.runVersionError = null;
this.state.runVersionPending = false;
+ this.state.runVersionDelayMs = null;
this.state.versionStdout = DEFAULT_VERSION_STDOUT;
this.state.inventoryError = null;
this.state.connectionError = null;
@@ -128,7 +130,11 @@
cause: runtimeMock.state.runVersionError,
}),
- : Effect.succeed({ stdout: runtimeMock.state.versionStdout, stderr: "", code: 0 }),
+ : runtimeMock.state.runVersionDelayMs
+ ? Effect.sleep(runtimeMock.state.runVersionDelayMs).pipe(
+ Effect.as({ stdout: runtimeMock.state.versionStdout, stderr: "", code: 0 }),
+ )
+ : Effect.succeed({ stdout: runtimeMock.state.versionStdout, stderr: "", code: 0 }),
createOpenCodeSdkClient: (input) => {
runtimeMock.state.sdkClientInputs.push(input);