Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(providers): ~/ Binary paths work for OpenCode, Grok and Pi #29330

Openjuliusmarmingewants to merge 5 commits intomain fromrefs/pull/29330/headopened View on GitHub

Showing 4 changed files with 54 additions and 2 deletions (loading 1).

x
0 of 4 viewed, 4 left
27 additions and 0 deletionspackages/provider-grok/src/server/driver.test.tsModified
View file
@@ -172,6 +172,33 @@
});
​
+ it.effect("probes a ~/ binary path from the home directory", () => {
+ const argv: Array<string> = [];
+ return Effect.gen(function* () {
+ const path = yield* Path.Path;
+ const instance = yield* GrokDriver.create({
+ instanceId: ProviderInstanceId.make("grok-home"),
+ displayName: "Grok test",
+ enabled: true,
+ environment: [],
+ config: { ...GrokDriver.defaultConfig(), binaryPath: "~/bin/grok" },
+ }).pipe(Effect.provideService(HostProcess.HomeDirectory, "/test-home"));
+ yield* instance.snapshot.refresh;
+ // Agent launches may be wrapped in /bin/sh, so look at every argv element.
+ expect(argv).toContain(path.join("/test-home", "bin", "grok"));
+ expect(argv).not.toContain("~/bin/grok");
+ }).pipe(
+ Effect.provideService(
+ ChildProcessSpawner.ChildProcessSpawner,
+ stdoutSpawner((command, args) => {
+ argv.push(command, ...args);
+ return "grok 1.0.0\n";
+ }),
+ ),
+ Effect.scoped,
+ );
+ });