← Back to Pull requests

Preserve remote error details and expose typed client failures #1260

Closed
unknown closed this pull request without merging on Nov 07, 2026 18:21 UTC
View on GitHub
unknown unknown commented on Nov 06, 2026 07:46 UTC
Author

Summary

Remote failures can hide the server's reason or bypass MontyError. Preserve the reason and expose catchable errors in Python and JavaScript.

  • Refusals say the URL refused the session. Disconnects include the server's status, policy reason and message, or the transport error.

  • Add MontyConnectError with status details and MontyConfigurationError for malformed metadata or incompatible pool settings.

  • Parse Retry-After delay-seconds and HTTP dates, capped at one hour. Expose the suggested delay and a retryable flag for temporary refusals, without automatic retries.

  • Include HTTP status codes, name request_timeout in connection timeouts, and explain URL and TLS fixes.

  • Remove the RuntimeError: prefix from JavaScript host errors. Store policy reasons in remoteCause, not Error.cause.
  • Customer-visible change

    For example, a synthetic server can now produce:

    https://sandbox.example.com refused the session: RESOURCE_EXHAUSTED (capacity): retry later
    monty worker connection closed while waiting for a reply: DEADLINE_EXCEEDED (turn_timeout): turn expired
    

    Connection failures are catchable with MontyError. A disconnect still does not establish whether the request ran and must not be replayed automatically.

    The sleep cap is documented, not changed. Capped sleeps still return normally without a warning unless the capped delay would exceed the cumulative sleep limit. The docs explain how the sleep policy differs from the request timeout and how to configure longer waits.

    Tests

  • Rust pool unit, telemetry and remote tests; Python remote tests; native JavaScript, Node WASM and Chromium suites.

  • Rust, Python, JavaScript and Markdown lint; binding and declaration type checks; pre-commit hooks.

  • Regression tests fail with the relevant pre-fix behavior and pass with the fixes.

  • The full Python suite has 1,682 passes and 15 skips. Three unchanged parallel-execution timing tests fail on this VM; the existing CI policy skips those tests.
  • <a href="https://cloud.murmur.dev/github_app/pydantic/task/github/110818415/w/platform/github/35119617/sandbox-err-monty-client"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.murmur.dev/badge/created-via-murmur-dark-v3.svg"><source media="(prefers-color-scheme: light)" srcset="https://static.murmur.dev/badge/created-via-murmur-light-v3.svg"><img alt="Created via murmur — open this agent's dashboard" src="https://static.murmur.dev/badge/created-via-murmur-light-v3.svg" width="155" height="28"></picture></a>

    Diff: 319 lines (+239 / -80) across 3 files Reviewer: samuelcolvin Review duration: 2075m
    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 · 319 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.345
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1260"
    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: 40.4% (MEDIUM) · Higher = larger blast radius
    40.4%
    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: 16.0% · Safe to merge
    16.0%
    Repository