feat: implement mid-workflow Agamemnon health checks (#161)#265
Open
mvillmow wants to merge 1 commit into
Open
feat: implement mid-workflow Agamemnon health checks (#161)#265mvillmow wants to merge 1 commit into
mvillmow wants to merge 1 commit into
Conversation
Add out-of-band connectivity monitoring during workflow execution to detect when Agamemnon becomes unresponsive, distinguishing backend failures from slow task execution. Implements: - AgamemnonClient.ping(): single-shot liveness probe via GET /v1/agents (bypasses retry logic to serve as immediate detection signal) - _heartbeat task in WorkflowExecutor: background task that probes every HEALTHCHECK_INTERVAL_SECONDS and sets connectivity_lost event after HEALTHCHECK_FAILURE_THRESHOLD consecutive failures - WorkflowConnectivityError: typed exception raised when threshold exceeded - state.connectivity_failed flag: set before raising to signal teardown - Extended _teardown policy gate: on_completion now also tears down when connectivity_failed=True (fixes resource-leak regression on default policy) - New settings in config.py: * HEALTHCHECK_INTERVAL_SECONDS (default 15) * HEALTHCHECK_FAILURE_THRESHOLD (default 2) * HEALTHCHECK_TIMEOUT_SECONDS (default 5) - 12 test cases covering ping() semantics, threshold logic, lifecycle, and teardown policy interactions Fixes the resource-leak regression where on_completion (the default) would not tear down agents/teams if Agamemnon failed mid-workflow. Closes #161 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
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
Adds out-of-band connectivity monitoring during workflow execution to detect when Agamemnon becomes unresponsive, distinguishing backend failures from slow task execution.
Test plan
Closes #161
🤖 Generated with Claude Code