@youdie006/prodex 0.40.32 → 0.40.34
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/chatgpt-browser.js +29 -0
- package/dist/cli-pro.js +49 -1
- package/docs/releasing.md +55 -0
- package/package.json +1 -1
package/dist/chatgpt-browser.js
CHANGED
|
@@ -2477,6 +2477,30 @@ export function menuItemRectExpression(label) {
|
|
|
2477
2477
|
return { ...point, role: it.getAttribute("role"), haspopup: it.getAttribute("aria-haspopup") };
|
|
2478
2478
|
})()`;
|
|
2479
2479
|
}
|
|
2480
|
+
/**
|
|
2481
|
+
* The picker's effort view covers its model rows: measured 2026-10-19, the
|
|
2482
|
+
* menu opens on a "Pro ›" label over the slider with GPT-6 and GPT-5.6 Sol
|
|
2483
|
+
* underneath, so a click on a model row hit the slider and was refused.
|
|
2484
|
+
* Clicking the label swaps in the model list. Reports whether that is needed
|
|
2485
|
+
* and where the label is; a row that can already be clicked needs nothing.
|
|
2486
|
+
*/
|
|
2487
|
+
export function pickerModelViewToggleExpression(label) {
|
|
2488
|
+
return `(() => {${CLICK_POINT_SNIPPET}
|
|
2489
|
+
const m = document.querySelector('[data-testid="composer-intelligence-picker-content"],[role="menu"]:has([role="slider"])');
|
|
2490
|
+
if (!m) return { needed: false };
|
|
2491
|
+
const items = [...m.querySelectorAll('[role="menuitemradio"],[role="menuitem"]')];
|
|
2492
|
+
const row = items.filter((item) => item.getAttribute("role") === "menuitemradio").find(${menuLabelMatchPredicate(label)});
|
|
2493
|
+
if (!row) return { needed: false };
|
|
2494
|
+
const r = row.getBoundingClientRect();
|
|
2495
|
+
const hit = document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2);
|
|
2496
|
+
if (hit && (hit === row || row.contains(hit))) return { needed: false };
|
|
2497
|
+
const toggle = items.find((item) =>
|
|
2498
|
+
item.getAttribute("role") === "menuitem" && item.getClientRects().length > 0 &&
|
|
2499
|
+
!item.querySelector('[role="slider"]') && (item.innerText || "").trim().length > 0);
|
|
2500
|
+
if (!toggle) return { needed: true, ok: false, reason: "the model rows are covered and no view label was found" };
|
|
2501
|
+
return { needed: true, ...clickPoint(toggle) };
|
|
2502
|
+
})()`;
|
|
2503
|
+
}
|
|
2480
2504
|
export function submenuItemRectExpression(label) {
|
|
2481
2505
|
return `(() => {${CLICK_POINT_SNIPPET}
|
|
2482
2506
|
const items = [...document.querySelectorAll('[role="menuitemradio"],[role="menuitem"]')];
|
|
@@ -2860,6 +2884,11 @@ async function selectPickerModel(cdp, requested, warnings = []) {
|
|
|
2860
2884
|
}
|
|
2861
2885
|
throw new Error(hit.reason ?? `ChatGPT's model picker has no "${requested}" model.`);
|
|
2862
2886
|
}
|
|
2887
|
+
const view = await cdp.evaluate(pickerModelViewToggleExpression(requested));
|
|
2888
|
+
if (view.needed && view.ok && view.x !== undefined && view.y !== undefined) {
|
|
2889
|
+
await verifiedClickAt(cdp, view.x, view.y, "the picker's model list");
|
|
2890
|
+
await sleep(400);
|
|
2891
|
+
}
|
|
2863
2892
|
await verifiedClickWithRetry(cdp, () => cdp.evaluate(menuItemRectExpression(requested)), requested);
|
|
2864
2893
|
}
|
|
2865
2894
|
/**
|
package/dist/cli-pro.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
2
2
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { createServer as createNetServer } from "node:net";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { BrowserProcessInspectionError } from "./browser-process.js";
|
|
5
6
|
import { buildDryRunBundle } from "./bundle.js";
|
|
@@ -2464,7 +2465,54 @@ export async function assertBrowserLaunchStayedAlive(opened, timeoutMs) {
|
|
|
2464
2465
|
const detail = formatBrowserEarlyExit(outcome.earlyExit);
|
|
2465
2466
|
throw new Error(`Chrome/Chromium exited before DevTools became reachable (${detail}). Check the visible browser environment, profile lock, display access, or PRODEX_CHROME, then retry.`);
|
|
2466
2467
|
}
|
|
2467
|
-
|
|
2468
|
+
// A browser prodex cannot reach is of no use to it, and left running it
|
|
2469
|
+
// made every later attempt refuse it as wedged (measured 2026-10-19).
|
|
2470
|
+
await endLaunchedBrowser(opened.processId);
|
|
2471
|
+
if (!(await canBindLoopbackPort(opened.port))) {
|
|
2472
|
+
throw new Error(`Chrome started, but its DevTools control port ${opened.port} on 127.0.0.1 is already taken, so prodex cannot reach it. ` +
|
|
2473
|
+
`On WSL with networkingMode=mirrored, Windows reserves port ranges at boot and they apply inside WSL too ` +
|
|
2474
|
+
`(measured 2026-10-19: 9240-9339 reserved, covering 9333); list them with \`netsh interface ipv4 show excludedportrange protocol=tcp\`. ` +
|
|
2475
|
+
`Free the port (as administrator: \`net stop winnat\` then \`net start winnat\`; a Windows dynamic port range starting at 49152 keeps it from coming back), ` +
|
|
2476
|
+
`or use another port with --port or PRODEX_CDP_PORT. The browser prodex started was closed.`);
|
|
2477
|
+
}
|
|
2478
|
+
throw new Error(`Chrome/Chromium did not expose a reachable DevTools endpoint after launch. Check the visible browser environment, profile lock, display access, or PRODEX_CHROME, then retry. The browser prodex started was closed.`);
|
|
2479
|
+
}
|
|
2480
|
+
async function endLaunchedBrowser(processId) {
|
|
2481
|
+
if (!processId)
|
|
2482
|
+
return;
|
|
2483
|
+
const alive = () => {
|
|
2484
|
+
try {
|
|
2485
|
+
process.kill(processId, 0);
|
|
2486
|
+
return true;
|
|
2487
|
+
}
|
|
2488
|
+
catch {
|
|
2489
|
+
return false;
|
|
2490
|
+
}
|
|
2491
|
+
};
|
|
2492
|
+
try {
|
|
2493
|
+
process.kill(processId, "SIGTERM");
|
|
2494
|
+
}
|
|
2495
|
+
catch {
|
|
2496
|
+
return;
|
|
2497
|
+
}
|
|
2498
|
+
for (let waited = 0; waited < 5_000 && alive(); waited += 100)
|
|
2499
|
+
await sleep(100);
|
|
2500
|
+
if (alive()) {
|
|
2501
|
+
try {
|
|
2502
|
+
process.kill(processId, "SIGKILL");
|
|
2503
|
+
}
|
|
2504
|
+
catch {
|
|
2505
|
+
// Already gone.
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
/** Whether anything already holds this loopback port, a Windows reservation included. */
|
|
2510
|
+
function canBindLoopbackPort(port) {
|
|
2511
|
+
return new Promise((resolve) => {
|
|
2512
|
+
const server = createNetServer();
|
|
2513
|
+
server.once("error", () => resolve(false));
|
|
2514
|
+
server.listen(port, "127.0.0.1", () => server.close(() => resolve(true)));
|
|
2515
|
+
});
|
|
2468
2516
|
}
|
|
2469
2517
|
/** Whether a send asked for ChatGPT's Pro step, on either axis that can name it. */
|
|
2470
2518
|
export function isProSelection(selection) {
|
package/docs/releasing.md
CHANGED
|
@@ -16,6 +16,61 @@ Release target: `v0.40.13` on `main`. The GitHub Release records the resolved co
|
|
|
16
16
|
|
|
17
17
|
The release adds a guarded, opt-in transition and more accurate blocker reporting. It does not claim that headless Pro consultation is verified on either deployment target or that authentication can be retained indefinitely.
|
|
18
18
|
|
|
19
|
+
## 0.40.33 Release Record
|
|
20
|
+
|
|
21
|
+
Release commit `0497134` on `main` (cut after PR #27, merge `6083c6a`); tag `v0.40.33`.
|
|
22
|
+
|
|
23
|
+
**Publishing**
|
|
24
|
+
- `publish.yml` run 39181118204 passed all six platforms on the first attempt, then npm publish with SLSA v1 provenance and the GitHub Release (2026-10-19 00:51 UTC).
|
|
25
|
+
- `npm run release:verify` passed on the release commit after a build.
|
|
26
|
+
|
|
27
|
+
**Installed**
|
|
28
|
+
- WSL, M3, Mac mini: `prodex --version` reports 0.40.33. Running services were not restarted: 10 stdio MCP servers on WSL and 2 on M3 keep older code until their clients reconnect. The Mac mini had none running.
|
|
29
|
+
- The maintainer watchdog checkout was pulled to `0497134` and rebuilt.
|
|
30
|
+
|
|
31
|
+
**Verified live**
|
|
32
|
+
- With 0.40.33 installed, `login --virtual-display` on the affected machine printed the taken-port message for 9333 and left no Chrome running on the profile.
|
|
33
|
+
|
|
34
|
+
## Browser Incident 2026-10-18: Windows reserved port 9333
|
|
35
|
+
|
|
36
|
+
**What happened**
|
|
37
|
+
- The WSL machine restarted at 2026-10-18 18:08 KST. From 19:17 KST the hourly canary logged `skipped - the browser is not available`.
|
|
38
|
+
- The watchdog's first revive (19:17 KST) started Chrome, which loaded ChatGPT logged in but never opened its DevTools port; login reported "did not expose a reachable DevTools endpoint ... check the display, profile lock". Later revives refused the leftover Chrome as wedged (`ui_watchdog_revive=failed ... still running ... stopped answering`).
|
|
39
|
+
- The browser container was unaffected (port 9333 is inside its own network namespace).
|
|
40
|
+
|
|
41
|
+
**Cause**
|
|
42
|
+
- Windows (Hyper-V/WinNAT) reserved TCP ports 9240-9339 at boot (`netsh interface ipv4 show excludedportrange protocol=tcp`). The machine runs WSL with `networkingMode=mirrored`, so the reservation applies inside WSL, and Chrome logged `bind() failed: Address already in use` and `Cannot start http server for devtools`.
|
|
43
|
+
- The Windows TCP dynamic port range starts at 1024 (13,977 ports) instead of the default 49152, which lets these reservations land on 9333.
|
|
44
|
+
|
|
45
|
+
**Recovery and fixes**
|
|
46
|
+
- The leftover Chrome was ended with `prodex pro browser reset --confirm`. PR #27 (0.40.33) makes login close a browser whose control port never appears and name a taken port.
|
|
47
|
+
- Not changed: the Windows port settings. Bringing the host browser back needs an administrator on Windows: `net stop winnat` then `net start winnat` for now, and `netsh int ipv4 set dynamicport tcp start=49152 num=16384` (and `udp`) plus a restart to keep it from recurring. As of this record the range was still reserved and the host browser was down.
|
|
48
|
+
- Resolved 2026-10-19 11:51 KST: the maintainer ran the elevated script (`netsh int ipv4 set dynamicport tcp|udp start=49152 num=16384`, then `net stop winnat` / `net start winnat`). The 9240-9339 reservation was gone and 9333 could be bound. `login --virtual-display` was ready in 2 s; the canary reported the new ChatGPT build `bfc3a09a` as changed; the smoke answered `PRODEX_PRO_SMOKE_OK`, and a 500-line `--file` send on 0.40.33 answered correctly with the request verified.
|
|
49
|
+
|
|
50
|
+
## 0.40.32 Release Record
|
|
51
|
+
|
|
52
|
+
Release commit `e0e260e` on `main` (cut after PR #26, merge `f57f413`); tag `v0.40.32`.
|
|
53
|
+
|
|
54
|
+
**Publishing**
|
|
55
|
+
- `publish.yml` run 38339570276 passed all six platforms on the first attempt, then npm publish with SLSA v1 provenance and the GitHub Release (2026-10-13 02:59 UTC).
|
|
56
|
+
- `npm run release:verify` passed on the release commit after a build.
|
|
57
|
+
|
|
58
|
+
**Installed**
|
|
59
|
+
- WSL, M3, Mac mini: `prodex --version` reports 0.40.32. Running services were not restarted: 4 stdio MCP servers on WSL and 4 on M3 keep older code until their clients reconnect. The Mac mini had none running.
|
|
60
|
+
- The maintainer watchdog checkout was pulled to `e0e260e` and rebuilt.
|
|
61
|
+
|
|
62
|
+
**Verified live**
|
|
63
|
+
- Before the fix, installed 0.40.31 refused a 500-line (12 KB) `--file` send as `request_mismatch`; installed 0.40.32 answered it (`amber-19`).
|
|
64
|
+
- With the PR build: a 2,400-line `--file` is refused with the `--attach` pointer, and a 57 KB inline prompt answered in 84 s.
|
|
65
|
+
|
|
66
|
+
**Browser container**
|
|
67
|
+
- `container/redesign-patches` `f408fda` ports PR #26 onto the container's own transcript reader. Image `05c65e5dd1f4`; branch suite 2034 passed, 3 skipped. The swap was gated on the send lock; the ChatGPT tab opened on its own afterwards (the restart change from 2026-10-10, `42a027e`).
|
|
68
|
+
- Live in the container: the 2,400-line `--file` refusal, the 500-line `--file` answer (`amber-19`), and the smoke (`PRODEX_PRO_SMOKE_OK`).
|
|
69
|
+
|
|
70
|
+
**Also on 2026-10-11 to 10-13**
|
|
71
|
+
- `container/redesign-patches` `42a027e`: the container restarts unless stopped and opens the ChatGPT root itself. Verified by sending SIGTERM to its Chromium: Docker restarted it and the smoke answered without a login step.
|
|
72
|
+
- The canary stayed `ok` on build `314720d0` hourly from 2026-10-11 to 10-13.
|
|
73
|
+
|
|
19
74
|
## Browser Incident 2026-10-10: earlyoom
|
|
20
75
|
|
|
21
76
|
**What happened**
|