fix(core): thread circuit breaker generation and release slots in execute_tool #338
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 185 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.313
Real PR Conversation Timeline
1 comments
"Review active on #338"
general
weight: 0.35
myselfkunal
Description
In progressive and semantic modes,
execute_tool()was callingbreaker.can_execute(), which discards the returned generation integer. Because of this, subsequentrecord_success()andrecord_failure()calls passedgeneration=None, bypassing the half-open staleness guard inCircuitBreaker.In addition, neutral responses (non-infrastructure errors like not found or validation failures) were being recorded as successes rather than having their half-open probe slots released.
This change:
execute_tool()to usebreaker.acquire()and passes the generation integer torecord_success(generation)andrecord_failure(generation).breaker.release(generation)for neutral results whenis_successis False andis_infrastructure_erroris False.dynamic_tools_test.pycovering generation passing, stale probe rejection across window rollover, and slot release on neutral responses.Related Issue
Fixes #337
Checklist
make test-python)make verify)git commit -s)Testing
Ran unit tests locally on unfixed
main(confirmed new tests fail) and on this branch (make test-pythonandmake verifyboth pass).