The open source coding agent.
TypeScript
fix: consume stdout concurrently with process exit in auth login (#15058)
Ayush Thakur088a81c116f3
diff --git a/packages/opencode/src/cli/cmd/auth.ts b/packages/opencode/src/cli/cmd/auth.tsindex 4a97a5e0b83..95635916413 100644--- a/packages/opencode/src/cli/cmd/auth.ts+++ b/packages/opencode/src/cli/cmd/auth.ts@@ -268,18 +268,17 @@ export const AuthLoginCommand = cmd({const proc = Process.spawn(wellknown.auth.command, {stdout: "pipe",})- const exit = await proc.exited- if (exit !== 0) {+ if (!proc.stdout) {prompts.log.error("Failed")prompts.outro("Done")return}- if (!proc.stdout) {+ const [exit, token] = await Promise.all([proc.exited, text(proc.stdout)])+ if (exit !== 0) {prompts.log.error("Failed")prompts.outro("Done")return}- const token = await text(proc.stdout)await Auth.set(args.url, {type: "wellknown",key: wellknown.auth.env,