Skip to content

fix(models): tighten transient retry classification - #6071

Draft
ehz0ah wants to merge 1 commit into
volcengine:mainfrom
ehz0ah:fix/retry-status-context-pass869
Draft

ehz0ah wants to merge 1 commit into
volcengine:mainfrom
ehz0ah:fix/retry-status-context-pass869

Conversation

@ehz0ah

@ehz0ah ehz0ah commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Description

Prevent the shared model retry classifier from treating unrelated numeric values as HTTP status codes. Also recognize common Node transport errno strings as transient failures.

The current classifier treats messages such as max_tokens=500 as transient server errors. This can repeat a deterministic invalid request. It also misses ECONNREFUSED, ECONNRESET, and ETIMEDOUT messages forwarded by Node-based gateways.

Human Involvement

  • A human participated in the implementation or review loop

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Require HTTP or error context before a numeric status pattern matches an error message.
  • Preserve explicit forms such as HTTP 500, status code: 503, and 500 Internal Server Error.
  • Classify ECONNREFUSED, ECONNRESET, and ETIMEDOUT as transient errors.
  • Add classifier and real retry-loop regression tests for false-positive and transport cases.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Commands and results:

  • pytest tests/unit/test_model_retry.py: 82 passed.
  • ruff format --check openviking/utils/model_retry.py tests/unit/test_model_retry.py: passed.
  • ruff check openviking/utils/model_retry.py tests/unit/test_model_retry.py: passed.
  • Bounded mypy check for the two changed files: passed.
  • A source-pinned 20-case comparison reduced mismatches from seven to the two out-of-scope cases noted below, with zero in-scope mismatches.
  • tests/utils/test_circuit_breaker.py: 16 passed and two stale 401/403 expectation failures. The same two failures reproduce on unchanged upstream/main.

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Not applicable.

Additional Notes

This PR intentionally does not add structured exception-status handling or built-in timeout classification. PR #6047 and PR #5927 already own those overlapping changes.

@ZaynJarvis ZaynJarvis added the kernel Core server, runtime, storage, retrieval, SDK, and CLI. label Oct 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Core server, runtime, storage, retrieval, SDK, and CLI.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants