fix: auto-disable unhealthy automations - #352
Open
malhotra5 wants to merge 3 commits into
Open
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
|
🔍 Review in progress… We are performing the review through OpenHands Cloud Automation. You can log in and view the conversation here. |
malhotra5
marked this pull request as ready for review
August 21, 2026 13:26
Co-authored-by: openhands <openhands@all-hands.dev>
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.
Summary
Implements Linear OSS-9472 by auto-disabling automations that repeatedly fail for permanent, user-actionable reasons and exposing the current blocking reason on the automation API response.
Changes include:
status_detail/ SDK callback metadata (auth,config,quota,blocked,user_action=settings, non-retryable blocking factors)AUTOMATION_FAILURE_DISABLE_THRESHOLD, default3;<=0disables the behavior)automations(disabled_reason,disabled_detail,disabled_at) for list/detail API consumersautomation_disable_eventshistory table to track each auto-disable occurrence over time409plus the blocking reason/detailrun.status_detailValidation
Passed:
uv run ruff check openhands/automation/models.py openhands/automation/config.py openhands/automation/dispatcher.py openhands/automation/router.py openhands/automation/schemas.py openhands/automation/utils/run.py openhands/automation/utils/run_status_detail.py openhands/automation/utils/unhealthy.py tests/test_unhealthy_automations.py tests/test_schemas.py tests/test_run_status_detail.py tests/test_dispatcher.py tests/test_router.py migrations/versions/017_add_automation_disabled_reason.pyuv run pyright openhands/automation/models.py openhands/automation/utils/run.py openhands/automation/utils/unhealthy.py tests/test_unhealthy_automations.pyuv run pytest tests/test_unhealthy_automations.py tests/test_run_status_detail.py tests/test_schemas.py -qNot run successfully in this environment:
/var/run/docker.sockmissing).Notes
No PR template file was present in
.github/, so this uses the repo's conventional Summary/Validation format.This PR was created by an AI agent (OpenHands) on behalf of the user.
@malhotra5 can click here to continue refining the PR