Repository navigation
fix: allow retrying failed voice compute turns - #13
Conversation
NathanTarbert
left a comment
There was a problem hiding this comment.
Thanks @charan-rathore. Clearing only the failed entry is a nice small change. Calls that are in flight still share one promise and successful results stay cached, and the comment makes the intent easy to follow.
One thing worth weighing. job.calls is also what the six-turn cap counts, so removing failed entries means failed turns stop counting toward it. With a provider that keeps failing, a call can now start as many turns as the model asks for, not six. Each one can still use up to 90 seconds of model time and run tools before it fails. The test "does not count failed compute calls toward the six-turn limit" shows this is deliberate. I just wanted to name the cost. If the goal is mainly to let the same tool call retry, one option is to keep counting every attempt toward the cap while still allowing a retry under the same id. Happy to go with whichever the maintainers prefer.
Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
|
Thanks, good catch. Pushed 642afcd: the cap now counts attempts instead of the size of the call map. A failed turn is still removed from the map so the same tool ID can retry, but every attempt, including a retry of the same ID, counts toward the six. I replaced the old "does not count failed calls" test with two that fail on the previous commit: six failed IDs hit the cap on the seventh, and six retries of one ID do too. Ran: full vitest (160 passed), tsc, prettier on the two files. Not run: eslint beyond those files. Prepared with AI assistance; Charan Rathore is directing and responsible for this PR. |
|
Thanks @charan-rathore, that's exactly the shape I had in mind. A failed id can retry, and every attempt still counts toward the six. The two tests for six failed ids and six retries of one id pin down both halves nicely. Looks good to me. |
jerelvelarde
left a comment
There was a problem hiding this comment.
Useful voice tool retry fix: failed computations can be retried, successful results remain cached, and all attempts still consume the bounded six-attempt budget. Checked concurrent failure deduplication, successful retry caching, cancellation, and rejection after call termination. No actionable security or correctness findings. Individual full checks pass; combined tree passes 233 tests, type checking, lint, formatting, and production build. Live provider calls were not exercised.
A failed compute request during a call can be retried instead of being stuck, and failed attempts still count toward the per-call turn cap. Ported from CopilotKit/OpenDots#13 (upstream commit 6b67b74).
Brings in CopilotKit/OpenDots main (625452e): dark mode, per-Dot MCP connections with owner approval, page deletion, the current time in Dot prompts, time-limit errors, and about 25 smaller fixes. Conflicts resolved toward this fork's design where the two differ: - dot-agent keeps OpenCode delegation, background tasks and the spoken reply instructions alongside upstream's connection tools and telemetry; the turn time limit stays turnTimeoutMs so OpenCode work still fits, and now produces upstream's time-limit error. - voice keeps browser speech recognition and Piper TTS instead of upstream's Realtime/WebRTC call. Of upstream's voice fixes, CopilotKit#13 (retry a failed compute turn, failures count toward the cap) and CopilotKit#39 (survive up to two failed control polls) are ported; CopilotKit#26's peer-connection grace period has no equivalent and its tests are dropped. The control-poll tests are adapted to the cascaded hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: allow retrying failed voice compute turns * fix: count failed voice compute attempts toward the turn cap Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com> --------- Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
What this fixes
The voice compute cache kept a promise even when it rejected. A failed compute stayed in the cache for good, so it used up one of the six turns allowed per call, and retrying with the same
toolCallIdfailed again every time.Changes
Tests
Two regression tests (a failed compute can be retried, and the failure is not left in the cache). They fail on the base commit. I also added a test that guards the success cache and the six-turn cap. The tests use no external API.
Results below are from the person who prepared the change; I did not rerun them. Full suite: 34 files, 159 tests pass. Lint, typecheck, format check and production build pass (the build prints a chunk size warning that was already there). No dependency or lockfile changes.