fix(tasks): terminalize runs when sandbox relay closes - #80330
Conversation
Generated-By: PostHog Code Task-Id: 69d90c03-1afe-414c-af6e-1fce5a051612
|
😎 Merged successfully - details. |
Generated-By: PostHog Code Task-Id: 69d90c03-1afe-414c-af6e-1fce5a051612
🦔 ReviewHog reviewed this pull requestFound 0 must fix, 1 should fix, 1 consider. Published 2 findings (view the review). |
Prompt To Fix All With AI### Issue 1
products/tasks/backend/temporal/process_task/activities/tests/test_relay_sandbox_events.py:654-669
**Incomplete reconnect-flow coverage**
The new clean-close test exercises only one reconnect before success, leaving the reconnect counter, backoff sequence, and sandbox-gone result at budget exhaustion unprotected against regressions. Cover multiple consecutive clean closures through the exhaustion branch as required for new retry logic.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(tasks): reconnect clean sandbox stre..." | Re-trigger Greptile |
Generated-By: PostHog Code Task-Id: 69d90c03-1afe-414c-af6e-1fce5a051612
|
ReviewHog Alpha 🦔 If you find any issues helpful - please reply "valid", "invalid", etc., for evaluation purposes 🙏 |
Generated-By: PostHog Code Task-Id: 69d90c03-1afe-414c-af6e-1fce5a051612
Generated-By: PostHog Code Task-Id: 69d90c03-1afe-414c-af6e-1fce5a051612
🤖 CI report
|
| File | Patch | Uncovered changed lines |
|---|---|---|
products/tasks/backend/temporal/execute_sandbox/workflow.py |
0.0% | 1387, 1418–1419 |
products/tasks/backend/temporal/process_task/workflow.py |
0.0% | 1954, 1977–1978, 1982 |
products/tasks/backend/temporal/process_task/activities/tests/test_relay_sandbox_events.py |
0.0% | 376–379, 381, 385–386, 450, 460, 499, 509, 651, 674, 679–681, 686, 695, 704–707, 711, 714, 719–720, 722–723, 725–726, 728–729, 731–733, 735, 737–738, 740–741, 743–745, 747, 756–761, 909, 911, 923 |
products/tasks/backend/temporal/process_task/activities/relay_sandbox_events.py |
16.7% | 101, 107, 172, 202, 493, 497–501, 506–507, 532–533, 564, 569, 580–583 |
🤖 Agents: add a test covering the lines above, or note why under "How did you test this code?". Machine-readable gap list: the patch-coverage artifact on this run (gh run download 31377512440 -n patch-coverage), or the coverage-data block at the end of this comment.
Per-product line coverage (touched products)
| Product | Coverage | Lines |
|---|---|---|
demo |
███████████░░░░░░░░░ 56.3% |
1,497 / 2,661 |
tasks |
██████████████░░░░░░ 70.3% |
35,576 / 50,625 |
signals |
█████████████████░░░ 82.6% |
27,320 / 33,075 |
cdp |
█████████████████░░░ 84.2% |
3,914 / 4,649 |
notebooks |
█████████████████░░░ 86.4% |
8,029 / 9,296 |
data_modeling |
█████████████████░░░ 86.5% |
8,459 / 9,782 |
actions |
█████████████████░░░ 86.6% |
717 / 828 |
cohorts |
██████████████████░░ 87.6% |
6,482 / 7,400 |
managed_warehouse |
██████████████████░░ 87.8% |
5,928 / 6,752 |
product_tours |
██████████████████░░ 87.9% |
1,303 / 1,482 |
data_warehouse |
██████████████████░░ 88.4% |
11,653 / 13,185 |
exports |
██████████████████░░ 89.1% |
7,490 / 8,406 |
engineering_analytics |
██████████████████░░ 89.3% |
6,759 / 7,570 |
dashboards |
██████████████████░░ 89.4% |
6,001 / 6,710 |
alerts |
██████████████████░░ 90.3% |
4,482 / 4,966 |
mcp_analytics |
██████████████████░░ 90.4% |
3,968 / 4,388 |
conversations |
██████████████████░░ 90.5% |
18,337 / 20,256 |
canvas |
██████████████████░░ 90.6% |
2,080 / 2,296 |
streamlit_apps |
██████████████████░░ 90.7% |
2,630 / 2,901 |
error_tracking |
██████████████████░░ 91.1% |
11,147 / 12,237 |
stamphog |
██████████████████░░ 91.3% |
4,505 / 4,936 |
slack_app |
██████████████████░░ 91.7% |
10,813 / 11,789 |
ai_observability |
███████████████████░ 92.9% |
17,116 / 18,426 |
early_access_features |
███████████████████░ 92.9% |
1,347 / 1,450 |
web_analytics |
███████████████████░ 93.1% |
15,963 / 17,154 |
marketing_analytics |
███████████████████░ 93.1% |
15,445 / 16,591 |
surveys |
███████████████████░ 93.2% |
5,919 / 6,349 |
posthog_ai |
███████████████████░ 93.3% |
1,327 / 1,423 |
reminders |
███████████████████░ 93.4% |
468 / 501 |
approvals |
███████████████████░ 93.5% |
3,491 / 3,734 |
product_analytics |
███████████████████░ 93.5% |
7,095 / 7,587 |
workflows |
███████████████████░ 94.3% |
7,951 / 8,436 |
endpoints |
███████████████████░ 94.3% |
8,771 / 9,306 |
review_hog |
███████████████████░ 94.6% |
8,246 / 8,715 |
skills |
███████████████████░ 94.8% |
3,496 / 3,687 |
logs |
███████████████████░ 95.6% |
11,815 / 12,362 |
replay_vision |
███████████████████░ 95.7% |
18,220 / 19,043 |
experiments |
███████████████████░ 95.8% |
28,701 / 29,962 |
annotations |
███████████████████░ 96.2% |
732 / 761 |
revenue_analytics |
███████████████████░ 96.3% |
1,887 / 1,960 |
data_quality |
███████████████████░ 96.4% |
747 / 775 |
feature_flags |
███████████████████░ 96.4% |
17,770 / 18,429 |
user_interviews |
███████████████████░ 96.5% |
2,638 / 2,734 |
customer_analytics |
███████████████████░ 96.6% |
11,420 / 11,816 |
warehouse_sources |
███████████████████░ 97.5% |
380,922 / 390,776 |
data_catalog |
████████████████████ 97.9% |
2,677 / 2,734 |
pulse |
████████████████████ 98.4% |
2,017 / 2,049 |
Report-only. Patch coverage = changed backend lines covered vs origin/master. Sorted lowest first.
Known gaps: lines covered only by Temporal tests show as uncovered; core line numbers may drift if master changed the same file.
Problem
A closed sandbox relay must update the run lifecycle before another message is routed to the unavailable agent server. Regression found from #74038
Changes