Skip to content

Commit fab8a09

Browse files
ZhiXiao-Linclaude
andcommitted
feat(resilience): add parse error recovery, tool timeout, and circuit breaker
4.1 Parse Error Recovery: track consecutive __parse_error tool calls; bail with clear error after max_parse_retries (default 2) consecutive failures. Counter resets to 0 when any tool with valid args executes. 4.2 Tool Execution Timeout: wrap execute_with_context in tokio::time::timeout when tool_timeout_ms is set. Timeout produces an error message fed back to the LLM so the session can recover. 4.3 Circuit Breaker: non-streaming LLM calls are retried up to circuit_breaker_threshold times (default 3) with 100ms*attempt backoff before the loop aborts. Streaming mode fails immediately on any error (events cannot be replayed). All three settings exposed via SessionOptions builder methods: .with_parse_retries(n) .with_tool_timeout(ms) .with_circuit_breaker(n) .with_resilience_defaults() — convenience bundle 8 new tests; total: 1166 passing. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 4959e55 commit fab8a09

4 files changed

Lines changed: 535 additions & 46 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ let result = session.send("Refactor auth to use JWT").await?;
1111
[![Crates.io](https://img.shields.io/crates/v/a3s-code-core.svg)](https://crates.io/crates/a3s-code-core)
1212
[![Documentation](https://docs.rs/a3s-code-core/badge.svg)](https://docs.rs/a3s-code-core)
1313
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
14-
[![Tests](https://img.shields.io/badge/tests-1158%20passing-brightgreen.svg)](./core/tests)
14+
[![Tests](https://img.shields.io/badge/tests-1166%20passing-brightgreen.svg)](./core/tests)
1515

1616
---
1717

1818
## Why A3S Code?
1919

2020
- **Embeddable** — Rust library, not a service. Node.js and Python bindings included.
21-
- **Production-Ready** — Permission system, HITL confirmation, skill-based tool restrictions.
21+
- **Production-Ready** — Permission system, HITL confirmation, skill-based tool restrictions, and error recovery (parse retries, tool timeout, circuit breaker).
2222
- **Extensible** — 14 trait-based extension points, all with working defaults.
2323
- **Scalable** — Lane-based priority queue with multi-machine task distribution.
2424

@@ -476,7 +476,7 @@ cargo test # All tests
476476
cargo test --lib # Unit tests only
477477
```
478478

479-
**Test Coverage:** 1158 tests, 100% pass rate
479+
**Test Coverage:** 1166 tests, 100% pass rate
480480

481481
---
482482

0 commit comments

Comments
 (0)