fix: recover official-mix Mobile Remote Control sessions - #1789
Open
Rat0323 wants to merge 13 commits into
Open
Conversation
Run Provider Sync during launcher startup for every non-pure-official relay profile even when the Provider Sync toggle is off, so mobile-created openai sessions are normalized to the active provider and recorded in local_thread_catalog.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
relayMode = officialwithofficialMixApiKey = true.threads.model_provider.custom.host_kind = localhost so SSH host entries remain untouched..gitattributesLF normalization until that PR is merged.Root cause
A phone-created Mobile Remote Control thread can be created inside the host app-server with
modelProvider = openaiwhile Codex++ official-mix routes model requests through a configured custom provider. This ingress path does not reliably pass through the desktop renderer'sthread/startrequest client.The active rollout and
threadsrow can therefore remainopenai, while the local thread catalog is initially missing or stale. Rewriting an active rollout in response tothread/startedis unsafe because Codex may still be appending to that JSONL file. Updating SQLite before the rollout is safely normalized can also leave a partial state that the old candidate predicate no longer retries.Implementation
Creation-event catalog recovery
The renderer observes app-server
thread/startednotifications across supported message envelopes and sends only the new thread id to the Codex++ bridge route.Recovery requests are sequential over the existing bounded retry window. A successful catalog recovery stops later attempts. Early
already up to dateresponses continue retrying because the Codex databases may be committed shortly after the notification.The runtime route:
threads.model_providerunchanged;Startup recovery
Launcher startup performs the full normalization after rollouts are inactive. Candidates are derived from inconsistencies across rollout metadata,
threads, and the local catalog, which keeps partial commits detectable and retryable.Rollout updates use content comparison, an exclusive file lock, Windows deny-sharing where available, and write-back verification. A changed or locked rollout is deferred, and its database/catalog state is not advanced.
After a rollout is verified at the target provider, recovery repairs the catalog before updating thread provider rows. If a later database step fails, the already-normalized rollout is retained so the next startup can finish the remaining idempotent work.
Provider and request contracts
codex_model_provideris parsed from the active profile's rootmodel_provider, with liveconfig.tomlas fallback.activeRelayIdno longer falls back torelayProfiles[0].Validation
node --check assets/inject/renderer-inject.jscargo fmt --all -- --checkgit diff --checkcargo test -p codex-plus-data --test provider_sync -- --test-threads=1- 30 passedcargo test -p codex-plus-core --test model_catalog -- --test-threads=1- 7 passedcargo test -p codex-plus-core --test cdp_bridge -- --test-threads=1- 94 passedcargo test -p codex-plus-core --test bridge_routes -- --test-threads=1- 29 passedThe 160 targeted tests cover active-rollout concurrency, deferred recovery, retry after a partial database commit, local/SSH host isolation, exact active-profile selection, non-
customprovider ids, pure authentication modes, and stop-after-success retry behavior.A real phone-created Mobile Remote Control session was then validated end to end after installing commit
f40141c: runtime recovery inserted the local catalog row as the configured provider, desktop resume preserved that mapping, and a subsequent turn reached the configured relay with HTTP 200.