Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(realtime): approve audited Codex 0.147 transport
rubenluetke10-beep5fcbeca8432e
diff --git a/docs/codex-subscription-realtime-voice.md b/docs/codex-subscription-realtime-voice.mdindex 67e3929d5c..462c21eea7 100644--- a/docs/codex-subscription-realtime-voice.md+++ b/docs/codex-subscription-realtime-voice.md@@ -1,7 +1,7 @@# ChatGPT-plan realtime voice through Codex-Status: experimental, opt-in, and pinned to Codex CLI 0.146.0-Last verified: 2026-08-02 (implementation trace, local runtime evidence, and targeted tests)+Status: experimental, opt-in, and pinned to audited Codex CLI 0.147.0/0.146.0 builds+Last verified: 2026-08-08 (tagged source/schema audit, official artifact hashes, and targeted tests)## Bottom line@@ -132,8 +132,9 @@ The active pieces and gates are:dedicated voice login does not prove `CodexBrain` CLI readiness.- `CodexSubscriptionRealtimeProvider.verify_activation()` and`CodexAppServerClient.require_chatgpt_login()` start the pinned app-server and- verify the live account. The adapter requires Codex CLI 0.146.0, the audited- binary/hash and profile layout, ChatGPT authentication, and an accepted+ verify the live account. The adapter prefers Codex CLI 0.147.0 and retains+ 0.146.0 as an exact-hash compatibility window; it also requires the audited+ profile layout, ChatGPT authentication, and an acceptedpersonal plan. Missing `aiortc`/`av`, unsupported architecture, bad profile,refused plan, or a failed media connection stops this provider honestly.- Codex v3 selects its model server-side (`model = "auto"`). The supported voice@@ -248,10 +249,11 @@ entries are rejected.At process launch Jarvis:-1. Requires the exact official Codex 0.146.0 native executable and verifies its- SHA-256. Windows uses a kill-on-close Job Object. macOS and Linux launch the- native binary behind a process-group supervisor whose parent-owned lifeline- pipe kills the group if Jarvis crashes.+1. Requires an exact official Codex 0.147.0 or 0.146.0 native executable and+ verifies its release-specific SHA-256. Windows uses a kill-on-close Job+ Object. macOS and Linux launch the native binary behind a process-group+ supervisor whose parent-owned lifeline pipe kills the group if Jarvis+ crashes.2. Forces file-backed auth and strips inherited OpenAI/API billing credentials,proxy/provider variables, and keyring-session variables.3. Supplies isolated temporary home, app-data, log, database, model-catalog,@@ -486,9 +488,10 @@ them changes the trade-off above, which is a property of the wire.printed device-code URL is the honest answer and the card should say sorather than leaving the user waiting for a window. Do not solve this byadmitting `XDG_RUNTIME_DIR` back into the forced file-store environment.-4. **The CLI version pin has a scheduled expiry.** `_TRUSTED_CODEX_TARGETS`- pins six SHA-256 hashes of `@openai/codex` 0.146.0, so any upgrade disables- subscription realtime with "does not match an official approved build".+4. **Keep the CLI version pin current.** `_TRUSTED_CODEX_TARGETS` pins the six+ SHA-256 hashes of `@openai/codex` 0.147.0; the previous audited 0.146.0 set+ remains an explicit compatibility window. Every other build is disabled+ with "does not match an official approved build".That is deliberate — but verify the pin is still current before any releaseclaiming subscription voice works, and follow the five-step upgrade policyabove when moving it.@@ -581,5 +584,6 @@ in the flight recorder; spawn steps log as `RT-SPAWN span=...` lines.## Primary sources- [Using Codex with your ChatGPT plan](https://help.openai.com/en/articles/11369540-using-codex-with-your-chatgpt-plan)-- [Codex 0.146.0 app-server protocol](https://github.com/openai/codex/blob/rust-v0.146.0/codex-rs/app-server/README.md)+- [Codex 0.147.0 app-server protocol](https://github.com/openai/codex/blob/rust-v0.147.0/codex-rs/app-server/README.md)+- [Codex 0.146.0 compatibility protocol](https://github.com/openai/codex/blob/rust-v0.146.0/codex-rs/app-server/README.md)- [OpenAI Realtime API guide](https://developers.openai.com/api/docs/guides/realtime)diff --git a/jarvis/codex_app_server.py b/jarvis/codex_app_server.pyindex 7b824953e1..deee2b369b 100644--- a/jarvis/codex_app_server.py+++ b/jarvis/codex_app_server.py@@ -57,15 +57,61 @@ _STARTUP_AUDIT_TTL_S: Final = 10.0_SHUTDOWN_TIMEOUT_S: Final = 2.0_DEFAULT_SDP_TIMEOUT_S: Final = 15.0_DEFAULT_NOTIFICATION_QUEUE_SIZE: Final = 512-_SUPPORTED_CODEX_VERSION: Final = "codex-cli 0.146.0"+_SUPPORTED_CODEX_VERSION: Final = "codex-cli 0.147.0"+_LEGACY_CODEX_VERSION: Final = "codex-cli 0.146.0"+_SUPPORTED_CODEX_VERSIONS: Final = (+ _SUPPORTED_CODEX_VERSION,+ _LEGACY_CODEX_VERSION,+)_CHILD_LIFELINE_SCRIPT: Final = str(Path(__file__).parent / "core" / "child_lifeline.py")# SHA-256 of the native executables in OpenAI's six official npm artifacts for-# @openai/codex 0.146.0. The app-server protocol used below is experimental;+# @openai/codex 0.147.0. The app-server protocol used below is experimental;# an unknown build is refused instead of assuming its safety semantics match._TRUSTED_CODEX_TARGETS: Final = {+ ("darwin", "arm64"): (+ "darwin-arm64",+ "aarch64-apple-darwin",+ "codex",+ "19c4f144c5226a9f17c58e6f0fa854843b0f77a6eb420f40e2745a12f10f5d37",+ ),+ ("darwin", "x86_64"): (+ "darwin-x64",+ "x86_64-apple-darwin",+ "codex",+ "8080a42da4cef9c4216dace512f29acfe2e526aeeec2a0ce450e5a2b18b84d8a",+ ),+ ("linux", "arm64"): (+ "linux-arm64",+ "aarch64-unknown-linux-musl",+ "codex",+ "e23d0be344d2496986c985cd3db61e6f649b1ddd900e6afc1b5aaabbffcbb4e2",+ ),+ ("linux", "x86_64"): (+ "linux-x64",+ "x86_64-unknown-linux-musl",+ "codex",+ "cb0a15567e9a60a5820d54b0f6ae86d504dc3805c1eab21a47f70e3eb7b73a40",+ ),+ ("win32", "arm64"): (+ "win32-arm64",+ "aarch64-pc-windows-msvc",+ "codex.exe",+ "1f0e8c2dd3c6b471e985fac76908366c1cf31155094fde606fb2d3052cf00584",+ ),+ ("win32", "x86_64"): (+ "win32-x64",+ "x86_64-pc-windows-msvc",+ "codex.exe",+ "935a1911ed2556e4ffcec995f4886ac2ac425863ba26fed264df62e30272ad9d",+ ),+}+# Keep the last audited protocol-compatible release available during the pin+# transition. This is a compatibility window, not a semver trust rule: each+# executable is still accepted only by its exact official artifact digest.+_LEGACY_TRUSTED_CODEX_TARGETS: Final = {("darwin", "arm64"): ("darwin-arm64","aarch64-apple-darwin",@@ -667,10 +713,10 @@ def _is_trusted_codex_runtime_binary(and os.path.normcase(str(canonical))== os.path.normcase(str(trusted)))- target = _TRUSTED_CODEX_TARGETS.get(- (sys.platform, _normalized_machine())+ return (+ _trusted_codex_target_for_digest(_sha256_file_cached(canonical))+ is not None)- return target is not None and _sha256_file_cached(canonical) == target[3]except OSError: # An unreadable binary is reported as an unavailable capability.return False@@ -1252,7 +1298,6 @@ def _verify_spawn_binary(binary_path: str) -> None:outlive the evidence that it is wrong."""path = Path(binary_path)- target = _TRUSTED_CODEX_TARGETS.get((sys.platform, _normalized_machine()))try:identity: os.stat_result | None = path.stat()except OSError: # Unreadable identity: verify anyway, just do not memoize.@@ -1264,7 +1309,7 @@ def _verify_spawn_binary(binary_path: str) -> None:# path is approved would outlive the only evidence we have._forget_cached_digest(path)raise- if target is None or digest != target[3]:+ if _trusted_codex_target_for_digest(digest) is None:_forget_cached_digest(path)raise CodexSubscriptionUnavailable("The Codex executable changed since it was verified."@@ -1304,8 +1349,34 @@ def _codex_package_roots(launcher: Path) -> list[Path]:return package_roots+def _trusted_codex_targets_for_platform() -> tuple[+ tuple[str, tuple[str, str, str, str]], ...+]:+ """Return exact audited releases for this platform, newest first."""+ key = (sys.platform, _normalized_machine())+ releases = (+ (_SUPPORTED_CODEX_VERSION, _TRUSTED_CODEX_TARGETS),+ (_LEGACY_CODEX_VERSION, _LEGACY_TRUSTED_CODEX_TARGETS),+ )+ return tuple(+ (version, target)+ for version, targets in releases+ if (target := targets.get(key)) is not None+ )+++def _trusted_codex_target_for_digest(+ digest: str,+) -> tuple[str, tuple[str, str, str, str]] | None:+ """Resolve an executable digest to its exact audited release."""+ for version, target in _trusted_codex_targets_for_platform():+ if digest == target[3]:+ return version, target+ return None++def _trusted_native_codex_binary(resolved_binary: str, version: str | None) -> str:- """Locate the SHA-256-approved native executable for the pinned release.+ """Locate a SHA-256-approved native executable for an audited release.The hash is the authority: a candidate matching an official artifact ISthe pinned build, whatever the launcher's ``--version`` said. The version@@ -1313,40 +1384,42 @@ def _trusted_native_codex_binary(resolved_binary: str, version: str | None) -> s``node`` on PATH just to print it, and a service process without node usedto fail the whole feature here although the native binary was intact."""- target = _TRUSTED_CODEX_TARGETS.get((sys.platform, _normalized_machine()))- if target is None:+ release_targets = _trusted_codex_targets_for_platform()+ if not release_targets:# A platform gate, not a setup defect: maps to lifecycle_unavailable,# whose card text says the feature is not available on this OS yet.raise CodexSubscriptionContainmentUnavailable("This operating-system architecture is not approved for the experimental ""Codex subscription voice transport.")- variant, triple, executable_name, expected_hash = targettry:launcher = Path(resolved_binary).resolve(strict=True)except OSError as exc:raise CodexSubscriptionUnavailable("The Codex CLI binary is unavailable.") from exccandidates: list[Path] = [launcher]- for package_root in _codex_package_roots(launcher):- candidates.extend(- (- package_root- / "node_modules"- / "@openai"- / f"codex-{variant}"- / "vendor"- / triple- / "bin"- / executable_name,- package_root.parent- / f"codex-{variant}"- / "vendor"- / triple- / "bin"- / executable_name,+ package_roots = _codex_package_roots(launcher)+ for _release, target in release_targets:+ variant, triple, executable_name, _expected_hash = target+ for package_root in package_roots:+ candidates.extend(+ (+ package_root+ / "node_modules"+ / "@openai"+ / f"codex-{variant}"+ / "vendor"+ / triple+ / "bin"+ / executable_name,+ package_root.parent+ / f"codex-{variant}"+ / "vendor"+ / triple+ / "bin"+ / executable_name,+ ))- )seen: set[str] = set()for candidate in candidates:@@ -1358,21 +1431,24 @@ def _trusted_native_codex_binary(resolved_binary: str, version: str | None) -> sseen.add(key)if _is_link_or_reparse(canonical) or not canonical.is_file():continue- if _sha256_file_cached(canonical) == expected_hash:+ if _trusted_codex_target_for_digest(+ _sha256_file_cached(canonical)+ ) is not None:return str(canonical)except OSError: # Unreadable installation candidates are skipped during discovery.continueif version is not None and version.startswith("codex-cli") and (- version != _SUPPORTED_CODEX_VERSION+ version not in _SUPPORTED_CODEX_VERSIONS):# The launcher answered with a real but different release — name the# required one instead of a generic hash complaint.raise CodexSubscriptionBinaryUnsupported(- "Subscription voice requires Codex CLI "- f"{_SUPPORTED_CODEX_VERSION.removeprefix('codex-cli ')}."+ "Subscription voice supports Codex CLI "+ f"{_SUPPORTED_CODEX_VERSION.removeprefix('codex-cli ')} or "+ f"{_LEGACY_CODEX_VERSION.removeprefix('codex-cli ')}.")raise CodexSubscriptionBinaryUnsupported(- "The installed Codex 0.146 executable does not match an official approved build."+ "The installed Codex executable does not match an official approved build.")@@ -1467,7 +1543,7 @@ def _displayable_cli_version(raw: str | None) -> str | None:def _read_codex_capability(binary_path: str | None) -> CodexAppServerCapability:"""Resolve the CLI; app-server itself authoritatively reads its auth store.- Discovery uses ``codex login status``, whose exact 0.146 output reports only+ Discovery uses ``codex login status``, whose audited output reports onlythe mode and never token contents or account PII. Billing authority comesonly from the live ``account/read`` RPC below."""@@ -1495,10 +1571,21 @@ def _read_codex_capability(binary_path: str | None) -> CodexAppServerCapability:resolved,version,)- # A hash match proves the pinned official build even when the npm+ # A hash match proves the exact official build even when the npm# launcher could not print its version (for example: no node on the# service PATH).- version = _SUPPORTED_CODEX_VERSION+ try:+ approved = _trusted_codex_target_for_digest(+ _sha256_file_cached(Path(resolved_binary))+ )+ except OSError:+ # Test doubles may stand in for the already-authoritative native+ # discovery helper. A real discovery result is an existing file.+ approved = None+ if approved is not None:+ version = approved[0]+ elif version not in _SUPPORTED_CODEX_VERSIONS:+ version = _SUPPORTED_CODEX_VERSIONexcept CodexSubscriptionContainmentUnavailable as exc: # Expected platform gate becomes status.return CodexAppServerCapability(available=False,@@ -1509,9 +1596,9 @@ def _read_codex_capability(binary_path: str | None) -> CodexAppServerCapability:reason_code="lifecycle_unavailable",)except CodexSubscriptionBinaryUnsupported as exc:- # The pinned release is absent (wrong version or unknown build). The+ # No audited release is present (wrong version or unknown build). The# actionable state is "install the supported release" — the card then- # shows the pinned npm command instead of a profile warning.+ # shows the preferred npm command instead of a profile warning.return CodexAppServerCapability(available=False,chatgpt_authenticated=False,@@ -4395,13 +4482,19 @@ def start_codex_subscription_login(capability = _read_codex_capability(binary_path)if not capability.available or not capability.binary_path:raise CodexSubscriptionUnavailable(capability.reason)- target = _TRUSTED_CODEX_TARGETS.get(- (sys.platform, _normalized_machine())+ approved = next(+ (+ (release, target)+ for release, target in _trusted_codex_targets_for_platform()+ if release == capability.version+ ),+ None,)- if target is None:+ if approved is None:raise CodexSubscriptionUnavailable("This platform has no approved Codex subscription runtime.")+ _release, target = approvedlock_path = _subscription_process_lock_path()from jarvis.core.private_directory import ( # noqa: PLC0415ensure_owner_only_directory,diff --git a/jarvis/ui/web/provider_spec.py b/jarvis/ui/web/provider_spec.pyindex dc7dfafc0a..923e30d4d0 100644--- a/jarvis/ui/web/provider_spec.py+++ b/jarvis/ui/web/provider_spec.py@@ -752,7 +752,7 @@ PROVIDERS: tuple[ProviderSpec, ...] = (secret_keys=(),dashboard_url=None,login_cli=("codex", "login"),- install_hint="npm i -g @openai/[email protected]",+ install_hint="npm i -g @openai/[email protected]",signup_url="https://chatgpt.com",credential_help=("Beta — subscription voice through Codex is not finished yet and "diff --git a/tests/unit/codex_app_server/test_transport.py b/tests/unit/codex_app_server/test_transport.pyindex 1808761f2d..fd64992899 100644--- a/tests/unit/codex_app_server/test_transport.py+++ b/tests/unit/codex_app_server/test_transport.py@@ -32,7 +32,6 @@ from jarvis.codex_app_server import (CodexSubscriptionUnavailable,)-# Captured before the autouse fixture stubs it out, so the dedicated test can# exercise the real pre-spawn verification._REAL_VERIFY_SPAWN_BINARY = transport._verify_spawn_binary@@ -2290,7 +2289,7 @@ async def test_realtime_start_forces_handoff_and_startup_context_boundaries(await client.close()-def test_native_codex_version_and_hash_are_both_required(+def test_native_codex_accepts_only_audited_current_or_legacy_hash(monkeypatch: pytest.MonkeyPatch,tmp_path: Path,) -> None:@@ -2310,6 +2309,18 @@ def test_native_codex_version_and_hash_are_both_required()},)+ monkeypatch.setattr(+ transport,+ "_LEGACY_TRUSTED_CODEX_TARGETS",+ {+ ("win32", "x86_64"): (+ "win32-x64",+ "x86_64-pc-windows-msvc",+ "codex.exe",+ "legacy-approved-hash",+ )+ },+ )monkeypatch.setattr(transport, "_sha256_file_cached", lambda _path: "approved-hash")@@ -2326,13 +2337,22 @@ def test_native_codex_version_and_hash_are_both_required(transport._trusted_native_codex_binary(str(binary), None)== str(binary.resolve()))+ monkeypatch.setattr(+ transport, "_sha256_file_cached", lambda _path: "legacy-approved-hash"+ )+ assert (+ transport._trusted_native_codex_binary(+ str(binary), transport._LEGACY_CODEX_VERSION+ )+ == str(binary.resolve())+ )monkeypatch.setattr(transport, "_sha256_file_cached", lambda _path: "wrong-hash")# A real-but-different release names the required version...- with pytest.raises(CodexSubscriptionUnavailable, match="requires Codex"):- transport._trusted_native_codex_binary(str(binary), "codex-cli 0.147.0")+ with pytest.raises(CodexSubscriptionUnavailable, match="supports Codex"):+ transport._trusted_native_codex_binary(str(binary), "codex-cli 0.148.0")# ...while an unknown build with the right version fails on the hash.with pytest.raises(CodexSubscriptionUnavailable, match="approved build"):transport._trusted_native_codex_binary(@@ -2359,7 +2379,7 @@ def test_wrong_release_maps_to_not_installed(def refuse(_binary: str, _version: str | None) -> str:raise transport.CodexSubscriptionBinaryUnsupported(- "Subscription voice requires Codex CLI 0.146.0."+ "Subscription voice supports Codex CLI 0.147.0 or 0.146.0.")monkeypatch.setattr(auth_module, "CodexAuthService", FakeAuthService)@@ -2369,7 +2389,7 @@ def test_wrong_release_maps_to_not_installed(assert capability.reason_code == "not_installed"assert capability.available is False- assert "requires Codex CLI 0.146.0" in capability.reason+ assert "supports Codex CLI 0.147.0 or 0.146.0" in capability.reasonassert capability.version == "codex-cli 0.150.0"@@ -2860,7 +2880,10 @@ def test_capability_survives_a_version_probe_that_prints_a_shell_error(return "codex-test"def _probe_version(self, _binary: str) -> str:- return 'Der Befehl ""node"" ist entweder falsch geschrieben oder\n' # i18n-allow: verbatim Windows shell error under test+ return (+ 'Der Befehl ""node"" ist entweder falsch ' # i18n-allow+ "geschrieben oder\n" # i18n-allow+ )def login_status(self) -> tuple[bool, str]:return True, "chatgpt"