← Back to Pull requests

docs: explain controlled model retries #7

Closed
unknown closed this pull request without merging on Nov 24, 2026 16:09 UTC
View on GitHub
unknown unknown commented on Nov 24, 2026 14:07 UTC
Author

Purpose

Covers the Model retries item of agentic-ai-java/argi#372 (Core agentic-ai-java/argi#356, issue agentic-ai-java/argi#313). Docs-only; no Core runtime changes.

What's changed

  • New Chinese/English guide frameworks/agent-framework/model-retry: module and package ownership, recommended configuration, defaults, failure categories and classifiers (type-based vs. the legacy message predicate), backoff, the order of the cancellation / non-retryable / attempt / deadline decisions, what the caller sees when retries stop, ordering with ModelFallbackInterceptor, and the streaming boundary.

  • examples/model-retry/: an offline example compiled against Core c6e453f20 that drives the independent ReActAgent with a scripted ChatClient and checks six scenarios (transient recovery, attempt bound, UNKNOWN not retried, legacy predicate retrying on message text, custom RATE_LIMITED classifier, deadline stop).

  • Sidebar entry under 执行控制与安全, and a one-line link from the existing 模型重试 section of hooks-interceptors.
  • Validation

    Details are in examples/model-retry/README.md. In short, on macOS arm64 with Temurin JDK 21 (release target 17) and Maven 3.9.9:

  • Core c6e453f20 installed; targeted Core tests passed: ModelRetry*Test + ModelFallbackSwitchBoundaryTest (50) and ModelRetryControllerTest (12).

  • Example compile exec:java passed, and again with -o.

  • npm run typecheck, lint, verify:contract and build (zh-Hans + en) passed.
  • Reviewer notes

  • ModelRetryInterceptor lives in argi-agent-framework, so the independent ReActAgent path also needs that module; the guide states this.

  • The current baseline exposes the stop reason only through the exception message, so the guide recommends inspecting getCause() rather than branching on the message.

  • The graph-based ReactAgent path is described from source only: neither the example nor the upstream retry tests run through it.

  • The link from hooks-interceptors uses a route link (./model-retry) instead of ./model-retry.md: that page has no English translation, and in the en build a .md link to a translated page does not resolve.
  • 🤖 Generated with Claude Code

    Diff: 279 lines (+209 / -70) across 3 files Reviewer: Aias00 Review duration: 122m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 279 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.337
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #7"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.7% · Safe to merge
    15.7%