Package com.tnsai.resilience


package com.tnsai.resilience
Resilience patterns for fault-tolerant agent and action execution.

Two layers

This package houses two distinct concerns sharing the "resilience" label:
  1. Agent-level orchestration (ResilienceExecutor, RetryPolicy) — wraps Agent.chat / tool-call paths with resilience4j-backed circuit breaker, bulkhead, rate limiter, and retry around the orchestration layer. Reads Resilience.
  2. Action-level decorators (the TracedResolver / MeteredResolver / FallbackResolver family — issue #173 Phase 1) — wraps individual @ActionSpec dispatches with observability + recovery decorators driven by Traced, Metered, and Fallback. Wired into ActionExecutor immediately around each action's executor invocation; runs in canonical order: Traced → Metered → action → Fallback.

The two layers are intentionally separate: agent-level resilience runs across many actions per chat turn, while action- level decorators are per-dispatch and need different state isolation guarantees. A future Phase 2+ may rationalise them once @Idempotent support lands.

Action-level Phase 1 scope (#173)

Only the three decorators that don't require external storage are wired today — same boundary as the other Phase-1 batches in this sprint (#171 / #172 / #177).