@youdie006/prodex 0.40.32 → 0.40.33

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 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
- 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.`);
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,30 @@ 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.32 Release Record
20
+
21
+ Release commit `e0e260e` on `main` (cut after PR #26, merge `f57f413`); tag `v0.40.32`.
22
+
23
+ **Publishing**
24
+ - `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).
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.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.
29
+ - The maintainer watchdog checkout was pulled to `e0e260e` and rebuilt.
30
+
31
+ **Verified live**
32
+ - 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`).
33
+ - 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.
34
+
35
+ **Browser container**
36
+ - `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`).
37
+ - Live in the container: the 2,400-line `--file` refusal, the 500-line `--file` answer (`amber-19`), and the smoke (`PRODEX_PRO_SMOKE_OK`).
38
+
39
+ **Also on 2026-10-11 to 10-13**
40
+ - `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.
41
+ - The canary stayed `ok` on build `314720d0` hourly from 2026-10-11 to 10-13.
42
+
19
43
  ## Browser Incident 2026-10-10: earlyoom
20
44
 
21
45
  **What happened**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youdie006/prodex",
3
- "version": "0.40.32",
3
+ "version": "0.40.33",
4
4
  "description": "Local receipt bus for coordinating Codex execution with ChatGPT Pro/Projects consultation.",
5
5
  "author": "youdie006",
6
6
  "license": "MIT",