fix(nodes): propagate ExecutionError from retry mechanism instead of swallowing it #72
No reviewers
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#71 ConnectionError retry exhaustion silently swallowed, producing empty response instead of propagating ExecutionError
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core!72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/nodes-executionerror-propagation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes a bug where
ExecutionError(kind="timeout")raised bycall_with_retry()when all LLM communication retries are exhausted was systematically swallowed by broadexcept Exceptionhandlers inNode._execute_agent()andNode.execute(). The timeout was converted into an error string in graph state or — in the streaming path — an empty response, making the retry mechanism ineffective.Changes
src/cleveractors/langgraph/nodes.py: Added targetedexcept ExecutionError as ehandlers that checke.kind == "timeout"and re-raise. Non-timeoutExecutionErrorinstances (tool errors, etc.) continue to be caught gracefully, preserving existing behavior for non-retry errors.features/nodes_coverage_gaps.feature): Two new scenarios verify timeout propagation and non-timeout graceful handling.Related
Verification
PR Review: !72 (Ticket #71)
Verdict: Approve
The fix correctly addresses the reported bug.
ExecutionError(kind="timeout")raised when the LLM retry mechanism exhausts its budget is now propagated from bothNode._execute_agent()andNode.execute()instead of being swallowed by broadexcept Exceptionhandlers. The implementation is narrower than the ticket's initial "propagate allExecutionError" sketch, but that narrower scope is intentional and safer: it preserves the existing graceful handling of non-timeout execution errors (e.g., tool parsing failures) while ensuring retry-exhaustion timeouts surface to the caller as required by ADR-2032.No critical or major correctness issues were found. I also checked the PR and ticket comment threads; there are no existing reviewer comments or author responses that would remove items from scope.
Critical Issues
None.
Major Issues
None.
Minor Issues
None.
Nits
None.
Summary
The PR adds a targeted
except ExecutionError as eclause in front of the existing broadexcept Exceptionhandlers inNode.execute()andNode._execute_agent(). Whene.kind == "timeout", the exception is re-raised so it can propagate throughPureLangGraph._execute_from_node()(whose existing handler atpure_graph.py:983already expects limit-enforcement errors to surface) and up to the router with the correct HTTP mapping. Non-timeoutExecutionErrorinstances continue down the original graceful path and are converted to error strings in graph state.The logic is sound:
call_with_retry()raisesExecutionError(kind="timeout", reason="...")per ADR-2032 D-7.LLMAgent.process_message()already preserveskind/reasonwhen re-raising an innerExecutionError, so the timeout identity survives the agent layer.ExecutionErrorbeforeException) and thecurrent_graph_nameContextVar is still reset in thefinallyblock on the timeout path.The only behavior change worth being aware of is that non-timeout
ExecutionErrorno longer reaches the node-levelretry_policyloop inNode.execute(). In practice this is correct behavior—execution-limit/failure errors should not be retried like transient exceptions—but it is a subtle narrowing of theretry_policycontract. No current node type appears to rely on the old behavior. Overall, the change is minimal, focused, and fixes the reported regression without introducing new risks.bcc3b5e459b29ee0996eUpdated with two additional commits:
d0f18ec— Applied the non-blocking review suggestion: changede.kind == "timeout"toif e.kindin both_execute_agent()andexecute()to future-proof against any limit enforcement moving into the agent/node layer (depth, model_calls, tool_calls, cost).d0f18ec(same commit) — Extended_is_http_comms_error()in retry.py to detect provider SDK connection errors (APIConnectionError,APITimeoutError) by class name. Added safety net inprocess_message()to wrap non-retried connection errors asExecutionError(kind="timeout"). The user log output (APIConnectionError: Connection error.) showed that the original fix did not handle these because provider SDK exception types are not subclasses ofhttpx.HTTPError.d0f18ec2e7ceb577e405