Repository navigation
fix(opencode): leave configured server updates to their owner #23859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bf64a3a
acab721
e7ea6f5
885e478
37cedc5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -216,6 +216,7 @@ export const OpenCodeDriver: ProviderDriver< | |
| enabled, | ||
| binaryPath: expandHomePath(config.binaryPath, yield* HostProcess.HomeDirectory), | ||
| } satisfies OpenCodeSettings; | ||
| const isExternalServer = effectiveConfig.serverUrl.trim().length > 0; | ||
| const runtimeProbe = yield* makeOpenCodeRuntimeProbe( | ||
| probeOpenCodeRuntime(effectiveConfig, processEnv).pipe( | ||
| Effect.provideService(HttpClient.HttpClient, httpClient), | ||
|
|
@@ -233,10 +234,15 @@ export const OpenCodeDriver: ProviderDriver< | |
| Effect.flatMap((generation) => | ||
| Option.isNone(generation) | ||
| ? Effect.succeed(noUpdate) | ||
| : resolveProviderMaintenanceCapabilitiesEffect(openCodeUpdateFor(generation.value), { | ||
| binaryPath: effectiveConfig.binaryPath, | ||
| env: processEnv, | ||
| }), | ||
| : isExternalServer | ||
| ? // Even loopback URLs can point to another installation or a forwarded server. | ||
| resolveProviderMaintenanceCapabilitiesEffect(openCodeUpdateFor(generation.value), { | ||
| binaryPath: null, | ||
| }).pipe(Effect.provideService(HostProcess.Environment, processEnv)) | ||
|
Comment on lines
+239
to
+241
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| : resolveProviderMaintenanceCapabilitiesEffect(openCodeUpdateFor(generation.value), { | ||
| binaryPath: effectiveConfig.binaryPath, | ||
| env: processEnv, | ||
| }), | ||
| ), | ||
| Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), | ||
| Effect.provideService(FileSystem.FileSystem, fileSystem), | ||
|
|
@@ -466,7 +472,19 @@ export const OpenCodeDriver: ProviderDriver< | |
| ), | ||
| Effect.provideService(HttpClient.HttpClient, httpClient), | ||
| Effect.provideService(ProviderLatestVersions.ProviderLatestVersions, latestVersions), | ||
| Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot)), | ||
| Effect.flatMap((enrichedSnapshot) => | ||
| publishSnapshot( | ||
| isExternalServer && enrichedSnapshot.versionAdvisory?.status === "behind_latest" | ||
| ? { | ||
| ...enrichedSnapshot, | ||
| versionAdvisory: { | ||
| ...enrichedSnapshot.versionAdvisory, | ||
| message: `Version ${enrichedSnapshot.versionAdvisory.latestVersion} is out. Update the configured OpenCode server with the app or tool that started it. Restart that server when active sessions can be interrupted, then refresh provider status.`, | ||
| }, | ||
| } | ||
| : enrichedSnapshot, | ||
| ), | ||
| ), | ||
| ), | ||
| }).pipe( | ||
| Effect.mapError( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give the npm fixture a Windows executable extension.
On Windows, command resolution does not consider the extensionless
npmfixture. The lookup falls back to the seeded9.9.9version, so the advisory assertions fail. Use a platform-appropriate fixture name and adjust the mock command assertion as needed. (raw.githubusercontent.com)