Skip to content

fix(desktop): harden startup PTT and chat recovery - #10441

Merged
Git-on-my-level merged 9 commits into
mainfrom
codex/fix-ptt-startup-readiness
Jul 23, 2026
Merged

Git-on-my-level merged 9 commits into
mainfrom
codex/fix-ptt-startup-readiness

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Cold-start PTT now shares controller-owned voice-context readiness instead of letting a timed-out turn cancel the warm-up needed by the next turn. The same PR also keeps one authoritative chat terminal result, honors explicit no-web wording, and shows the useful Home hub while canonical history restores before the loaded conversation rises into place.

The Beta trace proved a failed first-turn web-search request and a later log gap, but it did not prove a macOS main-thread deadlock. Main already fixed the Beta request-shape 400; this PR repairs the remaining reproducible lifecycle and presentation boundaries without claiming the unproven freeze mechanism.

Product invariants affected

  • INV-AGENT-*
  • INV-CHAT-1
  • INV-VOICE-1

How it was verified

  • cd desktop/macos && ./test.sh — all launcher checks, 396 Rust tests, and 373 isolated Swift suites passed
  • cd desktop/macos && ./scripts/agent-logic-harness.sh --cross-surface-smoke — Swift, Node, and Rust cross-surface contracts passed
  • Focused agent runtime tests — 57 passed; TypeScript production build passed
  • Focused Swift regressions — shared readiness 3/3, Home history policy 3/3, Home close semantics 6/6, realtime continuity 62/62
  • Named /Applications/omi-qa-main.app on the development backend — immediate cold PTT admitted capture and allowed the shared hub warm-up to connect without a second press; an exact “Do not call web search” main-chat turn returned one terminal response with no sending or streaming state left behind
  • Cold app automation state showed homeMode=hub during restore and homeMode=chat after loaded history became available

Tests

  • RealtimeVoiceContextSingleFlightTests covers canceled waiters, forced post-fence freshness, and failed-flight retry ordering
  • jsonl-transport.test.ts covers adapter error-before-throw ordering and one correlated terminal result
  • Retrieval policy and request-translation tests cover the reported negative-web prompt plus contradictory positive-search cases
  • HomeHistoryPresentationPolicyTests covers loading, loaded-history, and empty-history Home states

Failure class (fixes)

Failure-Class: FC-split-mutation-authority

Scoped cleanups

  • Extracted the new readiness owner and Home stage presentation policy from oversized controllers, ratcheting both line-count baselines downward

Review in cubic

Keep speculative voice-context loading controller-owned so a canceled first-turn waiter cannot cancel hub warm-up. Forced post-persistence refreshes still replace older reads.

Failure-Class: FC-split-mutation-authority
Treat adapter errors as progress inside an admitted kernel run and emit only the correlated canonical failed result, preventing Swift from dropping the request before terminal journal material arrives.

Failure-Class: FC-split-mutation-authority
Recognize scoped web-search prohibitions in both gateway and agent routing while preserving explicit search requests that merely mention results, webpack, or naming.

Failure-Class: none
Keep the useful insights hub visible while canonical history loads, then animate loaded conversations upward into Home once the atomic snapshot is ready.

Failure-Class: none
Move the voice-context flight owner and Home stage transitions out of oversized controllers, ratcheting both line-count baselines downward without changing behavior.

@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: e4b125982b

ℹ️ 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 desktop/macos/e2e/flows/home-stage.yaml Resolved
@Git-on-my-level
Git-on-my-level merged commit bdd0d5d into main Jul 23, 2026
29 of 30 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/fix-ptt-startup-readiness branch July 23, 2026 23:50
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