@youdie006/prodex 0.35.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-pro.js +14 -6
- package/package.json +1 -1
package/dist/cli-pro.js
CHANGED
|
@@ -1556,15 +1556,23 @@ export async function waitForChatGptLoginReady(stderr, options, deps = {}) {
|
|
|
1556
1556
|
const startedAt = now();
|
|
1557
1557
|
stderr("login: waiting for a logged-in ChatGPT tab (finish login in the dedicated Chrome window; Ctrl+C stops waiting)...");
|
|
1558
1558
|
let lastState = "";
|
|
1559
|
-
let
|
|
1559
|
+
let openMissingTabAttempts = 0;
|
|
1560
1560
|
while (now() - startedAt < timeoutMs) {
|
|
1561
1561
|
const status = await statusFn({ port: options.port, timeoutMs: 1_500 });
|
|
1562
1562
|
// A running Chrome with no chatgpt.com tab leaves the user nothing to log
|
|
1563
|
-
// into
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1563
|
+
// into, so prodex opens one. Keep trying while the tab is still missing:
|
|
1564
|
+
// one silent attempt that fails looks exactly like no attempt, which is how
|
|
1565
|
+
// a real machine sat for a minute reporting the missing tab and ended
|
|
1566
|
+
// not-ready with nothing to go on.
|
|
1567
|
+
if (status.reachable && status.blocker?.code === "chatgpt_page_missing") {
|
|
1568
|
+
const attempt = openMissingTabAttempts + 1;
|
|
1569
|
+
openMissingTabAttempts = attempt;
|
|
1570
|
+
stderr(attempt === 1
|
|
1571
|
+
? "login: the running Chrome had no ChatGPT tab - opening a ChatGPT tab in it..."
|
|
1572
|
+
: `login: still no ChatGPT tab - opening one again (attempt ${attempt})...`);
|
|
1573
|
+
const opened = await openTabFn(options.port);
|
|
1574
|
+
if (opened === false)
|
|
1575
|
+
stderr("login: could not open a ChatGPT tab through the debug port; open https://chatgpt.com/ in that window.");
|
|
1568
1576
|
await sleepFn(pollMs);
|
|
1569
1577
|
continue;
|
|
1570
1578
|
}
|