← Commit history

Publish 0.1.31

John Lauer ·d81df0feac · ·parent 604989c
5 files changed +67−12
README.md+2
@@ -114,6 +114,8 @@ Version 0.1.28 keeps Codex working when OpenAI ships a build that does not load.  Version 0.1.30 brings OpenAI's newest models to the held build. The good build bundles an older Codex engine whose model picker stops at GPT-6 Astra and GPT-5.6, so while the hold lasts the runtime fetches OpenAI's newest stable engine from npm (`@openai/codex`, checked against the registry's sha512, then run once to confirm it starts and reports its version), records it in `~/.local/state/adom/codex-integration/engine.json`, and runs it for the held build from the next editor reload: GPT-6.1 Sol becomes the default, with GPT-6.1 Terra, GPT-6 Sol and GPT-6 Luna alongside. It never swaps the engine under a running turn, rechecks npm every six hours, and drops the engine (back to the build's own) when the hold lifts. +Version 0.1.31 fixes a hold that could not come back. When VS Code reinstalled the bad build over the held one, the guard tried to put the good build back every five seconds and failed each time: its watcher had been started from an editor terminal and still carried that window's `VSCODE_IPC_HOOK_CLI`, so after a reload every `code-server --install-extension` went to a dead socket. The guard now installs with the editor's `VSCODE_*` variables removed, so the good build is back within seconds. The "This Codex build is turned off" page also gained a Reload now button: it stays off while the good build is being put back and turns on once VS Code will load it, so one click replaces the Command Palette steps.+ ### Skip the repeated IDE walkthrough  Version 0.1.23 opens new Codex editor tabs directly at the prompt. The default ships through Hydrogen’s existing Codex package dependency; it preserves sign-in and permission prompts. See [diagnosis and verification](docs/CODEX-WALKTHROUGH.md). Already-open walkthrough tabs should be closed and reopened.
package.json+1−1
@@ -4,7 +4,7 @@   "type": "app",   "title": "Codex",   "brief": "Codex in Adom Hydrogen: ecosystem setup, dock dashboard and live engineering demos.",-  "version": "0.1.30",+  "version": "0.1.31",   "description": "Codex in Adom Hydrogen with reusable CAD routing, electrical review, copper-ablation and narrated video skills, plus verified KiCad and Fusion demo progressions.",   "org": "adom",   "needs_sudo": false,
page.json+1−1
@@ -4,7 +4,7 @@   "type": "app",   "title": "Codex",   "brief": "Codex in Adom Hydrogen: ecosystem setup, dock dashboard and live engineering demos.",-  "version": "0.1.30",+  "version": "0.1.31",   "hero": {     "type": "image",     "path": "screenshots/hero.png"
runtime/guard.py+6−1
@@ -152,14 +152,19 @@ class Guard:         idle, backend = self.codex_idle()         if not idle: return  # a turn is running; try again on the next pass         code_server = shutil.which('code-server') or '/usr/lib/code-server/bin/code-server'+        # The watcher may have been started from an editor terminal and carry that window's+        # VSCODE_IPC_HOOK_CLI; after a reload the socket is dead and every install fails with+        # ECONNREFUSED (AdomLapper 2026-10-31: the bad build stayed for hours). Install directly.+        env = {k: v for k, v in os.environ.items() if not k.startswith('VSCODE_')}         result = subprocess.run([code_server, '--install-extension', f'{ID}@{good}', '--force'],-                                capture_output=True, text=True, timeout=600)+                                capture_output=True, text=True, timeout=600, env=env)         if result.returncode != 0:             self.state['last_error'] = (result.stdout + result.stderr)[-500:]             self.save()             return         # Installing an exact version pins it, which is the hold we want until a fix ships.         self.set_metadata(pinned=True, preRelease=False)+        self.state.pop('last_error', None)         self.retire_backend(backend, build.get('versions', []))         self.state.update(held=good, held_since=time.time(), held_from=version,                           channel_pre_release=bool(metadata.get('preRelease')), release_checked=0)
runtime/webview.cjs+57−9
@@ -32,27 +32,75 @@ function escape(text) {   return String(text).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c])); } +// The Codex build VS Code will load on the next reload (its extensions.json entry).+function registeredVersion() {+  try {+    const file = path.join(os.homedir(), '.local/share/code-server/extensions/extensions.json');+    const entry = JSON.parse(fs.readFileSync(file, 'utf8')).find((e) => e.identifier && e.identifier.id === 'openai.chatgpt');+    return entry ? entry.version : null;+  } catch (_) { return null; }+}++// Reload through adom-vscode (the same path Hydrogen and the AI use); this module lives+// outside the extension folder, so the vscode API is not reachable from here.+function reloadWindow() {+  const tool = [path.join(os.homedir(), '.local/bin/adom-vscode'), 'adom-vscode'].find((t) => !t.includes('/') || fs.existsSync(t));+  try {+    const child = require('child_process').spawn(tool, ['reload'], { detached: true, stdio: 'ignore' });+    child.on('error', () => {});+    child.unref();+  } catch (_) { /* the page still says how to reload by hand */ }+}+ // A known-bad build never gets to load its own UI (it freezes the whole editor).-// Show why instead; the guard has already put the last good build back on disk.-function blockedPage(version, build) {+// Show why instead, with a Reload button that turns on once the guard has put the last good+// build back (John 2026-10-31: "why didn't u put a button on here to reload automatically").+function blockedPage(version, build, nonce) {   const issue = build.issue ? `<p><a href="${escape(build.issue)}">${escape(build.issue)}</a></p>` : '';   return `<!doctype html><html><head><meta charset="utf-8">-<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'">+<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'nonce-${nonce}'"> <style>body{font:13px/1.5 system-ui,sans-serif;color:var(--vscode-foreground);padding:24px;max-width:560px}-h2{font-size:15px;margin:0 0 8px}code{font-size:12px}a{color:var(--vscode-textLink-foreground)}</style></head><body>+h2{font-size:15px;margin:0 0 8px}code{font-size:12px}a{color:var(--vscode-textLink-foreground)}+button{font:inherit;font-weight:600;padding:6px 16px;border:0;border-radius:4px;cursor:pointer;+color:var(--vscode-button-foreground);background:var(--vscode-button-background)}+button:hover:not(:disabled){background:var(--vscode-button-hoverBackground)}+button:active:not(:disabled){filter:brightness(.9)}+button:focus-visible{outline:2px solid var(--vscode-focusBorder);outline-offset:2px}+button:disabled{opacity:.55;cursor:default}#state{margin-left:10px;opacity:.8}</style></head><body> <h2>This Codex build is turned off</h2> <p>Codex ${escape(version)} has a known problem: ${escape(build.reason || 'it does not load')}.-Adom kept the last working Codex for you.</p>-<p>Reload the window to use it: <code>Ctrl+Shift+P</code>, then <b>Developer: Reload Window</b>.</p>-${issue}<p>Updates resume on their own once OpenAI ships a fixed build.</p></body></html>`;+Adom is putting the last working Codex back for you.</p>+<p><button id="reload" disabled>Reload now</button><span id="state">Getting the working Codex ready...</span></p>+<p>Or reload by hand: <code>Ctrl+Shift+P</code>, then <b>Developer: Reload Window</b>.</p>+${issue}<p>Updates resume on their own once OpenAI ships a fixed build.</p>+<script nonce="${nonce}">+const api = acquireVsCodeApi(); const b = document.getElementById('reload'); const s = document.getElementById('state');+b.addEventListener('click', () => { b.disabled = true; s.textContent = 'Reloading...'; api.postMessage({ type: 'reload' }); });+window.addEventListener('message', (e) => { if (e.data && e.data.type === 'ready') { b.disabled = false; s.textContent = 'The working Codex ' + e.data.version + ' is ready.'; } });+</script></body></html>`;+}++function showBlocked(webview, version, build, onDispose, guard) {+  const nonce = require('crypto').randomBytes(16).toString('base64');+  webview.options = Object.assign({}, webview.options, { enableScripts: true });+  webview.html = blockedPage(version, build, nonce);+  const message = webview.onDidReceiveMessage((m) => { if (m && m.type === 'reload') reloadWindow(); });+  // Ready once VS Code will load another build on reload (the guard swaps it within seconds).+  const tick = () => {+    const next = registeredVersion();+    if (next && next !== version && !badBuild(next)) webview.postMessage({ type: 'ready', version: next });+  };+  const timer = setInterval(tick, 3000);+  setTimeout(tick, 300);+  let disposed;+  disposed = onDispose(() => { clearInterval(timer); message.dispose(); disposed?.dispose(); guard.dispose(); }); }  exports.watchRenderer = function (webview, role, provider, guard, onDispose) {   const version = callerVersion();   const build = version && badBuild(version);   if (build) {-    webview.html = blockedPage(version, build);-    const disposed = onDispose(() => { disposed?.dispose(); guard.dispose(); });+    showBlocked(webview, version, build, onDispose, guard);     return;   }   // VS Code does not instantiate a restored hidden webview until it is shown.