← Commit history
Publish 0.1.38
4 files changed
+36−8
README.md+2@@ -126,6 +126,8 @@ Version 0.1.36 replaces a Codex backend that nobody can reach. The engine keeps Version 0.1.37 makes Adom's own Codex hooks arrive trusted. Codex runs a hook from `~/.codex/hooks.json` only after the user trusts it under "Review hooks", and again after its entry changes, so the adom/hook update check, `claude-rc hook`, `adom-wiki discover suggest --hook` and Hydrogen's session hooks (`~/.adom/hd-ai-threads-hook.sh`) did nothing until each was trusted by hand. When a Codex view connects, the runtime asks the running backend for its hook list (`hooks/list`) and saves trust for Adom's hooks the way the Trust button does (`config/batchWrite`), so Codex computes each hook's key and hash itself. It trusts only exact commands from Adom's list (the hooks Adom installs, plus any an installer adds to `~/.adom/codex-trusted-hooks.json`, a JSON array of exact commands), only in the user's own `~/.codex/hooks.json` (never a project's `.codex/hooks.json`), only hooks that are untrusted or modified, and never one the user switched off. It runs again whenever `hooks.json` changes, which also heals a hook whose position moved. If the backend refuses (the protocol is experimental), Codex keeps asking as before. Each outcome is one line in `hook-trust.log` in the runtime's state folder, and `--runtime-status` shows the last one. +Version 0.1.38 takes over the rest of Codex's configuration from Hydrogen. The same step that trusts Adom's hooks now lets Codex's sandbox reach localhost (`sandbox_workspace_write.network_access = true`, so `adom-bridge` and `adom-cli` work inside the sandbox), written through the backend and only when no one has set that key, so a user or an admin who turned it off keeps it off. Hydrogen used to write both into `config.toml` by hand; it now only lists its own hook commands in `~/.adom/codex-trusted-hooks.json`. Also fixed: on a machine with several Codex builds on disk, starting the runtime outside the extension (with `ADOM_CODEX_NATIVE`) failed right after the backend started, leaving that backend running. The runtime tests pass against a real Codex 0.169 (`ADOM_CODEX_NATIVE=<codex binary> python3 -m unittest tests.test_runtime`), and the real-Codex test is skipped, with the reason, where no Codex is installed.+ Version 0.1.35 gives OpenAI's newest models to fresh installs too. The newest-engine swap from 0.1.30 only ran while a hold was active, which needs the bad build to have arrived first. A workspace that started on the good build (the Hydrogen golden image ships it) was never held, so its Codex kept the build's own older engine and the model picker stopped at GPT-6 Astra. The guard now fetches the newest engine whenever Codex is on the listed fallback build, held or not; reload the editor once and GPT-6.1 Sol is the default. ### Skip the repeated IDE walkthrough
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.37",+ "version": "0.1.38", "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.37",+ "version": "0.1.38", "hero": { "type": "image", "path": "screenshots/hero.png"
runtime/runtime.py+32−6@@ -343,8 +343,13 @@ def ensure_server(binary, args, client_guard=None): stdin=subprocess.DEVNULL, stdout=output, stderr=output, start_new_session=True, close_fds=True, )+ # Which extension started it. Only a record: with several Codex builds on disk and the+ # extension's own bin directory not on PATH (ADOM_CODEX_NATIVE, a test), bundled_binary()+ # refuses to pick one, and that refusal used to end the start with the backend running.+ try: shipped = extension_version(bundled_binary())+ except RuntimeError: shipped = extension_version(binary) metadata = {'pid': process.pid, 'binary': str(binary), 'identity': identity(binary), 'args': args,- 'extension': '.'.join(map(str, extension_version(bundled_binary()) or ())) or None,+ 'extension': '.'.join(map(str, shipped or ())) or None, 'protocolFingerprint': protocol, 'socket': str(sock), 'started_at': time.time(), 'start_ticks': Path(f'/proc/{process.pid}/stat').read_text()@@ -419,8 +424,23 @@ def hooks_to_trust(hooks, allowed, user_file): return value +NETWORK_KEY = 'sandbox_workspace_write.network_access'+++def sandbox_network_edit(origins):+ """Pure: the edit that lets Codex's sandbox reach localhost, or None when anyone (the user,+ an admin layer, a profile) has set the key already. adom-bridge and adom-cli talk to local+ relays; with networking off every call failed 'Operation not permitted' and Codex asked to+ run each one outside the sandbox (Saif's review, 2026-10-09). Hydrogen wrote this into+ config.toml by hand until 0.1.38; it lives here now, written through the backend."""+ if NETWORK_KEY in (origins or {}): return None+ return {'keyPath': NETWORK_KEY, 'mergeStrategy': 'replace', 'value': True}++ def trust_adom_hooks(sock, allowed):- """Trust Adom's own hooks through the running backend. Returns the commands trusted."""+ """Trust Adom's own hooks through the running backend, and let its sandbox reach localhost+ unless that is set already. Returns the commands trusted (plus 'sandbox network access'+ when that was set).""" with unix_connect(str(sock), compression=None, max_size=None, open_timeout=5, close_timeout=1) as connection: request_id = 0@@ -441,10 +461,16 @@ def trust_adom_hooks(sock, allowed): listed = rpc('hooks/list', {'cwds': [str(Path.home())]}) hooks = [hook for entry in listed.get('data', []) for hook in entry.get('hooks', [])] value = hooks_to_trust(hooks, allowed, codex_home() / 'hooks.json')- if not value: return []- rpc('config/batchWrite', {'edits': [{'keyPath': 'hooks.state', 'mergeStrategy': 'upsert',- 'value': value}], 'reloadUserConfig': True})- return sorted({hook['command'] for hook in hooks if hook.get('key') in value})+ edits = [{'keyPath': 'hooks.state', 'mergeStrategy': 'upsert', 'value': value}] if value else []+ try:+ network = sandbox_network_edit(rpc('config/read', {'includeLayers': False}).get('origins'))+ except RuntimeError:+ network = None # cannot tell who set it: leave it alone+ if network: edits.append(network)+ if not edits: return []+ rpc('config/batchWrite', {'edits': edits, 'reloadUserConfig': True})+ done = sorted({hook['command'] for hook in hooks if hook.get('key') in value})+ return done + (['sandbox network access'] if network else []) def maybe_trust_hooks(sock, directory, now=time.time):