Skip to content

Release v0.106.2 — the talking clock's tone sounds on the second it announces - #107

Merged
tesseractAZ merged 1 commit into
mainfrom
fix/clock-tone-on-time
Sep 23, 2026
Merged

tesseractAZ merged 1 commit into
mainfrom
fix/clock-tone-on-time

Conversation

@tesseractAZ

Copy link
Copy Markdown
Owner

The clock read the time, spoke it, and only then sounded the tone, so the tone marked the moment the readout began. Measured against the shipped recordings, that is 4.5–8.6 s late (median 6.8 s), and different at every time of day.

Now: clock_speak.plan() names the first whole second that its own readout, started now, can finish before. Each candidate second is judged on its own readout, since the length changes with the digits. The AGI speaks it, waits for it, and sounds the tone on it. lead_pause_s() puts the slack before the numbers, so the tone always follows "…seconds" by the same 0.4 s beat; around the top of the hour it would otherwise have left up to 4.4 s of silence before the tone. The dialplan tone becomes a fallback, played only if the AGI did not sound it.

Tests: a readout-length model built from the prompt lengths measured on the live PBX. The planner is checked at 900 points across a day (reachable, minimal, fixed beat before the tone), plus midnight rollover. The AGI runs end to end on a fake clock (tone on the second, hangup mid-readout plays no tone), and the dialplan fallback is pinned. Mutation-checked; the one survivor is equivalent.

Each cycle logs [clock] HH:MM:SS tone ±N ms, which is what the live check reads.

🤖 Generated with Claude Code

…nnounces

The clock AGI read time.localtime(), spoke it, and the dialplan sounded the
tone afterwards, so the tone marked the moment the readout BEGAN: 4.5-8.6 s
late with the shipped recordings (median 6.8 s), different at every time of
day.

- clock_speak.plan(): the first whole second whose own readout, started now,
  ends TONE_MARGIN_S before it — judged per candidate, since the length
  changes with the digits. number_files() mirrors Asterisk's English SAY
  NUMBER; readout_seconds() sums the real prompt lengths plus a per-command
  cost.
- lead_pause_s(): the slack goes BEFORE the numbers, so the tone always
  follows "...seconds" by the same beat (the top of the hour otherwise left
  up to 4.4 s of silence before the tone).
- The AGI waits for the planned second and sounds the tone itself; the
  dialplan's Playback is only the fallback when SW_CLOCK_TONE is unset.
- One journal line per cycle: the second named and the tone's error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tesseractAZ
tesseractAZ merged commit 72bf76a into main Sep 23, 2026
10 checks passed
@tesseractAZ
tesseractAZ deleted the fix/clock-tone-on-time branch September 23, 2026 23:26
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