# rye:signed:2026-04-10T09:09:45Z:d7d269fcb5849c864f6e162a20634aa49d2681f96ff631e7e4985abd40e271fa:Z-fk1Nqe31ZDIZajPttddiwq1dMu4bs1CbKGuAeiSsjTu8Cq3QjFOC1MBcTfscrButmKPDAbmIIRpyxtz7UrBA:6ea18199041a1ea8
# config/resilience.yaml
category: "agent"
tool_type: "config"
version: "1.0.0"
description: "Thread resilience configuration for retry policies, limits, checkpoints, and concurrency"
schema_version: "1.0.0"

retry:
  max_retries: 3

  policies:
    exponential:
      type: exponential
      base: 2.0
      max_delay: 120.0

    fixed:
      type: fixed
      delay: 60.0

    rate_limited:
      type: use_header
      header: "retry-after"
      fallback:
        policy: exponential
        base: 5.0

limits:
  defaults:
    turns: 25
    tokens: 1000000
    spend: 5.0
    spend_currency: "USD"
    spawns: 50
    depth: 10
    duration_seconds: 1800

  enforcement:
    check_before_turn: true
    check_after_turn: true
    on_exceed: escalate

checkpoint:
  triggers:
    pre_turn: true
    post_llm: true
    post_tools: true
    on_error: true

  persistence:
    atomic_write: true
    format: json

coordination:
  wait_timeout_seconds: 300.0
  fail_fast: false
  cancel_siblings_on_failure: false
  max_wait_thread_ids: 50
  completion_event_ttl_seconds: 600

child_policy:
  on_parent_cancel: "cascade_cancel"
  on_parent_complete: "allow"
  on_parent_error: "cascade_cancel"

concurrency:
  max_concurrent_children: 5
  max_total_threads: 20

tool_preload:
  enabled: true
  max_tokens: 2000
