Skip to content

fix(runs): check cancellation through repositories#1205

Merged
federicodeponte merged 1 commit into
mainfrom
fix/1161-repo-cancel-check
Jun 15, 2026
Merged

fix(runs): check cancellation through repositories#1205
federicodeponte merged 1 commit into
mainfrom
fix/1161-repo-cancel-check

Conversation

@federicodeponte

Copy link
Copy Markdown
Member

Summary

  • route agent and E2B cancellation reads through the active run repository instead of direct local SQLite
  • keep fail-closed cancellation behavior and metrics for repository read failures
  • add regressions for repository-backed agent cancellation polling and E2B killed-sandbox classification

Fixes #1161.

Verification

  • python3 -m ruff check apps/api/runner_sandbox/cancellation.py apps/api/runner_sandbox/agent_driver.py apps/api/runner_sandbox/e2b_driver.py apps/api/tests/test_e2b_cancel_on_user_request.py tests/test_e2b_artifact_collection.py
  • python3 -m compileall -q apps/api/runner_sandbox/cancellation.py apps/api/runner_sandbox/agent_driver.py apps/api/runner_sandbox/e2b_driver.py
  • python3 -m pytest apps/api/tests/test_e2b_cancel_on_user_request.py tests/test_e2b_artifact_collection.py::test_e2b_cancelled_sandbox_exception_reads_active_repository tests/test_e2b_artifact_collection.py::test_e2b_driver_maps_oom_command_exception_to_sandbox_oom -q -> 7 passed

Note

  • Full python3 -m pytest tests/test_e2b_artifact_collection.py -q currently has 2 unrelated failures on origin/main-era install-timeout expectations: test_long_worker_timeout_extends_install_and_sandbox_lifetime and test_sandbox_lifetime_caps_at_e2b_one_hour_limit expect 900 but current code returns 1200/3600.

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workeros Ready Ready Preview, Comment Jun 15, 2026 1:52pm

Request Review

@federicodeponte
federicodeponte force-pushed the fix/1161-repo-cancel-check branch 2 times, most recently from 24f8528 to 4b2bcd4 Compare June 15, 2026 13:40
@federicodeponte
federicodeponte force-pushed the fix/1161-repo-cancel-check branch from 4b2bcd4 to 4114eb3 Compare June 15, 2026 13:51
@federicodeponte
federicodeponte merged commit d5d2cac into main Jun 15, 2026
8 checks passed
@itachi-hue
itachi-hue deleted the fix/1161-repo-cancel-check branch June 20, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend][P1][cloud-cancel] Cloud run cancellation checks the wrong datastore, so cancelled workers continue or finalize as sandbox errors

1 participant