Skip to content

Bound voice-command's context fetch and back off the fault poller - #32

Merged
Nicolas Palpacuer (NickPPC) merged 1 commit into
mainfrom
voice-command-bounded-status
Nov 18, 2026
Merged

Nicolas Palpacuer (NickPPC) merged 1 commit into
mainfrom
voice-command-bounded-status

Conversation

@NickPPC

Copy link
Copy Markdown
Collaborator

Summary

Stop a slow or wedged command_status resource from stalling voice turns for minutes. Each turn waited on the resource's Status() with no timeout. On a beanjamin machine whose customer detector had stopped answering, every reply took 10 minutes, the gRPC deadline.

Changes

  • The per-turn context fetch gives up after 3 s: a status or sensor slot still running is passed to the model as {"error": ...}, so the reply goes ahead with partial context
  • The fault poller backs off to 5 s after a failed poll: the 1 s timeout made a slow source receive a new request every 500 ms while it was still working on the cancelled ones, which is how the detector backed up
  • Sources that have never published fault_active are polled every 5 s: a resource that only describes the scene (a customer detector) never sets the flag; once a source has published it, polling stays at 500 ms

❓ Open question: a source that only includes fault_active while it is raised would see its first fault up to 5 s late. beanjamin's coffee service always publishes the key; is that a safe convention to rely on?

Testing

  • New voice_command_test.go, the package's first tests: a hanging Status() is cut off at 3 s, fetchCommandFault tells raised, lowered and missing flags apart, and the poller's rate for publishing, silent and failing sources; go test -race and golangci-lint pass
Claude Code prompts used
  • "I just tried it and it took multiple minutes to answer and it now seems stuck. Can you check the logs and try to figure out what happens?"
  • "Do all 3"

🤖 Generated with Claude Code

Every turn fetched the command_status resource's Status() and the
sensors' Readings() with no timeout before calling the LLM, so a wedged
source held the reply until the RPC's own deadline (10 minutes on
Cappuccina, where the customer detector had stopped answering).
fetchContext now gives up after 3 s and passes the partial data on.

The fault poller asked the command_status resource for fault_active
twice a second with a 1 s timeout, even when the resource never
publishes the flag or keeps failing. Against a slow source that queues
cancelled requests faster than it can finish them. It now polls every
5 s until the source has published fault_active, and for 5 s after any
failed poll.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NickPPC
Nicolas Palpacuer (NickPPC) merged commit b52d0c0 into main Nov 18, 2026
3 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