This commit is contained in:
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user