Skip to content

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.

docs: record the subscription-realtime action trade-off and parity roadmap

rubenluetke10-beepac1b9b5cef5b
diff --git a/docs/codex-subscription-realtime-voice.md b/docs/codex-subscription-realtime-voice.md
index 0af6f40894..e533a63f6d 100644
--- a/docs/codex-subscription-realtime-voice.md
+++ b/docs/codex-subscription-realtime-voice.md
@@ -373,11 +373,79 @@ correct multi-part response boundaries, trusted direct-speech clearance, and
rebuild on media-track death. Thirty targeted unit tests covering these
contracts passed on 2026-08-02.
-No runtime code was changed during this assessment. A follow-up fix should stay
-bounded to the remaining evidence: align browser readiness with the provider's
-declared handshake budget and add browser startup pre-roll; log outgoing WebRTC
-mic queue drops; and, if choppiness persists, capture the provider PCM timing
-diagnostics before changing the shared AudioPlayer or TTS stack.
+No runtime code was changed during this assessment.
+
+### Follow-up landed 2026-08-03
+
+The bounded follow-up named above is done, together with the OS-parity defects
+recorded in [`os-parity.md`](os-parity.md) under the same date. Remaining work
+and foreseeable failure modes are in "Parity roadmap" at the end of this file.
+
+- **Browser readiness follows the declared budget.** `GET /api/settings/voice-mode`
+ now returns `handshake_budget_s` from `realtime_handshake_budget_s(cfg)` — a
+ capability read across eligible providers, never a provider id — and the
+ browser client's start timeout is `max(20 s, declared)`. The 20 s floor keeps
+ an older backend behaving exactly as before.
+- **Browser startup pre-roll.** `RealtimeAudioClient` retains captured PCM
+ while the transport negotiates and replays it in order once the socket
+ accepts audio, bounded to 30 s (the desktop `_SessionInputBuffer` window).
+ Previously the whole opening sentence of a cold subscription call was
+ discarded, and this transport never asks the user to repeat.
+- **Outgoing WebRTC drops are logged.** `RealtimeWebRtcAudioEndpoint.send_pcm`
+ reports dropped microphone frames on the same bounded schedule the receive
+ side already used, so deleted user speech stops reading as a healthy call.
+- **A handoff can no longer end a call.** See the trade-off section below.
+
+Still open, and deliberately not addressed here: if choppiness persists,
+capture the provider PCM timing diagnostics before changing the shared
+AudioPlayer or TTS stack.
+
+## Action parity with API-key realtime — the standing trade-off
+
+**Accepted trade-off, not a defect to be fixed later.** The app-server realtime
+RPC surface is `start / appendAudio / appendText / appendSpeech / stop`, and it
+refuses custom fields outright. There is no `session.update`, so this transport
+**cannot be given a tool declaration at all**. `supports_direct_tools = False`
+is a statement about the wire, not a policy choice, and no amount of work on
+the Jarvis side turns it into native function calling. Anyone comparing the two
+paths should read this section before filing "subscription voice can't do X".
+
+What that costs, and what replaces it:
+
+| | API-key realtime | ChatGPT-subscription realtime |
+|---|---|---|
+| How an action starts | native function call | `handoff_request` item |
+| Who executes it | `ToolExecutor` via `RealtimeToolBridge` | `ToolExecutor` via the deterministic Jarvis delegate |
+| Reachable actions | the full registry | the full registry |
+| Result delivery | `function_call_output`, model re-renders | `appendSpeech`, verbatim + scrubbed |
+| Extra latency | none | one supervisor brain turn |
+| Who is billed for the action | the realtime credential | the delegate brain's credential |
+
+**Actions themselves are at parity.** The handoff lands in the same
+`ToolExecutor` behind the same risk tiers, so everything the API path can do
+the subscription path can do — including the actions that ultimately execute in
+JavaScript: the frontend-dispatched UI actions (`NavigateSidebar` and the
+Agentic-IDE events consumed in `hooks/useWebSocket.ts`), the `app_command`
+tools that drive the app's own REST routes, and the Node-based tools such as
+`plugins/tool/calendar_bot.mjs`. None of them are declared to the realtime
+model on either path — the model asks, Jarvis executes — which is exactly why
+the handoff substitution preserves them.
+
+Three consequences worth knowing (the roadmap at the end of this file tracks
+what is still open about them):
+
+1. **The model chooses when to yield.** On the API path the model emits a
+ function call; here it must emit a handoff. `_THREAD_BASE_INSTRUCTIONS`
+ tells it to, but a model that answers from its own knowledge instead of
+ handing off is a prompt-level miss with no transport-level backstop.
+2. **The action is billed elsewhere.** The voice rides the ChatGPT plan; the
+ delegate turn spends whatever the brain chain resolves to. When that chain
+ is also `codex` on the same plan, one 429 silences both — the AP-22 warning
+ in `realtime/factory.py` now covers exactly that case.
+3. **A missing delegate costs the action, not the call.** If no deterministic
+ delegate is available, `_decline_provider_handoff` speaks the localized
+ `actions_unavailable` line and the conversation continues. It used to end
+ the call outright.
## Upgrade policy
@@ -393,6 +461,81 @@ For every supported upgrade:
5. Update the user-facing experimental warning if OpenAI changes plan or
connected-Voice accounting.
+## Parity roadmap
+
+Ordered. Each step keeps this path equivalent to API-key realtime; none of
+them changes the trade-off above, which is a property of the wire.
+
+1. **Make the handoff obligation observable.** The model deciding *not* to
+ hand off is the only silent action failure left here. Count handoffs per
+ call alongside delegate dispatches and emit one bounded log line when a
+ call produces user turns that a `realtime_tool_mode = "direct"` API session
+ would have turned into tool calls. That converts a prompt regression from
+ "users say it got lazy" into a number. Do **not** add local intent
+ detection that starts actions the model never requested — considered and
+ rejected as too willing to act.
+2. **Pin the substitution with a contract test.**
+ `tests/contract/test_realtime_provider_contract.py` asserts the capability
+ flags but not the behaviour behind them. Add: every installed provider with
+ `supports_direct_tools = False` must resolve to a delegate-backed action
+ path when a callable brain exists, and must decline rather than fail when
+ it does not. This is what stops a future refactor from quietly restoring
+ the terminal failure.
+3. **Wayland-only browser hand-off.** Establish whether `codex` can open a
+ browser on a pure-Wayland session without XWayland. If it cannot, the
+ printed device-code URL is the honest answer and the card should say so
+ rather than leaving the user waiting for a window. Do not solve this by
+ admitting `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".
+ That is deliberate — but verify the pin is still current before any release
+ claiming subscription voice works, and follow the five-step upgrade policy
+ above when moving it.
+5. **Retire or wire the dormant browser-offer stack.** No shipped provider
+ sets `requires_webrtc_offer = True` since Jarvis took the WebRTC peer
+ in-process, so `realtime/offer_broker.py`, `/ws/realtime-transport`,
+ `lib/realtimeTransportBroker.ts`, `SubscriptionRealtimeTransportBroker.tsx`
+ and the desktop broker-token plumbing are unreachable in production. Either
+ delete them or mark them as a deliberately retained seam.
+6. **Reconcile `busy` between the probe and the card.**
+ `external_login_ready()` fails **open** on a transient `busy` probe, while
+ `_codex_subscription_status_payload` reports the same `busy` as
+ `connected: false`. So `/voice-mode` can say `realtime_available: true`
+ while the card says "not connected" and `PUT /voice-mode` answers 409. Both
+ halves are individually right; the contradiction the user sees is not.
+
+### Failure modes and where to look first
+
+| Signal | Likely cause | First check |
+|---|---|---|
+| Voice answers, nothing ever happens | the model stopped handing off, or the delegate brain lost its credential | step 1's counter; then the AP-22 warning |
+| "Actions unavailable" on every turn | no callable brain reached the session | the one-shot constructor warning in `realtime/session.py` |
+| Cold calls fail in the browser, work on desktop | `handshake_budget_s` is not reaching the surface | `GET /api/settings/voice-mode` |
+| The first sentence of a call is ignored | the 30 s startup pre-roll was exceeded | the WebRTC send-queue drop warnings |
+| Connect does nothing on Linux | no supported terminal emulator | the card's `lifecycle_unavailable` reason |
+| Card says connected, actions say "Codex CLI not found" | stale PATH in a GUI-launched app | that both sites use `CodexAuthService._resolve_binary` |
+| Permanent "busy" after a crash | the guardian still holds the profile lock | that POSIX process-tree containment engaged |
+| Everything breaks after a Codex update | the SHA-256 pin | step 4 |
+
+### Verifying a change to this surface
+
+```bash
+pytest tests/unit/realtime tests/contract/test_realtime_provider_contract.py \
+ tests/unit/codex_app_server tests/unit/test_codex_auth.py \
+ tests/unit/test_codex_login_guard.py tests/unit/web/test_voice_mode_route.py \
+ tests/unit/browser_voice -q
+
+# jarvis/ui/web/frontend/
+npx tsc -b && npx vitest run
+```
+
+End to end, on each OS: connect the subscription card, start a call, ask a
+question, then ask for something that requires an action ("open the settings
+view") and confirm the UI reacts — that is the JavaScript-executed action path
+running through a handoff. Then remove the delegate brain and repeat: the
+assistant must say it cannot run actions and **stay on the call**.
+
## Primary sources
- [Using Codex with your ChatGPT plan](https://help.openai.com/en/articles/11369540-using-codex-with-your-chatgpt-plan)
diff --git a/docs/os-parity.md b/docs/os-parity.md
index a1ef18d3d7..bed85af2ad 100644
--- a/docs/os-parity.md
+++ b/docs/os-parity.md
@@ -28,6 +28,41 @@ remaining GTK source gap; reveal/open actions remain available on Linux.
uses a parent-lifeline process-group supervisor on macOS and Linux, while
Windows retains kernel Job Object containment.
+**Fix pass 2026-08-03 (subscription realtime voice).** Four defects of the
+same shape as P-29 — the feature was reachable only on the maintainer's OS:
+
+- **Linux login terminals.** The visible `codex login` accepted exactly
+ `gnome-terminal`, `konsole` and literal `xterm`, so XFCE, MATE, Cinnamon and
+ anyone on kitty/alacritty/foot/wezterm could not connect subscription voice
+ AT ALL — while the Providers card still offered an enabled Connect button.
+ `jarvis/codex_auth.py::_LINUX_LOGIN_TERMINALS` now carries fourteen entries
+ with their documented foreground/no-fork forms, and
+ `linux_login_terminal_available()` is the pre-click capability probe so a
+ desktop that genuinely has none reports `lifecycle_unavailable` with an
+ actionable reason instead of an error toast after the click.
+- **Linux browser hand-off.** Windows (ShellExecute) and macOS (`open`) opened
+ the OAuth page themselves; the Linux login child was handed an environment
+ with no `DISPLAY`/`WAYLAND_DISPLAY`/`XAUTHORITY`, so the user had to copy a
+ device-code URL out of the terminal. Those session handles now reach the
+ child through both allowlists. Deliberately partial: the forced file
+ credential store still strips `DBUS_SESSION_BUS_ADDRESS` and
+ `XDG_RUNTIME_DIR`, so a pure-Wayland session without XWayland keeps the
+ printed URL — the keyring-isolation guarantee outranks the convenience.
+- **POSIX login containment.** Process-tree containment for the login guardian
+ was Windows-only, so a Jarvis crash on macOS/Linux left terminal → guardian
+ → `codex login` alive with the profile lock still held and every later
+ connect reporting a permanent "busy". `make_process_tree` already returns a
+ real POSIX process-group reaper; the login path now uses it, and only the
+ Windows breakaway flag remains Windows-shaped.
+- **POSIX delegate cleanup + macOS PATH.** The Codex CLI that executes
+ subscription-voice actions was tree-killed only on Windows (`taskkill /T`),
+ leaking the real `codex` child on every capped or cancelled turn off
+ Windows; it now leads its own process group and gets the SIGTERM/SIGKILL
+ sibling. It also resolved its binary with a bare `shutil.which`, so a
+ GUI-launched macOS app could show the subscription as connected while every
+ action failed with "Codex CLI not found" — both sites now share
+ `CodexAuthService._resolve_binary` and its `ensure_cli_paths()` repair.
+
**Fix pass 2026-08-03 (keyboard + pointer, from live Mac reports).** Three
defects of one shape — a surface OFFERS something on every OS and only one OS
can actually deliver it, with nothing raising in between:
@@ -95,7 +130,7 @@ experiences today.
| # | Impact | Area | Gap | Evidence | Behavior off-Windows |
|---|---|---|---|---|---|
-| P-29 | Low | Subscription voice | The dedicated ChatGPT-subscription voice login is an interactive browser flow, so a headless Linux host can never CONNECT the profile there (an existing login still reports ready and calls work through the browser voice bridge) | `jarvis/codex_app_server.py::_login_required_state`, `start_codex_subscription_login` | Headless Linux without a login: every surface (card, activation, voice-mode, Test) reports the same `lifecycle_unavailable` truth with the "run Jarvis on a desktop to connect" reason — no enabled Connect button that can only produce an error toast |
+| P-29 | Low | Subscription voice | The dedicated ChatGPT-subscription voice login is an interactive browser flow, so a headless Linux host — and a graphical Linux desktop that ships no terminal emulator able to host the login for its full lifetime — can never CONNECT the profile there (an existing login still reports ready and calls work through the browser voice bridge) | `jarvis/codex_app_server.py::_login_required_state`, `_linux_login_terminal_missing`, `start_codex_subscription_login`, `jarvis/codex_auth.py::_LINUX_LOGIN_TERMINALS` | Both cases report the same `lifecycle_unavailable` truth on every surface (card, activation, voice-mode, Test), each with its own actionable reason — "run Jarvis on a desktop" or "install one of these terminals" — and never an enabled Connect button that can only produce an error toast |
| P-24 | Medium | Dictation shortcut | The global dictation/call shortcut needs `pynput` on Linux/X11, and `pynput` hard-requires `evdev` — which is published **source-only** (verified on PyPI 2026-07-28: evdev 1.9.3 ships an sdist and no wheels) and compiles against the kernel headers. Putting it in `[full]` would break the one advertised install path on a stock `python:3.11-slim`, so it is the opt-in `[desktop-linux]` extra instead. Wayland is a separate, unfixable-by-install case: the compositor owns global shortcuts by design (the XDG `GlobalShortcuts` portal lets the *compositor* assign the keys, and no wlroots compositor implements it at all) | `pyproject.toml` (`desktop-linux`), `jarvis/platform/probes.py::has_hotkey`, `jarvis/trigger/backends/noop.py::explain_unavailable` | X11 without the extra: no global shortcut, and the log/UI now names the actual cause and the exact `pip install` that fixes it (it used to blame Wayland unconditionally). Wayland: no global shortcut at all — bind a compositor shortcut to `jarvis api dictation start`. On both, dictation still works from the Jarvis Bar, the Dictation view and the CLI, and voice still works via the wake word |
| P-25 | Medium | Dictation insertion | Pasting the transcript into another application is blocked, silently, in three OS-specific situations: Windows UIPI when the foreground window is elevated and Jarvis is not (`SendInput` reports success and the input is discarded), macOS Secure Input while a password field is focused, and Wayland outright (no synthetic input). Detection exists for the first two; Wayland is refused up front | `jarvis/dictation/insert.py::describe_target`, `jarvis/platform/input_isolation.py::windows_foreground_window_is_elevated`, `macos_secure_input_enabled` | All three degrade to the SAME honest outcome instead of silence: the transcript is left on the clipboard, the result is reported as `clipboard_only`, and the bar plus the Dictation view say why and that Ctrl+V will paste it. macOS Secure Input detection is implemented but has not been verified on real hardware from this machine |
| P-02 | Low | Awareness | Idle detection has no Wayland backend (Windows GetLastInputInfo, macOS Quartz, Linux X11 `xprintidle` all exist since 2026-07-16); Wayland exposes no global idle time without portal support | `jarvis/awareness/watchers/idle.py` | Wayland: one honest log line, watcher does not start |