Skip to content

Fix PTT handoffs across session refresh - #9825

Merged
Git-on-my-level merged 8 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/fix-realtime-screen-freshness
Jul 16, 2026
Merged

Git-on-my-level merged 8 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/fix-realtime-screen-freshness

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

  • make each realtime provider completion an explicit terminal/continuation state, including a bounded no-answer continuation and prompt terminalization when transport is unavailable
  • make terminal child-agent output a bounded, TTL-scoped kernel context projection for coordinator follow-ups; remove the unused realtime-controller completion cache
  • bind explicit current-screen chat questions to one live image for that turn, and make all tool/capability guidance classify work context as historical rather than current visual evidence

Root cause and durable guards

Recent regressions shared an ownership/provenance gap: provider, UI, and harness paths each inferred completion independently; a Swift-side cache was never a canonical context input; and current-screen intent could be satisfied from Rewind/metadata whose provenance was historical. This PR makes the reducer own the terminal state, the runtime kernel own completed-child context, and capture-scoped image evidence the only current-screen source. Tests cover continuation outcomes, audio/text admission parity, stale evidence rejection, terminal child projection bounds, generated capability prompt alignment, and exact-turn harness completion. Extracted controller policies and all intentional oversized-file growth are now explicit ratchets, preventing silent regrowth.

Product invariants

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

Verification

  • make preflight
  • cd desktop/macos/agent && npm run build && node --experimental-strip-types scripts/generate-tool-surfaces.mjs --check && npm test
  • cd desktop/macos && xcrun swift test -c debug --package-path Desktop --filter 'ScreenContextTelemetryTests|ChatDiscoverabilityTests|DesktopCoordinatorServiceTests|RealtimeScreenEvidenceTests|RealtimeHubBargeInContinuityTests|RealtimeHubSessionInputLifecycleTests' -Xlinker -L -Xlinker /opt/homebrew/opt/webp/lib

@Git-on-my-level
Git-on-my-level force-pushed the codex/fix-realtime-screen-freshness branch from 65ab5fc to e238739 Compare July 15, 2026 19:56
Gate current-screen freshness at capture-to-transport enqueue, then give the paired report a bounded protocol deadline. Fail closed if local completion cannot drain its screenshot tool, and reject late tool starts after an authoritative screen result.\n\nVerification: xcrun swift test --package-path Desktop --filter 'RealtimeScreenEvidenceTests|VoiceTurnReducerTests'; agent-continuity-gauntlet-lib.py --self-check; three live ptt-screen-probe runs against /Applications/omi-qa-live-fix.app on development GCP (each terminal_success, protocol completed, zero pending tools).
A verified screenshot report was treated as a local terminal answer, so PTT spoke a robotic visual description instead of letting the realtime provider answer the original question. Keep verified reports as internal grounding and preserve the post-tool provider continuation; only verification failures are terminal local results.

Also restrict fallback transcript correction to turn-scoped OCR and explicit vocabulary so historical Rewind terms cannot rewrite the user transcript.

Verified: xcrun swift build --target Omi Computer; focused Swift tests (136); generated tool surfaces and 26 focused agent manifest tests.
@Git-on-my-level
Git-on-my-level force-pushed the codex/fix-realtime-screen-freshness branch from 052ba8f to d8e55bb Compare July 15, 2026 23:10
…ion refactor

The hubDidFinishTurn disposition split (d8e55bb) renamed the single
'waiting for post-tool continuation' log message into two cases:
.awaitPendingTools ('waiting for provider tool delivery') and
.requestPostToolContinuation ('requesting one bounded continuation').

The testRealtimeToolTurnsStayOpenUntilToolResultReturns assertion was
not updated, so CI failed on the now-absent old string. The
.awaitPendingTools case is the exact semantic match for the test's
intent (tool turns stay open until tool results return).
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Fixed a failing source-inspection assertion in testRealtimeToolTurnsStayOpenUntilToolResultReturns.

The PR's disposition refactor (d8e55bb) split the single hubDidFinishTurn await case into .awaitPendingTools and .requestPostToolContinuation, renaming the log message from "waiting for post-tool continuation" to "waiting for provider tool delivery". The test assertion still checked for the old string, so Desktop Swift CI failed on every push.

Change: Updated the assertion to match the current .awaitPendingTools log string — the exact semantic match for the test's intent (tool turns stay open until tool results return).

Verification:

  • xcrun swift test -c debug --package-path Desktop --filter 'RealtimeHubSpawnAgentTests/testRealtimeToolTurnsStayOpenUntilToolResultReturns' — passed
  • xcrun swift test -c debug --package-path Desktop --filter 'RealtimeHubSpawnAgentTests' — 26 tests, 0 failures
  • CI Desktop Swift Build & Tests — passed

@Git-on-my-level
Git-on-my-level merged commit 3a74048 into BasedHardware:main Jul 16, 2026
20 checks passed
cursor Bot pushed a commit that referenced this pull request Jul 16, 2026
Sync main PTT handoff fixes (#9825) into the split RealtimeHubController
modules. Resolved conflicts in RealtimeHubController.swift and the product
line-count ratchet baseline while preserving the file-split ownership seams.

Co-authored-by: David Zhang <[email protected]>
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
## Summary

- make each realtime provider completion an explicit
terminal/continuation state, including a bounded no-answer continuation
and prompt terminalization when transport is unavailable
- make terminal child-agent output a bounded, TTL-scoped kernel context
projection for coordinator follow-ups; remove the unused
realtime-controller completion cache
- bind explicit current-screen chat questions to one live image for that
turn, and make all tool/capability guidance classify work context as
historical rather than current visual evidence

## Root cause and durable guards

Recent regressions shared an ownership/provenance gap: provider, UI, and
harness paths each inferred completion independently; a Swift-side cache
was never a canonical context input; and current-screen intent could be
satisfied from Rewind/metadata whose provenance was historical. This PR
makes the reducer own the terminal state, the runtime kernel own
completed-child context, and capture-scoped image evidence the only
current-screen source. Tests cover continuation outcomes, audio/text
admission parity, stale evidence rejection, terminal child projection
bounds, generated capability prompt alignment, and exact-turn harness
completion. Extracted controller policies and all intentional
oversized-file growth are now explicit ratchets, preventing silent
regrowth.

## Product invariants

- INV-AGENT-*
- INV-AUTH-1
- INV-CHAT-1
- INV-VOICE-1

## Verification

- `make preflight`
- `cd desktop/macos/agent && npm run build && node
--experimental-strip-types scripts/generate-tool-surfaces.mjs --check &&
npm test`
- `cd desktop/macos && xcrun swift test -c debug --package-path Desktop
--filter
'ScreenContextTelemetryTests|ChatDiscoverabilityTests|DesktopCoordinatorServiceTests|RealtimeScreenEvidenceTests|RealtimeHubBargeInContinuityTests|RealtimeHubSessionInputLifecycleTests'
-Xlinker -L -Xlinker /opt/homebrew/opt/webp/lib`
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
Sync main PTT handoff fixes (BasedHardware#9825) into the split RealtimeHubController
modules. Resolved conflicts in RealtimeHubController.swift and the product
line-count ratchet baseline while preserving the file-split ownership seams.

Co-authored-by: David Zhang <[email protected]>
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