Skip to content

feat: prepare matching Codex voice builds without delaying text startup - #62

Merged
WingedGuardian merged 3 commits into
mainfrom
fix/codex-voice-managed-updates
Oct 29, 2026
Merged

WingedGuardian merged 3 commits into
mainfrom
fix/codex-voice-managed-updates

Conversation

@WingedGuardian

@WingedGuardian WingedGuardian commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Codex upgrades invalidate the old voice launcher, which checks one hard-coded build and warns on every startup. Add opt-in managed mode that starts normal text Codex while a systemd user worker prepares a private copy of the installed release and its matching Windows helper. The global npm package remains untouched by the relay. New versions and normal preparation are quiet; startup reports an actual failure recorded for the current build, a damaged prepared build, or an unavailable updater.

Only builds that pass identity, manifest hashes, native handshake, runtime initialization and default-device enumeration become eligible on the next launch. Transient registry/SSH failures retry in the background; incompatible or modified builds are held without repeated downloads. Older build failures do not warn about a newly installed release. Immutable builds remain available to active sessions. Manage/unmanage verify ownership and preserve the previous launcher and permissions. Manager source upgrades require a new state directory; native Codex release matching is automatic.

Validation at d630349:

  • All 38 Python relay tests passed. The new six-case warning regression failed in all six cases before the fix and passed afterward. It covers fresh/pending updates, stale errors, current protocol/SSH failures and damaged prepared builds.
  • Real Codex 0.165.0 was installed in an isolated Linux prefix. The managed updater provisioned matching private Windows helpers and passed native handshake, runtime loading and default-device enumeration, with no version allowlist change.
  • Using an isolated 0.165.0 app-server and the prepared relay, doctor --audio passed WebRTC negotiation and both Windows devices stayed stable for ten seconds (muted/suppressed). The diagnostic server was stopped afterward. The live launcher and global CLI were unchanged.
  • Review fixes resolve SSH identity paths before persistence and grant the updater write access to its selected state directory, including outside home. Regression tests failed before the fixes; a real generated systemd unit passed structured path readback and wrote to an outside-home state directory containing spaces, dollar and percent characters.
  • Complete managed lifecycle on isolated 0.165: a relative identity was accepted, initial pending launch was quiet, the actual systemd worker prepared the matching build, the ready launcher was quiet, doctor --audio passed again, and unmanage removed the temporary launcher/unit. The live launcher hash remained unchanged.
  • Independent local review of the warning change found no issues. Ruff, whitespace checks, private-data scan and gitleaks passed. All four CI jobs passed at the latest commit; Codex re-review reported no issues at d630349.

Earlier build validation covered isolated Windows staging/reuse, malformed JSON, missing-file/hash rejection, transient registry classification, actual CLI argument/environment/cwd/exit preservation, systemd literal-path quoting and rollback. Full details remain in the initial PR revision.

Shape: 472 counted lines, one managed-update lifecycle.

Limits: successful automatic qualification is not proof of spoken conversation on every future release. A release that changes the private protocol must pass the checks before activation. This PR has not replaced the live launcher.

E2E: After merge, adopt managed mode with the live launcher ownership hash, inspect status for the installed release, run doctor --audio against its prepared relay state, verify quiet text startup and a spoken F8 conversation, and check that the saved prior launcher permits rollback.

Keep text startup independent of voice provisioning and global npm packages
unchanged. Qualify private native builds before activation and preserve owned
launcher rollback.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T01:32:37.791857Z d630349 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87079ea1-71fa-49c3-aaad-34d0cbd1941f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@WingedGuardian

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ba7ec28de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bridges/codex_voice/managed.py Outdated
with open(state / 'sync.lock', 'a') as lock, bridge.helper_lock(state / 'config.json'):
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
previous = bridge.load_state(state) if (state / 'config.json').exists() else None
desired = {'codex': str(entry), 'host': args.host, 'identity': args.identity, 'launcher': str(target)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve the SSH identity path before persisting it

When manage receives a relative identity such as --identity ./key, it stores that path unchanged even though bridge.ssh_args() resolves it during validation. The background worker later calls ssh_args() again from its own working directory, so it selects a different, potentially nonexistent key. This prevents matching builds from being prepared when authentication depends on that identity, despite the key being valid at installation time. Persist the expanded absolute identity path, as is already done for the Codex entry point.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d630349. manage now expands and resolves the identity before both validation and persistence. The regression covers relative, tilde, absolute and absent identities, changes to the worker working directory, and verifies the selected SSH key. Relative and tilde cases failed before the fix; all 38 relay tests now pass.

Comment thread bridges/codex_voice/managed.py Outdated
unit_text = ('[Unit]\nDescription=Codex native voice build synchronization\nStartLimitIntervalSec=0\n'
'[Service]\nType=oneshot\nExecStart=' + command + '\nEnvironment=' + environment
+ '\nTimeoutStartSec=7200\nRestart=on-failure\nRestartSec=5min\n'
'NoNewPrivileges=yes\nProtectSystem=strict\nReadWritePaths=%h\n')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow writes to the selected state directory in the updater unit

When --state-dir resolves outside the user's home directory, installation accepts it, but the generated unit combines ProtectSystem=strict with only ReadWritePaths=%h. On systems enforcing this sandbox, the updater cannot write to that state directory: even opening sync.lock for append in sync() fails before its error-recording handler runs, so no build can become ready. This also affects state directories reached through home-directory symlinks pointing to another filesystem. Include the resolved state directory in the unit's writable paths, with appropriate systemd escaping.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d630349. The generated unit retains ProtectSystem=strict and adds the resolved state directory to ReadWritePaths with field-appropriate quoting (percent escaped, dollar literal). The regression uses a state directory outside the fixture home and retains rollback checks. A real generated systemd user unit with spaces, dollar and percent characters in an outside-home state path passed structured D-Bus ReadWritePaths readback and wrote there successfully; the temporary unit and files were removed. Systemd semantics checked against https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#ReadWritePaths=.

@WingedGuardian

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: d630349b0e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@WingedGuardian
WingedGuardian merged commit cd07494 into main Oct 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant