Repository navigation
fix: restore PTT voice tools + web-grounded escalations, notch polish - #10758
Conversation
… capability
The kernel run-tool capability computed its allowlist from the chat-adapter
projection only, so every voice-only tool the realtime surface advertises
(ask_higher_model, point_click) was rejected with tool_not_allowed the moment
Swift relayed it for authorization. In Beta 0.12.141 this hard-broke PTT
escalations: RealtimeHub logged 'kernel rejected tool ask_higher_model
code=tool_not_allowed' and Gemini received a 112-byte error as the tool result.
Registration now unions the run surface's manifest projection
(toolsForSurface("realtime_voice")) with the adapter projection for
swift_realtime runs, still filtered by execution role and spawn-time tool
policy. Chat runs are unchanged and must not inherit voice-only tools.
Verification: new behavioral test registers a swift_realtime pi-mono run,
asserts ask_higher_model/point_click are allowed and authorize end-to-end,
and that a plain chat run still excludes them. npx vitest run
tests/run-tool-capability.test.ts → 17/17 pass; agent-logic-harness.sh green.
Failure-Class: FC-surface-tool-authority-projection
Co-Authored-By: Claude Fable 5 <[email protected]>
PTT's ask_higher_model escalation posts /v2/chat/completions with no client tools, and the gateway's agentic-turn heuristic only injects the server web_search tool when client tools are present — so every voice escalation for current facts (weather, prices, scores) reached Claude with zero web access and answered blind or refused. The gateway now accepts an explicit 'omi_web_search: true' opt-in that injects the server web_search tool even with no client tools; the private/no-web prompt boundary still wins. The Swift escalation body sets the opt-in, its system prompt directs the model to ground current-fact answers in the lookup, and the request timeout is raised 30s → 60s for pause_turn continuations. Verification: new gateway tests prove the opt-in injects web_search with no client tools and stays suppressed on explicit private/no-web turns (cargo test omi_web_search → 2/2 pass; full chat test module compiles clean). Swift builds; live escalation exercised on the QA bundle (see PR). Failure-Class: none Co-Authored-By: Claude Fable 5 <[email protected]>
…Summon row The notch legend showed both 'Ask' and a hardcoded 'Summon ⌃⌘O' row while Settings advertises the same shortcut as 'Open Omi Shortcut'. Two near-identical open rows read as a bug; the legend now shows one 'Open' row bound to the configured shortcut. The fixed window-summon chord keeps working — it is just no longer listed. Verification: xcrun swift build + OpenOmiShortcutSummonRoutingTests pass; visual check on the QA bundle (see PR). Co-Authored-By: Claude Fable 5 <[email protected]>
…r voice waveform The notch Omi mark now animates all three voice phases: the listening waveform gains a center-weighted level-meter envelope with a travelling overtone (instead of a uniform sine rope), and response playback pulses the resting ring like a speaker cone — two-harmonic breathing bounded so every dot stays inside the 21pt identity slot. Reduce Motion suppresses both, and the speaking state is announced to accessibility. Driven by the existing reducer-owned isVoiceResponseGlowActive projection; no new voice state is introduced. Verification: geometry is pure and covered by new NotchVoiceMorphMarkTests (pulse bounds, slot containment, envelope shape, amplitude ceiling, reduce-motion) — 14/14 pass; exercised live on the QA bundle (see PR). Co-Authored-By: Claude Fable 5 <[email protected]>
Evidence: PR #9597 converged run authority onto the kernel with an adapter-only capability allowlist, structurally rejecting every voice-only surface tool; observed live in Beta 0.12.141 as 'kernel rejected tool ask_higher_model code=tool_not_allowed'. Guard artifact: behavioral swift_realtime authorization test in agent/tests/run-tool-capability.test.ts. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb6f049137
ℹ️ 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".
| web_search_supported && !public_web_prohibited && !client_tools.is_empty(); | ||
| let inject_web_search = web_search_supported | ||
| && !public_web_prohibited | ||
| && (!client_tools.is_empty() || req.omi_web_search == Some(true)); |
There was a problem hiding this comment.
Include explicit web opt-ins in fallback telemetry
When OMI_DESKTOP_WEB_SEARCH_DISABLED=1, this new opt-in cannot inject web search and the escalation silently falls back to model knowledge. However, should_record_web_search_fallback still recognizes only requests with nonempty req.tools; these escalation requests deliberately have no client tools, so they never call record_fallback. Include req.omi_web_search == Some(true) in the fallback predicate so this degraded path remains observable.
AGENTS.md reference: AGENTS.md:L94-L94
Useful? React with 👍 / 👎.
| private var showingNotchSpeaking: Bool { | ||
| state.isVoiceResponseGlowActive && !state.isVoiceListening | ||
| } |
There was a problem hiding this comment.
Pulse only during active response playback
During the normal awaiting-response phase, isVoiceResponseWaiting and isThinking are true, and isVoiceResponseGlowActive is defined as response-active or response-waiting. This therefore sets both isSpeaking and isThinking before any audio starts; the mark pulses white and its accessibility label reports “Speaking” while the model is still processing. Derive this state from isVoiceResponseActive instead so waiting retains the existing thinking presentation.
Useful? React with 👍 / 👎.
The listening waveform and the speaking pulse were animated from a 5 Hz throttled mic level and a pure timer respectively, so neither visibly tracked real audio. Now: - AudioLevelMonitor exposes un-throttled live mic and voice-playback levels for frame-rate canvases (poll-per-frame, deliberately not @published so capture-rate updates don't flood SwiftUI). - StreamingPCMPlayer taps the main mixer output and feeds the actual audible RMS level — in sync with playback rather than leading it by the scheduled queue depth; stop() zeroes the level. - NotchVoiceMorphMark smooths both signals with an asymmetric attack/release smoother (fast onset, gentle decay) and modulates the speaker pulse by the assistant's output level with a visible floor for quiet stretches. Verification: new hermetic tests — VoiceLevelSmoother attack/release/clamp/ time-gap behavior, speaking-level modulation floor/ceiling, and StreamingPCMPlayer.rmsLevel on known buffers (silence, half-scale, clipped) — plus existing pulse-containment tests; 20/20 pass. Live-exercised on the omi-ptt-fix QA bundle (see PR). Co-Authored-By: Claude Fable 5 <[email protected]>
Violated contract
-----------------
`route == .hubWarmWait` is the voice reducer's record that PushToTalkManager —
not RealtimeHubController — owns the turn's captured PCM, and is waiting for the
`prepareHubInput` effect that only `hubReady` emits. That effect is the single
writer which flushes the manager buffer and commits a released turn.
`providerReplacementReady` (barge-in session replacement) rewrote that route to
`.hub` unconditionally, taking the handoff away from its owner. Its sibling
`providerReconnected` already honoured the claim; the replacement path did not.
Symptom
-------
Press PTT while Omi is still speaking (barge-in), then release before the
replacement Gemini socket finishes connecting: the turn never stops. Live trace
from the omi-ptt-fix bundle, turn C6BFD805 (/private/tmp/omi-dev-com.omi.omi-ptt-fix-7456.log):
00:09:35.141 RealtimeHub: barge-in — replacing session for clean next turn
00:09:35.141 PushToTalkManager: waiting for realtime hub — buffering mic audio
00:09:35.335 PushToTalkManager: finalizing while realtime hub warms — holding buffered audio
00:09:35.968 RealtimeHub: connected (Gemini Live) <- no `hubReady`, no flush
00:09:36.147 VoiceTurnCoordinator: deadline fired turn=C6BFD805 deadline=hub_warm phase=finalizing
00:09:36.147 VoiceTurnCoordinator: dropped stale event turn=C6BFD805 event=deadline_fired
... 150 s of nothing ...
00:12:06.090 VoiceTurnCoordinator: terminal turn=C6BFD805 reason=provider_failed route=hub
Two failures follow from the one clobber. `hubDidConnect` publishes `.hubReady`
only while the route reads `.hubWarmWait`, so `prepareHubInput` never ran and
the buffered audio was never flushed or committed. And `deadlineMatchesCurrentState`
admits `.hubWarm` only while the route reads `.hubWarmWait`, so the rescue
deadline that should have fallen back to batch STT was dropped as stale — the
turn was left with no armed deadline at all and stayed listening until the
provider's idle socket teardown minutes later.
Fix
---
Converge both provider-ready admissions behind one `bindProviderReadyHubRoute`
helper in the reducer, which never overwrites a manager-owned `.hubWarmWait`
capture. `hubReady` remains the only transition that binds the hub route for
such a turn, and the `.hubWarm` rescue stays armed until it does.
Verification
------------
- Three new hermetic reducer tests, each confirmed failing on the pre-fix
reducer and passing after (no sleeps, no source inspection):
VoiceTurnReducerTests.testReplacementReadyKeepsManagerOwnedWarmCaptureRoutable
VoiceTurnReducerTests.testWarmWaitRescueDeadlineSurvivesReplacementReady
(reproduces the exact `staleEventCount` bump seen in the log)
VoiceTurnReducerTests.testNoProviderReadyTransitionClobbersAManagerOwnedWarmCapture
(reusable guard: enumerates every provider-ready admission)
- ./scripts/dev-feedback.py --once swift 'VoiceTurnReducerTests' -> 74 tests,
0 failures (8 failures with the fix reverted).
- cd desktop/macos && ./scripts/agent-logic-harness.sh -> Harness passed (36.09s).
- python3 scripts/check_desktop_test_quality.py -> OK, debt at/below baseline.
- Chat-continuity check on the live bundle while diagnosing: kernel
`conversation_turns` and `main_chat_snapshot` show one user+assistant pair per
`voice:<turnID>` continuity key, so no duplicate journal write accompanied
this stall. (`kernel_turn_tail` reads `conversation_turn_revisions`, so it
reports recorded+updated revisions of the same turn id.)
Failure-Class: FC-split-mutation-authority
Co-Authored-By: Claude Fable 5 <[email protected]>
…uard The barge-in warm-capture fix adds the shared bindProviderReadyHubRoute helper; raise the ratchet baseline with its justification. Co-Authored-By: Claude Fable 5 <[email protected]>
Every PTT turn feeds the monitor's mic level (now including the un-throttled live level driving the notch waveform), so ptt-lifecycle genuinely exercises it. Co-Authored-By: Claude Fable 5 <[email protected]>
User-reported: the waveform and speaking pulse modulated constantly regardless of actual audio. Root cause: display floors (quietLevelFloor 0.28 on input, speakingLevelFloor 0.3 on output) dominated real speech levels (~0.05-0.25 RMS), so silence and speech rendered nearly identically. Now silence maps to exactly zero — flat listening line, still ring — and motion is proportional to the live level through a shared perceptual mapping (noise gate at 0.02 for ambient room noise, gain, soft-knee pow 0.65). The speaking pulse magnitude IS the assistant's live output level; a bounded 25% time wobble only keeps sustained speech from freezing. Ring color follows the speaking presentation, not pulse magnitude, so pauses cannot flicker it. ptt_turn_snapshot now reports live_mic_level / live_voice_playback_level so automation can assert the animation inputs during a real turn. Verification: geometry tests updated to the new contract (silence and 0.012 room noise -> 0; monotonic with volume; pulse 0 in reply pauses; wobble share bounded) - 14/14 pass. Live on the omi-ptt-fix bundle: idle levels 0.0000; real capture via ptt_start feeds the mic level; during a spoken reply the playback level ran 0.14-0.25 and decayed to 0 at the end of speech. Failure-Class: none Co-Authored-By: Claude Fable 5 <[email protected]>
The `omi_web_search` opt-in (a6e49ec) was added to `inject_web_search` but not to `should_record_web_search_fallback`, which still required non-empty client tools. PTT `ask_higher_model` escalations carry no client tools, so a voice turn that asked for live web search and then lost it — a `claude-haiku` route, or `OMI_DESKTOP_WEB_SEARCH_DISABLED=1` — answered from model knowledge and emitted no `chat_retrieval` fallback event at all. The exact regression the opt-in was meant to make visible was the one case telemetry could not see. Root cause: two copies of "does this turn want web search" drifted. The fallback predicate now mirrors the injection condition (client tools present OR explicit opt-in), so the degrade is reported for both request shapes while a private/no-web turn — which never wanted the tool — still reports nothing. Verification (local patched gateway on 127.0.0.1:10211, secrets from based-hardware-dev Secret Manager, named bundle com.omi.omi-ptt-fix pointed at it): - `cargo test --locked` — 390 passed, including the two new regressions `test_omi_web_search_opt_in_reports_the_degrade_when_search_is_unsupported` and `test_omi_web_search_opt_in_does_not_report_a_degrade_on_a_private_turn`. - `./scripts/agent-logic-harness.sh --cross-surface-smoke` — passed (144s), including the cross-surface Rust retrieval contract smoke. - Live escalation shape against the patched gateway (no client tools, `omi_web_search: true`, `stream: false`) returned provider-reported `"web_search_requests": 1` with source URLs (Weather Underground, AccuWeather). The same request against the deployed dev backend returned `"web_search_requests": 0` and a hallucinated `<tool_call>` block. - Live PTT turn on the named bundle: `RealtimeHub: ask_higher_model <- claude-sonnet-4-6 OK in 7831ms (590 chars)`, gateway logged `retrieval_policy web_search_exposed=true public_web_prohibited=false`, and the spoken answer carried real NYC conditions. Failure-Class: none Co-Authored-By: Claude Fable 5 <[email protected]>
User-reported: after removing the display floors, the animations froze — the waveform sat flat and the speaking ring looked static. Root cause: real levels through this pipeline are small in absolute terms (speech ~0.03-0.2 RMS after the capture noise floor; post-mixer reply ~0.1-0.29 measured live), so a fixed-gain mapping produced sub-pixel motion, and the 0.02 gate sat above quiet speech entirely. Display levels now run gate -> auto-gain -> knee -> smoothing (VoiceLevelDisplay): the gate (0.015) sits just above measured ambient noise (0.005-0.013) so quiet rooms stay flat, and levels are normalized against a slowly-decaying running peak so normal speech spans the full wave height and pulse range regardless of absolute mic/output scale. The pulse leans on dot swell (45% at full level) rather than ring radius, which is sub-pixel at 21pt; containment in the identity slot still holds. Verification: 15/15 geometry tests (silence + measured room noise flat; quiet speech reaches >0.7 of range; AGC adapts to loud speech while keeping quieter words visible; slot containment). Live turn on the rebuilt bundle: playback levels 0.01-0.29 with speech cadence; display math maps word peaks to full pulse and pauses to a still ring. Failure-Class: none Co-Authored-By: Claude Fable 5 <[email protected]>
Per user feedback on the QA bundle: - The speaking ring no longer inflates its dots. Each dot is displaced radially outward by two angular harmonics travelling around the ring in opposite directions, scaled by the assistant's live output level — a circular audio-visualizer ripple. Displacement is outward-only (the voice pushes the ring), zero in reply pauses, and bounded so the fully-pushed dot edge stays inside the 21pt identity slot (6.93x1.24 + 1.89 <= 10.5). - The input waveform smooths tighter (attack 20ms, release 110ms) so it snaps to syllables instead of gliding. Verification: geometry tests updated — per-dot containment across wave phases at full level, push zero in silence / bounded by level / non-uniform across dots / travelling over time — 14/14 pass. Rebuilt the omi-ptt-fix bundle (still pointed at the local patched gateway) and ran a live PTT turn: terminal_success with native audio playback. Co-Authored-By: Claude Fable 5 <[email protected]>
…over The speaking ring's radial push is now a single crest pattern orbiting the ring in one fixed direction (one dot per quarter period) instead of two counter-rotating harmonics that read as chaotic pulsing. Squared crests sharpen the wave front and calm the troughs. The input wave's silence gate gains a 0.6s hangover: once speech opens the gate, sub-gate levels above the capture residual keep rendering, so the quieter tail of a phrase rides through instead of flatlining while the speaker is still talking. Mic auto-gain peak half-life drops 4s -> 2s so a loud opening word doesn't crush the tail, release lengthens 0.11 -> 0.16 to ride inter-syllable dips, and the opening gate drops 0.015 -> 0.013. Verified: NotchVoiceMorphMarkTests 16/16 pass (new: unidirectional-travel hand-off identity, tail-hangover regression); rebuilt com.omi.omi-ptt-fix and ran a live real-audio ptt_test_turn -> terminal_success with ask_higher_model executing cleanly. Co-Authored-By: Claude Fable 5 <[email protected]>
…ng ripple The listening line no longer rolls like a rope wave: each dot bounces on its own blend of incommensurate frequencies, like adjacent bands on an equalizer, so the line spikes up and down with the voice. Level, gate, auto-gain, and envelope behavior are unchanged. The speaking ring moves from two opposite crests at a 1.2s period (read as jaws chewing) to three crests at a 0.6s period, so it reads as a quick ripple sweeping the ring in one fixed direction. Verified: NotchVoiceMorphMarkTests 17/17 pass (new: spikes decorrelated across dots; unidirectional hand-off retuned to the 3/8-period step); rebuilt com.omi.omi-ptt-fix and ran a live real-audio ptt_test_turn -> terminal_success. Co-Authored-By: Claude Fable 5 <[email protected]>
Spatial waves around the speaking ring (counter-rotating, then unidirectional three-crest) kept reading as chewing or wobbling. Replace them with a uniform expansion: every dot pushes outward together by the live output level, and all the motion comes from fast attack/release (12ms/90ms) on that level, so the whole ring spikes on each sound peak and snaps back between peaks. Pauses still leave a clean still ring; slot containment is unchanged. Verified: NotchVoiceMorphMarkTests 16/16 pass; rebuilt com.omi.omi-ptt-fix and ran a live real-audio ptt_test_turn -> terminal_success. Co-Authored-By: Claude Fable 5 <[email protected]>
kodjima33
left a comment
There was a problem hiding this comment.
Good diagnosis of the PTT tool-authority projection bug; holding the merge until Desktop Swift Build & Tests goes green.
… event-payload SHA (#10784) ## Summary `PR Metadata Preflight` (repo-checks.yml `metadata-preflight` job) diffed against `github.event.pull_request.base.sha` — a value frozen at whatever PR event last delivered it. That job only runs on metadata-only `edited`/`labeled`/`unlabeled` events, which fire with no new commit and don't refresh that field. On PR #10758, `main` had advanced 37 commits (including a change to `backend/routers/memories.py` in an unrelated PR) since the last time an event refreshed `base.sha`, so the diff scope silently ballooned to include those unrelated commits and the job failed on a false `INV-MEM-1` citation requirement for files the PR never touched. The sibling `changes` job in the same workflow already avoids this: it resolves `origin/${{ github.base_ref }}` live against the job's own `fetch-depth: 0` checkout instead of trusting a payload field. This PR points `metadata-preflight` at the same thing. ## Fix - `.github/workflows/repo-checks.yml`: `metadata-preflight`'s `scripts/pr-preflight --base` now uses `origin/${{ github.base_ref }}` instead of `github.event.pull_request.base.sha`. - `.github/scripts/test_pr_preflight.py`: updated the workflow-content regression test to assert the live-resolved base and guard against reintroducing the stale payload field. No behavior changes for the `changes`/`hygiene` (code) lane — it already used the correct pattern. ## Product invariants affected none ## Failure class (fixes) Failure-Class: new Registered `FC-stale-event-payload-diff-base`: a check that diffs a PR against a base ref must resolve that ref live from the checkout, not from a value captured in an event payload that isn't refreshed by every trigger type that can run the check. No existing registered class covers event-payload staleness driving an incorrect diff scope. `evidence_prs` points at #10758, where this exact failure surfaced. Guard artifact: `test_repo_checks_routes_metadata_events_to_the_narrow_preflight` now asserts the live-resolved base and would fail if the stale field were reintroduced. ## Verification - `python3 .github/scripts/test_pr_preflight.py` — 26/26 pass (updated regression test covers this exact case). - `scripts/pr-preflight --pr-body-file <this file>` — passes locally with `files=2` against `origin/main`. - Live-reproduced the bug on PR #10758 before this fix: confirmed the branch was 37 commits behind `main`, confirmed the exact upstream commit (#10750) that touched the flagged memory files, and confirmed `git diff origin/main...HEAD` (fresh, correct base) shows 27 files with no memory files touched — matching what `metadata-preflight` should have reported. ## Related Filed a follow-up issue: the same `github.event.pull_request.base.sha` pattern also appears in `backend-unit-tests.yml`, `desktop-swift-ci.yml`, `backend-hermetic-e2e.yml`, and `desktop-backend-image-checks.yml`. Those jobs trigger on code-changing events (`synchronize`/`opened`) where the payload field is refreshed by the same event that needs it, so the staleness window is much narrower — but not zero under queued/delayed runs. Left out of this PR to keep the fix scoped and verifiable; tracked separately. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/10784?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Evidence: PR BasedHardware#10758, where this exact failure surfaced — a diff computed against a frozen github.event.pull_request.base.sha falsely flagged INV-MEM-1 on files the PR never touched, because main had advanced 37 commits past that captured SHA with no intervening event to refresh it.
Evidence: PR BasedHardware#10758, where this exact failure surfaced — a diff computed against a frozen github.event.pull_request.base.sha falsely flagged INV-MEM-1 on files the PR never touched, because main had advanced 37 commits past that captured SHA with no intervening event to refresh it.
…asedHardware#10785) Three workflows still diffed against github.event.pull_request.base.sha, which is only as fresh as the last event that populated it: a queued or re-triggered run can diff against a base the target branch has since moved past, silently widening or narrowing diff-scoped check selection (FC-stale-event-payload-diff-base, registered after BasedHardware#10784 / PR BasedHardware#10758). Switch all three to the canonical prevention: resolve origin/<base-ref> live against the fetch-depth:0 checkout in the same job, matching the detect-changes action used by repo-checks.yml. - backend-unit-tests.yml: changed-files base - desktop-swift-ci.yml: DIFF_BASE for path detection - backend-hermetic-e2e.yml: PR_BASE_REF for hermetic scope The fourth call site named in the issue (desktop-backend-image-checks.yml) was removed with the retired Node agent cloud, so only three remain. Failure-Class: FC-stale-event-payload-diff-base Co-authored-by: CommandCodeBot <[email protected]>
…10785) (#10964) * fix(ci): resolve PR diff bases live instead of the stale payload SHA (#10785) Three workflows still diffed against github.event.pull_request.base.sha, which is only as fresh as the last event that populated it: a queued or re-triggered run can diff against a base the target branch has since moved past, silently widening or narrowing diff-scoped check selection (FC-stale-event-payload-diff-base, registered after #10784 / PR #10758). Switch all three to the canonical prevention: resolve origin/<base-ref> live against the fetch-depth:0 checkout in the same job, matching the detect-changes action used by repo-checks.yml. - backend-unit-tests.yml: changed-files base - desktop-swift-ci.yml: DIFF_BASE for path detection - backend-hermetic-e2e.yml: PR_BASE_REF for hermetic scope The fourth call site named in the issue (desktop-backend-image-checks.yml) was removed with the retired Node agent cloud, so only three remain. Failure-Class: FC-stale-event-payload-diff-base Co-authored-by: CommandCodeBot <[email protected]> * test(ci): assert the hermetic scope resolves the PR base live The scope step now diffs against origin/<base-ref> (live, matching detect-changes) instead of the event-payload base.sha which can be stale for a queued run (FC-stale-event-payload-diff-base, #10785). Update the wiring contract test to assert the new PR_BASE_REF pattern and that the stale base.sha reference is gone. Co-authored-by: CommandCodeBot <[email protected]> --------- Co-authored-by: CommandCodeBot <[email protected]>
Summary
Comprehensive fix for the PTT / voice-agent failure class observed live in Omi Beta 0.12.141, plus notch polish. Diagnosed from
/private/tmp/omi-beta.logand the full git fix history of PTT.What was broken (from the running Beta's logs):
RealtimeHub[gemini]: kernel rejected tool ask_higher_model code=tool_not_allowedon every PTT escalation. The kernel run-tool capability computes its allowlist from the chat-adapter projection of the tool manifest, but the realtime-voice surface advertises tools generated from the surface projection — so every voice-only tool (ask_higher_model,point_click) was structurally rejected and Gemini received a 112-byte error as the tool result. This is why voice tool calls fail.!client_tools.is_empty()) therefore never injected the serverweb_searchtool — every voice escalation for current facts (weather, prices, scores; all visible in the log) reached Claude with zero web access. This is why PTT can't do web lookups.tool_choice.name 'web_search'400s from the previous build's process were the old forced-caller bug, perf(chat): reuse Anthropic context prefixes #10422 lineage.)Fixes:
fix(agent): kernel run-tool capability registration now unions the run surface's manifest projection (toolsForSurface("realtime_voice")) with the adapter projection forswift_realtimeruns — still filtered by execution role and spawn-time tool policy. Chat runs cannot inherit voice-only tools (asserted in test).fix(desktop): the gateway accepts an explicitomi_web_search: trueopt-in that injects the serverweb_searchtool with no client tools present; the private/no-web prompt boundary still wins. The Swift escalation body opts in, the escalation prompt directs grounding in the lookup, and its timeout is raised to 60s forpause_turncontinuations.Notch polish (as requested):
isVoiceResponseGlowActiveprojection — no new voice state.Follow-up commits (same PR):
fix(desktop): PTT stuck after a barge-in (user-reported: PTT didn't stop after asking for the weather; chat appeared to show a duplicate). Root cause:providerReplacementReady(the barge-in session replacement) unconditionally rewrote the voice route from.hubWarmWaitto.hub, stealing the captured-audio handoff that onlyhubReadycan flush — so the turn had no armed deadline and hung ~2.5 minutes until the provider's idle teardown (log: turnC6BFD805,dropped stale event ... deadline_fired, terminal only at +150s). Both provider-ready admissions now converge on onebindProviderReadyHubRoutehelper that never overwrites a manager-owned warm capture (Failure-Class: FC-split-mutation-authority— second competing writer for captured-input ownership). Three hermetic reducer tests reproduce the exact stale-drop and fail on the pre-fix reducer (8 failures), pass post-fix. The "duplicate message" was investigated and is NOT an INV-6 violation: kernelconversation_turnsshows exactly one pair per continuity key; the appearance came from thekernel_turn_taildiagnostic returning both revisions of one turn plus two genuinely distinct weather asks.feat(desktop): notch animations now react to live audio. The mic level was 5 Hz-throttled (waveform looked canned);AudioLevelMonitornow exposes un-throttled live mic + voice-playback levels polled per frame,StreamingPCMPlayertaps the main mixer for the actual audible output RMS, and the mark smooths both with an asymmetric attack/release envelope — the waveform follows the user's voice and the speaking pulse follows the assistant's speech (with a floor so quiet stretches still breathe).Internet-search findings (live-verified):
web_searchtool call with current market data).omi_web_searchopt-in exists only on this branch, and deployed gateways silently ignore the unknown field. Side-by-side proof with the identical escalation request: deployed dev backend →web_search_requests: 0plus a hallucinated tool-call and an "I don't have web access" answer; this branch's gateway →web_search_requests: 1with real source URLs. Three live PTT weather turns against the patched gateway completed withweb_search_exposed=trueand real current conditions.should_record_web_search_fallbackstill required client tools, so a voice escalation that asked for web and lost it (haiku route / kill switch) emitted nochat_retrievalfallback event — the exact regression the opt-in should surface was telemetry-blind. Fixed with the predicate mirroringinject_web_search; two regression tests;cargo test --locked390 pass.desktop_backend_auto_dev.ymlis merge-triggered; branch deploys are impossible by design). Omi Beta/stable users need a separate, explicitly-approveddesktop_backend_prod.ymlrun after merge.Product invariants affected
swift_realtimeruns only; the guard testagent/tests/run-tool-capability.test.tsgains behavioral coverage that a swift_realtime run authorizesask_higher_modelend-to-end and a plain chat run still cannot.VoiceTurnReducerTests.ChatProvidertimeline and kernel journal flow are untouched.Failure class (fixes)
Failure-Class: new
New class registered in this PR: an authority admitting tool invocations must compute its allowlist from the same manifest projection that advertised the tool to the invoking surface. Guard artifact: the behavioral capability test above.
The
omi_web_searchstarvation fix declares no class of its own (single-instance heuristic gap; the release-boundary web-search probes already guard the deployed behavior).Verification
npx vitest run tests/run-tool-capability.test.ts— 17/17 pass (new: swift_realtime surface-tool authorization + chat-run exclusion).cargo test omi_web_search— 2/2 pass (opt-in injectsweb_searchwith no client tools; explicit private/no-web turns stay tool-free).cargo checkclean../scripts/agent-logic-harness.sh— all four stages green (Swift lifecycle/state, agent runtime, pi-mono-extension, propagation self-check)../scripts/agent-logic-harness.sh --cross-surface-smoke— green (Swift, agent, Rust retrieval contract).xcrun swift test --filter "NotchVoiceMorphMarkTests|OpenOmiShortcutSummonRoutingTests"— 14/14 pass (new: speaker-pulse bounds/containment, envelope shape, amplitude ceiling, reduce-motion).make preflight— manifest checks pass with this PR body.terminal_successwithstale_event_count=0(previously the second turn wedged for 150s). Reducer regression tests cover the exact pre-fix wedge hermetically.VoiceLevelSmootherattack/release/clamp/time-gap, speaking-level modulation floor/ceiling,StreamingPCMPlayer.rmsLevelon known buffers — 20/20 pass with the containment suite.omi-ptt-fixbuilt and launched viaOMI_APP_NAME=omi-ptt-fix ./run.sh --yolo. Live voice-path proof — a natural authenticated PTT turn with real synthesized speech ("What's the weather in New York City right now?") throughptt_test_turn:kernel rejected tool ask_higher_model code=tool_not_allowedwith a 112-byte error result. No rejection occurs on this build; the escalation completes and the reply is spoken.Note: the
omi_web_searchgateway change takes effect in the deployed desktop backend via its normal Cloud Run release lane (whose candidate probes already require a real provider-reported web search); the client sends the opt-in immediately and older backends ignore the unknown field harmlessly.Latest UI iterations
The notch speaking/listening animation went through several passes after the initial audio-reactivity fix, each refining shape and responsiveness while staying on the same reducer-owned
isVoiceResponseGlowActiveprojection (no new voice state added):e237326c59— circular sound-wave speaking ring (replacing the earlier pulse) plus a snappier input waveform response.45d9de2a5f— unidirectional wave propagation and a tail-of-phrase gate hangover so the ring doesn't cut off abruptly at the end of an utterance.9773a8a43b— equalizer-spike input wave and a brisker three-crest speaking ripple for a more percussive, less sluggish feel.df2e003808(current head) — final iteration: uniform fast-spiking ring expansion with a 12ms attack / 90ms release envelope, tuned to track live mic/playback RMS without overshoot.Verification of the latest state:
xcrun swift test --filter NotchVoiceMorphMarkTests— 16/16 pass on the current head (grew from 14/16 as the ring-expansion iterations added coverage).com.omi.omi-ptt-fixbundle and ranptt_test_turnwith real synthesized speech end-to-end — reachedterminal_success, confirming the animation and escalation path both work together on the final build, not just in unit tests.🤖 Generated with Claude Code