fix: keep polling wait_for_result on call_not_ready - #40
Open
Arshgill01 wants to merge 1 commit into
Open
Arshgill01 wants to merge 1 commit into
Arshgill01 wants to merge 1 commit into
Conversation
Docs define call_not_ready as not terminal yet, so the waiter should poll again until the deadline instead of raising after one GET. Co-authored-by: Cursor <cursoragent@cursor.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.
What
CalleCalls.wait_for_resultcontinues polling when GET/v1/calls/{id}returnsCalleAPIErrorwithcode == "call_not_ready", until the existing deadline. Other API errors still raise.Why
https://docs.heycall-e.com/errors.md says: "
call_not_readymeans the call task has not reached a terminal state." That is a poll-again signal. The waiter had no special case, so any 4xx fromget()ended the loop after one request.This touches the same
wait_for_resultloop as #30 (status vs result predicate, and polling-argument validation). This PR does not change those. It only treats the documentedcall_not_readycode as non-terminal.Does not touch non-JSON
JSONDecodeErrorhandling (#39).Evidence
Offline,
httpx/respxonly. No live API request and no phone call.Before: mocked GET 409
{error:{code:"call_not_ready", message:"The call task has not reached a terminal state."}}then a completed body.After:
test_wait_for_result_retries_call_not_readyasserts the completed call androute.call_count == 2.Test
uv run --locked pytest -q tests/test_calls.pyandruff/mypyas above.Source
From the CALL-E hackathon feedback lab: https://github.com/Arshgill01/ExactRef/blob/main/docs/feedback/lab/XR-806-call-not-ready-aborts-wait.md
Made with Cursor