Repository navigation
Live: a tool that never answers no longer mutes the model for the rest of the night - #36
Conversation
…t of the night
One wake launched an app on the TV and then said nothing. The next wake
said nothing either, and the one after that. The device did what it was
asked and the room heard silence.
The MCP call is awaited with no timeout, so a Home Assistant tool that
takes a request and never returns leaves its function call open. The Live
API refuses every `response.create` while one is unanswered
("function_call_outputs_required"), and the refusal is fatal to the
service: the pipeline is torn down and rebuilt. Worse, the open calls are
cleared only when the socket drops, and the socket is deliberately kept
warm between wakes, so one tool that did not come back is enough to mute
every wake after it.
Exactly one output per call is the API's invariant, so the broker keeps
it whatever the tool does:
- a call that has not come back within six seconds is answered here, with
an error, so the model can speak; Home Assistant answers in
milliseconds, and six seconds still leaves room to reply inside the
hygiene watcher's twelve;
- a call still open when a new wake begins belonged to a wake that is
over, and is dropped rather than carried forward;
- and the backstop waits for open calls before asking for a reply, so a
correction is never sent over the top of a tool call.
Read off the output tapes of the evening this came from: of three wakes,
two played nothing at all to the device, and the third answered only
after being sworn at. After the change, two three-turn conversations
delivered every answer, with only filler dropped.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HMrdB2Qn92kNxGz9Ps2iXj
|
@coderabbitai review |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Live service now times out unanswered tool calls, waits for open calls before creating responses, clears pending calls at session start, and adds regression coverage for these behaviors. ChangesLive tool-call watchdog
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant LiveAPI
participant VoicePELiveService
participant ToolWatchdog
LiveAPI->>VoicePELiveService: delegated tool call
VoicePELiveService->>ToolWatchdog: schedule _answer_if_stuck
ToolWatchdog->>LiveAPI: send error function-call output
VoicePELiveService->>LiveAPI: create response after open calls close
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Action performedReview finished.
|
One wake launched an app on the TV and then said nothing. So did the next one, and the one after that.
Cause. The MCP call is awaited with no timeout, so a Home Assistant tool that takes a request and never returns leaves its function call open. The Live API refuses every
response.createwhile one is unanswered (function_call_outputs_required), and that refusal is fatal to the service. Open calls are cleared only when the socket drops, and the socket is kept warm between wakes on purpose, so one tool that did not come back mutes every wake after it.Fix. Exactly one output per call is the API's invariant; the broker now keeps it whatever the tool does. A call that has not come back in six seconds is answered here with an error. A call still open when a new wake begins is dropped. The backstop waits for open calls before asking for a reply.
Evidence. From the output tapes of the evening this came from: of three wakes, two played nothing at all to the device. After the change, two three-turn conversations delivered every answer, with only filler dropped. 21 hygiene tests green.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HMrdB2Qn92kNxGz9Ps2iXj
Summary by CodeRabbit