Skip to content

One failed call no longer pauses a tool; add reset_circuit_breaker (#208) - #213

Merged
andrewbartels1 merged 2 commits into
mainfrom
fix/circuit-breaker-reset
Nov 7, 2026
Merged

andrewbartels1 merged 2 commits into
mainfrom
fix/circuit-breaker-reset

Conversation

@andrewbartels1

Copy link
Copy Markdown
Owner

Closes #208.

The cause. In the U-joint session, one failed create_extrusion paused 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 through server._routed_call, the intelligent router and VbaGeneratorAdapter.create_extrusion back 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.
  • Clearer error: the circuit_open hint names the new tool and SOLIDWORKS_MCP_CIRCUIT_BREAKER_TIMEOUT.
  • No stale interference results: check_interference is 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.
  • Docs: the runbook (CLAUDE.md item 4), the agent skill's error table, the changelog, the queue, and the tool count (154 → 155).

Tests: tests/integration/test_circuit_breaker_stack.py runs 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 and mkdocs build --strict pass.

Not done yet: a paced live check on SolidWorks (task 3.2). It needs your go-ahead.

…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).
@andrewbartels1
andrewbartels1 merged commit 2f62ea6 into main Nov 7, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Circuit breaker locks a tool out after a success and never reopens; add a reset tool

1 participant