Skip to content

Add HD realtime voice and stabilize scheduled CI - #109

Merged
dimavrem22 merged 7 commits into
mainfrom
fix/hd-voice-ci
Sep 8, 2026
Merged

Add HD realtime voice and stabilize scheduled CI#109
dimavrem22 merged 7 commits into
mainfrom
fix/hd-voice-ci

Conversation

@dimavrem22

@dimavrem22 dimavrem22 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Executive Summary

Add HD realtime calling and repair scheduled CI reliability.

  • Negotiate 16 kHz PCM call audio with streaming conversion to the realtime session’s 24 kHz PCM format.
  • Preserve legacy 8 kHz calling and cover Python 3.13 dependency installation.
  • Restore scheduled failure reporting, bound stalled installer attempts, and clarify live voice requests.

Description

The call upgrade selects mono signed little-endian PCM16 at 16 kHz. Each call owns independent streaming converters, selected from its start-frame format; legacy calls retain 8 kHz μ-law compatibility. Output conversion state resets at audio completion and interruption, including incomplete samples.

Text-channel prompts distinguish schema discovery from execution through the host’s deferred tool bridge, while retaining direct calls when tools are directly exposed. Scheduled reporting now checks out trusted default-branch scripts before execution. Live host installation has bounded download and execution attempts. Concurrent completion events claim their call before transcript retrieval, preventing duplicate post-call turns. Exact message bodies and their punctuation are preserved verbatim across initial and correction prompts without repeating accepted sends. Hosted voice tests issue the original request once, with reminders and re-asks disabled; transcript, action-persistence, correlation, and exactly-once delivery assertions remain unchanged.

Reason

Realtime calls should preserve wideband audio, and a transient installation stall or ambiguous live request should not prevent CI from exercising the plugin or reporting failures.

Decisions

  • Audio rates: Use 16 kHz PCM on the call connection and resample to 24 kHz because that is the supported realtime PCM session rate.
  • Compatibility: Use 8 kHz μ-law when the start-frame descriptor is absent, preserving legacy call connections.
  • Live proof: Require an unassisted first request, durable post-call action, autonomous wakeup, and exactly one matching SMS; no caller reminders or re-asks.

Testing

  • Unassisted full-stack CI: all 14 jobs passed on 126e7a3, including real/mock channels, all five A2A scenarios, all four voice scenarios, external events, and the final gate.
  • uv run pytest -q: 617 passed, 25 skipped locally (host-contract and authenticated live lanes require their CI environments).
  • uv run ruff check ., bash -n tests/ci/install_hermes.sh, and git diff --check: passed.
  • Realtime calling: byte-level tests verify 16↔24 kHz tone frequency, amplitude, duration, arbitrary chunk boundaries, silence, handshake headers, legacy conversion, and interruption reset.
  • Hosted completion: concurrent events with different event IDs enqueue one turn; failed enqueue releases admission for a safe retry.
  • Deferred host tools: 15 contract checks passed locally against current Hermes; describing a synthetic action does not execute it, and tool_call executes it exactly once.
  • Host installation: a deliberately hung installer attempt is terminated and the next attempt succeeds.
  • Realtime live calling: require the current call’s negotiated pcm_s16le / 16000 diagnostic as well as two-way speech and disabled built-in speech processing; legacy fallback cannot satisfy the HD proof.
  • Hosted calling: passed in 71 seconds with re-asks disabled and no reminder prompt. The original single request produced the required persisted action; Hermes autonomously enqueued and completed post-call reconciliation, and exactly one fresh SMS contained the run’s normalized marker after hangup. This checks marker containment, not byte-for-byte body equality.

@dimavrem22
dimavrem22 marked this pull request as ready for review September 7, 2026 20:25
@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown

Greptile Summary

The PR upgrades realtime calling to negotiated 16 kHz PCM audio while retaining legacy 8 kHz μ-law support, and improves scheduled CI reliability.

  • Adds stateful, per-call conversion between call audio and the realtime session’s 24 kHz PCM format.
  • Prevents concurrent hosted-call completion events from enqueueing duplicate post-call work.
  • Clarifies deferred tool execution and preserves exact post-call message bodies.
  • Adds bounded installer attempts, trusted reporting-script checkout, and Python 3.13 coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
audio.py Introduces streaming PCM16 resampling, partial-sample buffering, and legacy μ-law conversion scoped to each call.
realtime.py Negotiates 24 kHz realtime PCM and converts inbound and outbound audio according to the call start descriptor.
adapter.py Adds HD call negotiation, hosted-completion admission control, and stronger action-execution and exact-message guidance.
tests/ci/install_hermes.sh Bounds installer downloads and execution time while retaining retry behavior.
.github/workflows/scheduled-failure-report.yml Checks out trusted default-branch reporting scripts before posting scheduled failure notifications.
pyproject.toml Adds the Python 3.13 audioop compatibility dependency.
uv.lock Locks audioop-lts and adjusts Python-version resolution markers without changing the pre-existing aiohttp version.

Sequence Diagram

sequenceDiagram
    participant Inkbox as Inkbox Call
    participant Bridge as Realtime Bridge
    participant OpenAI as Realtime Session
    Inkbox->>Bridge: Start frame with media format
    Bridge->>Bridge: Configure per-call converters
    Inkbox->>Bridge: 16 kHz PCM or legacy 8 kHz μ-law
    Bridge->>OpenAI: Resampled 24 kHz PCM
    OpenAI->>Bridge: 24 kHz PCM response
    Bridge->>Inkbox: Negotiated call-format audio
    OpenAI-->>Bridge: Audio done or interruption
    Bridge->>Bridge: Reset outbound conversion state
Loading

Reviews (5): Last reviewed commit: "Restore unassisted hosted voice completi..." | Re-trigger Greptile

@dimavrem22
dimavrem22 merged commit 3a14931 into main Sep 8, 2026
22 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