Repository navigation
fix(cli): apply task wait timeout to in-flight requests - #532
Merged
Sertaç Özercan (sozercan) merged 3 commits intoSep 12, 2026
Merged
Sertaç Özercan (sozercan) merged 3 commits into
Sertaç Özercan (sozercan) merged 3 commits into
Conversation
Jabrail (jabrailkhalil)
requested a review
from Sertaç Özercan (sozercan)
as a code owner
September 9, 2026 19:07
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d1a9a1890
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Derive the polling context from the configured timeout so an expired wait cancels a pending status request instead of accepting a late success. Previously the deadline was only consulted between polls, and a slow API response could arrive after the deadline and still report success. The signal-aware context remains the parent: interrupt/SIGTERM behaves as before and still wins over the timeout. A deadline context is released when the command returns. Both the request-error path and the polling select map DeadlineExceeded to the same user-facing timed-out error. Add httptest coverage: cancellation of a request that is in flight when the deadline fires, timeout between polls, success before the deadline, failed/cancelled phases, and invalid timeout strings. Fixes orka-agents#527. Signed-off-by: jabrailkhalil <jabrailkhalil@gmail.com>
Signed-off-by: jabrailkhalil <jabrailkhalil@gmail.com>
Jabrail (jabrailkhalil)
force-pushed
the
fix/task-wait-deadline
branch
from
September 9, 2026 19:45
3d1a9a1 to
5477658
Compare
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
A slow status response could let
orka task wait --timeoutreport success after the wait expired. Polling and in-flight requests now share one context deadline. The polling loop checks cancellation before accepting a returned phase, and deadline expiry retains thetimed out waiting for task <name>error.Regression coverage includes cancellation during a request, timeout between polls, success before the deadline, failed phases, invalid durations, and a deterministic late-success case. The blocking HTTP test has independent handler shutdown and a two-second timeout allowance for command setup, so a cancellation regression fails without hanging cleanup.
Validation:
make lint-fix && make testgo test ./cmd/cli -run '^(TestTaskWait|TestWaitForTaskPhase)' -count=1 -timeout 30sFixes #527.