fix(voice-call): verify call status with provider before loading stale calls#4325
Merged
steipete merged 1 commit intoopenclaw:mainfrom Mar 3, 2026
Merged
Conversation
0ce84d6 to
a9ac6b4
Compare
garnetlyx
pushed a commit
to garnetlyx/openclaw
that referenced
this pull request
Feb 3, 2026
…provider errors as non-terminal - Start maxDuration timer for restored calls that are in active states (not terminal or initiated) - Treat provider lookup errors (network, timeout, etc.) as unknown/non-terminal, keeping calls active - Only treat definite terminal errors (404 not-found) as terminal, skipping those calls - Fixes review comments on PR openclaw#4325
828c2b9 to
3e794d6
Compare
bfc1ccb to
f92900f
Compare
This comment was marked as spam.
This comment was marked as spam.
…e calls On gateway restart, persisted non-terminal calls are now verified with the provider (Twilio/Plivo/Telnyx) before being restored to memory. This prevents phantom calls from blocking the concurrent call limit. - Add getCallStatus() to VoiceCallProvider interface - Implement for all providers with SSRF-guarded fetch - Transient errors (5xx, network) keep the call with timer fallback - 404/known-terminal statuses drop the call - Restart max-duration timers for restored answered calls - Skip calls older than maxDurationSeconds or without providerCallId
3e794d6 to
ffa7c13
Compare
Contributor
Author
|
Rewrote this PR from scratch on current main. The original branch was stale and had CI failures + unaddressed review feedback. What changed in the rewrite:
|
steipete
added a commit
that referenced
this pull request
Mar 3, 2026
Contributor
|
Landed via local merge on
Thanks @garnetlyx! |
Contributor
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
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.
Problem
When the gateway restarts,
loadActiveCalls()reloads non-terminal calls fromcalls.jsonl. However, these calls may have already ended (e.g., Twilio timed them out, or webhook couldn't reach local URL) and are now stale. This causes the concurrent call limit to be reached with phantom calls.Solution
getCallStatus()method toVoiceCallProviderinterfaceguardedJsonApiRequestinitialize(), verify each persisted non-terminal call with the provider before restoringmaxDurationSecondsas a time-based fallbackproviderCallId(can't verify)Fixes from review feedback
answered+ state now get their hangup timers restarted with remaining time calculated fromansweredAtisUnknown: true→ call is kept with timer fallback. Only 404/known-terminal statuses drop the callis_alivesafety: Missingis_alivefield treated as unknown (not terminal)guardedJsonApiRequest(SSRF-guarded)Testing
pnpm tsgo+pnpm checkcleanTest plan