Release v0.106.2 — the talking clock's tone sounds on the second it announces - #107
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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