← Commit history

Prefer Codex in the AI picker and require Hydrogen 1.0.233 for corrected delivery

John Lauer ·25953f3d40 ·29d ago ·parent cae7c63
6 files changed +19−15
adom_codex.py+7−3
@@ -1,9 +1,12 @@ #!/usr/bin/env python3-import argparse,json,os,platform,shutil,socket,subprocess,sys,time,urllib.request,urllib.error,urllib.parse+import argparse,json,os,platform,re,shutil,socket,subprocess,sys,time,urllib.request,urllib.error,urllib.parse from pathlib import Path from http.server import SimpleHTTPRequestHandler,ThreadingHTTPServer ROOT=Path(__file__).resolve().parent VERSION=json.loads((ROOT/'package.json').read_text())['version']+def version_tuple(value):+ m=re.fullmatch(r'(\d+)\.(\d+)\.(\d+)(?:[-+].*)?',str(value).strip())+ return tuple(map(int,m.groups())) if m else (0,0,0) def context():  ch=Path(os.environ.get('CODEX_HOME',Path.home()/'.codex'))  return {'app':'adom/codex','version':VERSION,'container':{'system':platform.system(),'kernel':platform.release(),'hostname':platform.node(),'cwd':os.getcwd()},'tools':{n:shutil.which(n) for n in ['codex','adom-wiki','adom-cli','adom-bridge']},'instructionsInstalled':(ch/'skills/codex-adom/SKILL.md').exists(),'hostTarget':'Not inferred; select and verify through Adom Bridge','hydrogenControlConfigured':(Path.home()/'.adom/hydrogen-control-url').exists()}@@ -26,8 +29,9 @@ class Handler(SimpleHTTPRequestHandler):   if self.command=='POST' and self.path=='/codex/ai-threads/run-prompt':    try:     status=json.load(urllib.request.urlopen(base.rstrip('/')+'/updater/status',timeout=10))-    if status.get('updater',{}).get('current_version')=='1.0.230':return self.json({'ok':False,'error':'Codex delivery is not reliable in Hydrogen 1.0.230. Copy this prompt and paste it into a verified Codex conversation; select Astra there. No prompt was sent.'},409)-    payload=json.loads(data);payload['type']='codex';payload['background']=True;data=json.dumps(payload).encode()+    current=status.get('updater',{}).get('current_version') or 'unknown'+    if version_tuple(current)<(1,0,233):return self.json({'ok':False,'error':f'Send to AI requires Hydrogen 1.0.233 or newer (found {current}). Update Hydrogen, or copy the prompt into Codex. No prompt was sent.'},409)+    payload=json.loads(data);payload.pop('type',None);payload['prefer']='codex';payload['background']=True;data=json.dumps(payload).encode()    except (ValueError,TypeError,AttributeError):return self.json({'error':'Valid JSON object required'},400)    except (OSError,urllib.error.URLError):return self.json({'error':'Cannot verify Hydrogen version; no prompt was sent.'},503)   req=urllib.request.Request(base.rstrip('/')+upstream,data=data,method=self.command,headers={'Content-Type':'application/json'})
dashboard/index.html+2−2
@@ -1,9 +1,9 @@ <!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Codex in Hydrogen</title><link rel="icon" href="/dashboard/icon.svg"><style> :root{color-scheme:dark;--bg:#0d1117;--card:#161b22;--text:#e6edf3;--muted:#8b949e;--line:#30363d;--teal:#00b8b1}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px 'Familjen Grotesk',system-ui,sans-serif}header{height:44px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;padding:0 16px}header img{width:18px;height:18px}header strong{font-size:15px}header span{color:var(--muted);font-size:13px}.spacer{flex:1}button,a{touch-action:manipulation}button{background:var(--card);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:8px 12px;cursor:pointer}button:hover,button:focus-visible{border-color:var(--teal)}main{margin:auto;padding:16px}h1{font-size:30px;margin:0 0 8px}h2{font-size:19px}p{line-height:1.6;color:var(--muted)}a{color:var(--teal)}.pills{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.pill{border:1px solid var(--line);border-radius:20px;padding:6px 12px;font-size:12px}.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}.card{padding:22px;background:var(--card);border:1px solid var(--line);border-radius:12px}.card button{margin-right:8px}video{width:100%;max-height:70vh;background:#000}dialog{width:min(1100px,95vw);background:var(--card);color:var(--text);border:1px solid var(--line);border-radius:12px}dialog::backdrop{background:#0008}pre{white-space:pre-wrap;word-break:break-word}.close{float:right}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--card);padding:12px;border:1px solid var(--teal);border-radius:8px;display:none}@media(max-width:720px){.grid{grid-template-columns:1fr}header span{display:none}main{padding:16px}}-</style><header><img src="/dashboard/icon.svg" alt=""><strong title="Codex integration">Codex</strong><span>Engineering in Hydrogen</span><div class="spacer"></div><span id="machine">Container</span><button id="help" title="Show or hide starter prompts" aria-label="Starter prompts">?</button><button id="settings" title="Integration details" aria-label="Integration details"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="m10 2 4 0 1 3 3 2 3 0 1 4-2 2-1 3 1 3-4 2-2-2-3-1-3 1-2-4 2-2 1-3-1-3 4-2z"/><circle cx="12" cy="12" r="3"/></svg></button></header><main><div id="newbie"></div><div class="pills" id="status"><span class="pill">Checking local integration</span></div><h1>Turn a prompt into working engineering.</h1><p>Orient Codex in your Adom workspace, then drive real tools through Adom Bridge.</p><div class="grid"><section class="card"><h2>Astra routes and checks a real Fusion board</h2><p>Watch Astra-calculated 45-degree routes, native vias and connected thermal pours appear in Fusion. Then reproduce the workflow on your desktop with the packaged skills.</p><button data-demo="https://wiki.adom.inc/api/pages/adom/codex/files/videos/fusion/10-bq25792-thermal-45-narrated.mp4">Watch the latest video · 3:43</button><a href="https://wiki.adom.inc/adom/codex/files/docs/REPRODUCE-FUSION.md" target="_blank">Reproduce this with Astra</a><p>Copy the first prompt into Codex and select Astra. Send to AI is paused on Hydrogen 1.0.230 because its provider routing failed our desktop test.</p></section><section class="card"><h2>Workspace setup</h2><p>The package installs an ecosystem entry point, a focused skill and a context command. Your existing instructions and credentials stay yours.</p><button id="inspect">Inspect this workspace</button><a href="https://wiki.adom.inc/adom/codex/files/docs/BOOTSTRAP.md" target="_blank">Setup guide</a></section><section class="card"><h2>Astra routes live in KiCad</h2><p>Watch traces, layer-changing vias and branched nets appear in the real editor. The captions explain the calculation and the measured results.</p><button data-demo="01-astra-live-routing-3x.mp4">6-net demo · 23 sec</button><button data-demo="02-astra-crossbar-24-3x.mp4">24-net demo · 31 sec</button></section><section class="card"><h2>Real-board comparisons</h2><p>Watch a public Adom board go from the human reference to zero traces and independently calculated routing, with narrated explanations and measured KiCad results.</p><button data-demo="04-public-adom-solenoid-full-routing-narrated.mp4">Public board · narrated · 82 sec</button><a href="https://wiki.adom.inc/adom/codex/files/docs/ASTRA-KICAD.md" target="_blank">Read the engineering log</a></section><section class="card"><h2>Codex Desktop</h2><p>Planned: verified desktop installation and a Bridge connection between Hydrogen and Codex Desktop. Desktop controls are not installed by this version.</p><a href="https://wiki.adom.inc/adom/codex/files/docs/DESKTOP-BRIDGE.md" target="_blank">Integration roadmap</a></section></div></main><dialog id="player"><button class="close" id="close-video" title="Close video">Close</button><h2>Astra engineering demonstrations</h2><video id="video" controls playsinline></video></dialog><dialog id="details"><button class="close" id="close-details">Close</button><h2>Local integration</h2><pre id="context"></pre></dialog><div id="toast" role="status"></div><script src="/dashboard/vendor/newbie-panel.js"></script><script>+</style><header><img src="/dashboard/icon.svg" alt=""><strong title="Codex integration">Codex</strong><span>Engineering in Hydrogen</span><div class="spacer"></div><span id="machine">Container</span><button id="help" title="Show or hide starter prompts" aria-label="Starter prompts">?</button><button id="settings" title="Integration details" aria-label="Integration details"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="m10 2 4 0 1 3 3 2 3 0 1 4-2 2-1 3 1 3-4 2-2-2-3-1-3 1-2-4 2-2 1-3-1-3 4-2z"/><circle cx="12" cy="12" r="3"/></svg></button></header><main><div id="newbie"></div><div class="pills" id="status"><span class="pill">Checking local integration</span></div><h1>Turn a prompt into working engineering.</h1><p>Orient Codex in your Adom workspace, then drive real tools through Adom Bridge.</p><div class="grid"><section class="card"><h2>Astra routes and checks a real Fusion board</h2><p>Watch Astra-calculated 45-degree routes, native vias and connected thermal pours appear in Fusion. Then reproduce the workflow on your desktop with the packaged skills.</p><button data-demo="https://wiki.adom.inc/api/pages/adom/codex/files/videos/fusion/10-bq25792-thermal-45-narrated.mp4">Watch the latest video · 3:43</button><a href="https://wiki.adom.inc/adom/codex/files/docs/REPRODUCE-FUSION.md" target="_blank">Reproduce this with Astra</a><p>Send to AI requires Hydrogen 1.0.233+. The picker defaults to Codex; you can choose another AI. Select Astra in Codex for fresh routing.</p></section><section class="card"><h2>Workspace setup</h2><p>The package installs an ecosystem entry point, a focused skill and a context command. Your existing instructions and credentials stay yours.</p><button id="inspect">Inspect this workspace</button><a href="https://wiki.adom.inc/adom/codex/files/docs/BOOTSTRAP.md" target="_blank">Setup guide</a></section><section class="card"><h2>Astra routes live in KiCad</h2><p>Watch traces, layer-changing vias and branched nets appear in the real editor. The captions explain the calculation and the measured results.</p><button data-demo="01-astra-live-routing-3x.mp4">6-net demo · 23 sec</button><button data-demo="02-astra-crossbar-24-3x.mp4">24-net demo · 31 sec</button></section><section class="card"><h2>Real-board comparisons</h2><p>Watch a public Adom board go from the human reference to zero traces and independently calculated routing, with narrated explanations and measured KiCad results.</p><button data-demo="04-public-adom-solenoid-full-routing-narrated.mp4">Public board · narrated · 82 sec</button><a href="https://wiki.adom.inc/adom/codex/files/docs/ASTRA-KICAD.md" target="_blank">Read the engineering log</a></section><section class="card"><h2>Codex Desktop</h2><p>Planned: verified desktop installation and a Bridge connection between Hydrogen and Codex Desktop. Desktop controls are not installed by this version.</p><a href="https://wiki.adom.inc/adom/codex/files/docs/DESKTOP-BRIDGE.md" target="_blank">Integration roadmap</a></section></div></main><dialog id="player"><button class="close" id="close-video" title="Close video">Close</button><h2>Astra engineering demonstrations</h2><video id="video" controls playsinline></video></dialog><dialog id="details"><button class="close" id="close-details">Close</button><h2>Local integration</h2><pre id="context"></pre></dialog><div id="toast" role="status"></div><script src="/dashboard/vendor/newbie-panel.js"></script><script> const $=s=>document.querySelector(s);function toast(s){$('#toast').textContent=s;$('#toast').style.display='block';setTimeout(()=>$('#toast').style.display='none',4000)} function play(file){document.querySelector('.anp-video')?.pause();$('#video').src=file.startsWith('https://')?file:'/videos/'+file;$('#player').showModal();$('#video').play().catch(()=>toast('Press Play to start the video.'))}-const panel=AdomNewbiePanel.mount({mount:'#newbie',apiBase:'/codex',app:'codex',appName:'Codex',slug:'codex',toggleButton:'#help',demo:{label:'Play the Fusion demo',meta:'3:43 · narrated · Astra in Fusion',video:{src:'https://wiki.adom.inc/api/pages/adom/codex/files/videos/fusion/10-bq25792-thermal-45-narrated.mp4',poster:'/dashboard/fusion-demo-poster.jpg',title:'Astra routes a Fusion board with connected thermal copper'}},phrases:["Codex Astra, reproduce this Fusion demo",'Codex, inspect this workspace','Codex, review my PCB thermal paths']});+const panel=AdomNewbiePanel.mount({mount:'#newbie',apiBase:'/codex',app:'codex',appName:'Codex',ai:'codex',slug:'codex',toggleButton:'#help',demo:{label:'Play the Fusion demo',meta:'3:43 · narrated · Astra in Fusion',video:{src:'https://wiki.adom.inc/api/pages/adom/codex/files/videos/fusion/10-bq25792-thermal-45-narrated.mp4',poster:'/dashboard/fusion-demo-poster.jpg',title:'Astra routes a Fusion board with connected thermal copper'}},phrases:["Codex Astra, reproduce this Fusion demo",'Codex, inspect this workspace','Codex, review my PCB thermal paths']}); async function inspect(){try{const r=await fetch('/api/status');if(!r.ok)throw Error('Context unavailable');const s=await r.json();$('#context').textContent=JSON.stringify(s,null,2);$('#details').showModal()}catch(e){toast(e.message)}} $('#inspect').onclick=inspect;$('#settings').onclick=inspect;$('#close-details').onclick=()=>$('#details').close();$('#close-video').onclick=()=>$('#player').close();$('#player').addEventListener('close',()=>$('#video').pause());document.querySelectorAll('[data-demo]').forEach(b=>b.onclick=()=>play(b.dataset.demo)); function status(s){$('#machine').textContent=s.container.hostname;$('#status').replaceChildren(...['Entry point: '+(s.instructionsInstalled?'installed':'not installed'),'Bridge CLI: '+(s.tools['adom-bridge']?'available':'missing'),'Host target: select in Bridge'].map(t=>{let e=document.createElement('span');e.className='pill';e.textContent=t;return e}))}
dashboard/vendor/newbie-panel.js+4−4
@@ -257,7 +257,7 @@       })       .catch(function () { return { ok: true, version: null, open: true }; });   }-  function send(base, phrase, appName, slug, onProgress) {+  function send(base, phrase, appName, slug, onProgress, ai) {     return gate(base).then(function (g) {       if (!g.ok) throw new Error('Adom needs updating to send prompts (found ' + g.version + ', needs 1.0.142). Run: adom update');       var ctl = new AbortController(), timer = setTimeout(function () { ctl.abort(); }, 120000);@@ -267,7 +267,7 @@         method: 'POST', signal: ctl.signal,         headers: { 'content-type': 'application/json' },         body: JSON.stringify({-          "new": true, prompt: phrase, submit: true,+          "new": true, prompt: phrase, submit: true, prefer: ai || undefined,           name: appName + ' - say it', tags: ['dock:' + slug]         })       }).then(function (r) { return r.json().then(function (j) { return { status: r.status, j: j }; }); })@@ -409,7 +409,7 @@         send(base, phrase, appName, slug, function (state, job) {           if (PHASE[state]) pending.setText(PHASE[state]);           if (typeof cfg.onProgress === 'function') { try { cfg.onProgress(state, job); } catch (e) {} }-        }).then(function (r) {+        }, cfg.ai).then(function (r) {           pending.remove();           if (r.state === 'delivered') toast('Sent. Your AI thread has the prompt.', 'ok');           else toast('Thread opened, delivery not confirmed. Check your AI threads before sending again.', 'info', 8000);@@ -733,6 +733,6 @@   }    root.AdomNewbiePanel = { mount: mount, toast: toast, selfCheck: selfCheck, copyText: copyText,-                           checkSend: checkSend, version: '2.23.0',+                           checkSend: checkSend, version: '2.24.0',                            TWO_COL_MIN: TWO_COL_MIN, PHRASE_BUDGET: PHRASE_BUDGET }; })(typeof window !== 'undefined' ? window : this);
docs/REPRODUCE-FUSION.md+3−3
@@ -1,6 +1,6 @@ # Reproduce the Fusion + Astra demonstration -Start with the latest Adom Hydrogen build for your release channel. Check Settings → updates and compare the running and latest versions; apply an available update before testing prompt delivery. Install or update `adom/codex` (`adom-wiki pkg install adom/codex`) and open **Codex** from the dock. The first starter prompt is **Codex Astra, reproduce this Fusion demo**. Copy the first prompt into a verified Codex conversation. On Hydrogen 1.0.230, our CRR test found that **Send to AI** could report Codex while delivering to Claude; the dashboard blocks that affected build before submitting. Do not rely on that button until provider delivery is verified on your build. Confirm Astra in Codex’s model selector before asking for fresh routing. A model subscription/login, Fusion installation and a connected Adom Bridge are required; the package does not supply those accounts.+Start with the latest Adom Hydrogen build for your release channel. Check Settings → updates and compare the running and latest versions; apply an available update before testing prompt delivery. Install or update `adom/codex` (`adom-wiki pkg install adom/codex`) and open **Codex** from the dock. The first starter prompt is **Codex Astra, reproduce this Fusion demo**. Use **Send to AI** on Hydrogen **1.0.233 or newer**. The picker defaults to Codex for Enter or the countdown, while letting you select another AI. The dashboard blocks older builds before sending; update Hydrogen or copy the prompt into a verified Codex conversation. Confirm Astra in Codex’s model selector before asking for fresh routing. A model subscription/login, Fusion installation and a connected Adom Bridge are required; the package does not supply those accounts.  The assistant should read this guide and the installed electrical-routing, ablation-routing and routing-video skills. Discover your desktop and bridge capabilities; never reuse CRR, another user's relay, HWND or document IDs. Preserve any pinned development bridge. Find the public `adom/bq25792-charger` reference and work on a new copy. The source/replay evidence lives on `adom/fusion-bridge`, branch `feature/per-net-trace-routing`, under `demo/routing/bq25792/thermal/`. @@ -17,8 +17,8 @@ Expected historical result for comparison: 576 segments, 89 vias, eight pours, n  ## Prompt delivery checks -The dashboard vendors the shared Adom newbie panel. Its version check and asynchronous send/status calls pass through the dashboard to the current host control API. A queued job is not delivery: wait for the reported delivery state and verify the prompt in the new thread. If a call times out, inspect the thread/job before retrying. Never overwrite another draft. The Codex dashboard uses a dedicated adapter that adds `type:codex` and `background:true`, leaving the shared newbie panel unchanged. The generic proxy passes bodies and responses unchanged; the dedicated adapter changes only the outgoing provider request and preserves the upstream response. Astra still needs to be selected in Codex’s model selector; changing prompt wording does not change the model.+The dashboard vendors the shared Adom newbie panel. Its version check and asynchronous send/status calls pass through the dashboard to the current host control API. A queued job is not delivery: wait for the reported delivery state and verify the prompt in the new thread. If a call times out, inspect the thread/job before retrying. Never overwrite another draft. The Codex dashboard uses a dedicated adapter that drops any incoming `type` and adds `prefer:codex` and `background:true`. The shared panel receives `ai:codex` and sends `prefer` itself. The generic proxy passes bodies and responses unchanged; the dedicated adapter changes only the outgoing provider request and preserves the upstream response. Astra still needs to be selected in Codex’s model selector; changing prompt wording does not change the model.  ## Desktop verification, September 6, 2026 -CRR was updated to the latest available insider build, Hydrogen 1.0.230. The native dock launch and shared panel checks passed. Provider delivery did not: both picker selection and explicit Codex requests reached Claude, including a response that reported Codex. This is an unresolved integration defect, not successful Codex/Astra reproduction. The affected send is blocked before submission; the copy button and video remain available. A newer build still needs actual conversation verification.+CRR was updated to the latest available insider build, Hydrogen 1.0.230. The native dock launch and shared panel checks passed. Provider delivery did not: both picker selection and explicit Codex requests reached Claude, including a response that reported Codex. Hydrogen 1.0.232 corrected background-job intent scope, and 1.0.233 corrected Codex selection entering the Claude fast path. Codex package 0.1.16 now requires at least 1.0.233 and preserves the AI picker with Codex as its preferred default. The earlier 1.0.230 run remains failed evidence; it is not retroactively a successful test.
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.15",+  "version": "0.1.16",   "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+2−2
@@ -4,7 +4,7 @@   "type": "app",   "title": "Codex",   "brief": "Codex in Adom Hydrogen: ecosystem setup, dock dashboard and live engineering demos.",-  "version": "0.1.15",+  "version": "0.1.16",   "hero": {     "type": "image",     "path": "screenshots/hero.png"@@ -95,4 +95,4 @@     "videos/04-public-adom-solenoid-full-routing-narrated.mp4",     "videos/04-public-adom-solenoid-full-routing.mp4"   ]-}\ No newline at end of file+}