Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(pi): keep session command failures structural #14235

Closedkvnloo(GitHub profile, opens in a new tab)wants to merge 10 commits intot3code/pi-provider-v1 fromrefs/pull/14235/headopened View on GitHub

Showing 5 changed files with 12 additions and 4 deletions (loading 2).

x
0 of 5 viewed, 5 left
3 additions and 1 deletionapps/server/src/provider/PiSessionCommands.test.tsModified
View file
@@ -183,7 +183,9 @@
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, harness.spawner),
Effect.flip,
- assert.include(error.message, "gh auth login");
+ assert.equal(error.message, "Pi RPC share failed: GitHub CLI sharing failed.");
+ assert.notInclude(error.message, "gh auth login");
+ assert.isDefined(error.cause);
assert.isFalse(yield* fs.exists(harness.exportPath()));
}).pipe(Effect.provide(NodeServices.layer)),
3 additions and 2 deletionsapps/server/src/provider/PiSessionCommands.tsModified
View file
@@ -68,10 +68,11 @@
}),
).pipe(Effect.timeout("60 seconds"));
if (result.code !== 0) {
+ const stderr = result.stderr.trim();
return yield* new PiRpcError({
operation: "share",
- detail:
- result.stderr.trim() || "GitHub CLI sharing failed. Run 'gh auth login' on the server.",
+ detail: "GitHub CLI sharing failed",
+ ...(stderr.length > 0 ? { cause: new Error(stderr) } : {}),
});
const match = /^https:\/\/gist\.github\.com\/(?:[^/\s]+\/)?([\da-f]+)\/?$/i.exec(