Repository navigation
perf(tickets): fetch Asana task context concurrently - #3293
IsmaelMartinez merged 2 commits into
Conversation
Signed-off-by: hwan <3373484735@qq.com>
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks for the #3292 write-up, the call chain in it made this quick to follow.
Close. The concurrency itself is well pinned: with the source reverted to main both new tests go red, and the three-ticket cap, warning text and partial-failure behaviour are unchanged.
The one gap is the behaviour you lead with in the description. Delete the whole except BaseException body and test_asana_ticket_batch_cancellation_cleans_up_in_flight_fetches still passes, because that test only distinguishes sequential from concurrent. The block does earn its place, gather leaves siblings running when a child raises BaseException, so a case for that would pin it.
The CodeQL alert on await batch is a false positive. I will dismiss it.
Signed-off-by: hwan <3373484735@qq.com>
|
Thanks for catching that gap. I added The new test starts all three fetches, makes one child raise a custom As a baseline-red check, I temporarily removed the I also reran the related suite ( Thanks as well for confirming that the CodeQL alert is a false positive. |
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks for the clean follow-through. I repeated your mutation check on a merge with today's main: with the except BaseException body removed, the child-abort test fails with two sibling fetches still active, and restoring the cleanup returns the file to 40 passing. The fresh CodeQL alert on await batch is the same false positive flagged on the earlier commit; I will dismiss it. Ready to merge, closing #3292.
Summary
Problem and root cause
With ticket analysis enabled,
/reviewresolves related tickets before prompt construction and the first model call._fetch_asana_ticket_contentsawaited up to three independent Asana HTTP reads one at a time, so pre-model latency grew with the sum of their response times.The change keeps one authenticated
aiohttp.ClientSessionand the existing three-ticket cap, but starts the validated requests as a bounded batch. Results are consumed in original input order, so prompt context and downstream merge/publication behavior do not depend on completion order.Benchmark
Offline fixed workload: three valid task URLs, 20 ms deterministic async I/O per task, two warmups, 30 measured batches, Python 3.12.14, Linux/aarch64.
Formula:
(baseline - optimized) / baseline * 100%.This is an offline orchestration benchmark, not a claim about live Asana or end-to-end model latency.
Semantics preserved
Tests
pytest tests/unittest/test_ticket_compliance.py tests/unittest/test_ticket_pr_compliance_capabilities.py tests/unittest/test_fetching_sub_issues.py tests/unittest/test_retry_with_fallback_models.py tests/unittest/test_pr_reviewer_core.py tests/unittest/test_pr_description.py -qpytest -qruff check .pre-commit run --all-filesuv.lockCloses #3292