Wait for login instructions
Check / deno (pull_request) Successful in 33s

This commit is contained in:
2026-09-14 17:05:09 +09:00
parent c637553b5f
commit 6f782c35ef
+9 -1
View File
@@ -238,9 +238,17 @@ async function codexDeviceLogin(): Promise<void> {
new WritableStream({ write: (chunk) => void (shown += chunk) }), new WritableStream({ write: (chunk) => void (shown += chunk) }),
); );
const drained = Promise.all([collect(login.stdout), collect(login.stderr)]); const drained = Promise.all([collect(login.stdout), collect(login.stderr)]);
const status = login.status;
await new Promise((resolve) => setTimeout(resolve, 3000)); await new Promise((resolve) => setTimeout(resolve, 3000));
while (shown.trim() === "") {
const exited = await Promise.race([
status.then(() => true),
new Promise<boolean>((resolve) => setTimeout(() => resolve(false), 100)),
]);
if (exited) throw new Error("AI bot login produced no instructions");
}
await postComment(shown); await postComment(shown);
await Promise.all([login.status, drained]); await Promise.all([status, drained]);
} }
async function runCodex(prompt: string): Promise<string> { async function runCodex(prompt: string): Promise<string> {