Repository navigation
One failed call no longer pauses a tool; add reset_circuit_breaker (#208) - #213
Merged
Merged
Conversation
…it_breaker (#208) The server routes adapter methods through the intelligent router, which fell back to a VBA adapter built on the same, already-routed adapter. A failed create_extrusion therefore re-entered the router and recursed, counting one failure many times and opening the circuit breaker in the same second; every retry did the same, so the tool looked paused for good. The server log of the U-joint session shows the cycle. The fallback only re-ran the same COM call, so the server no longer passes one. - reset_circuit_breaker re-opens paused operations, all or one by name. Every adapter answers it: the base reports nothing paused, the breaker closes its buckets, the pool resets a shared breaker once. - The circuit_open hint names the tool and the timeout setting. - check_interference is no longer cached by the router: its 60-second cache returned an old result after components moved (#209). - tests/integration/test_circuit_breaker_stack.py drives the server's routing around a real breaker; two of its tests fail on the old code.
…eaker re-opens (#208) Checked on SolidWorks 2026: a failed extrusion counts one failure with the breaker still closed, the next extrusion goes through, and the reset tool re-opens a paused operation. The live regression suite passes alongside it (58 passed, 2 skipped).
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.
Closes #208.
The cause. In the U-joint session, one failed
create_extrusionpaused extrusion for the rest of the session. The server log shows a single failure, then "Circuit breaker opened after 5 failures" in the same second, with a traceback that loops throughserver._routed_call, the intelligent router andVbaGeneratorAdapter.create_extrusionback into_routed_call.The server swaps routed wrappers onto the adapter's methods. Its VBA fallback adapter was built on that same adapter, so a failure fell back into the wrapper and recursed. One failure counted many times. Every retry after the timeout really failed too, because the sketch had already been used, and did the same. That's why the breaker looked like it never recovered. The fallback only re-ran the same COM call, so the server no longer uses it.
What changes
reset_circuit_breaker: a new tool that re-opens paused operations, all of them or one by name. Every adapter answers it: the base adapter reports nothing paused, the breaker closes its paused operations, and the pool resets a shared breaker once.circuit_openhint names the new tool andSOLIDWORKS_MCP_CIRCUIT_BREAKER_TIMEOUT.check_interferenceis no longer cached by the router. Its 60-second cache returned an old result after components moved, which was one of the gaps in Tool gaps found building the U-joint: face mates, fixed parts, angled planes, angled chamfers #209.CLAUDE.mditem 4), the agent skill's error table, the changelog, the queue, and the tool count (154 → 155).Tests:
tests/integration/test_circuit_breaker_stack.pyruns the server's routing around a real breaker. Two of its four tests fail on the old code. The full mock suite has 3,626 passed and 10 skipped, at 100 % coverage. ruff andmkdocs build --strictpass.Not done yet: a paced live check on SolidWorks (task 3.2). It needs your go-ahead.