Skip to content

fix(agent): stop retrying deterministic provider errors - #2813

Merged
kev1n77 merged 1 commit into
GCWing:1.0.0-explorefrom
kev1n77:fmy/bugfix
Sep 5, 2026
Merged

kev1n77 merged 1 commit into
GCWing:1.0.0-explorefrom
kev1n77:fmy/bugfix

Conversation

@kev1n77

@kev1n77 kev1n77 commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Stop retrying classified authentication, permission, quota, billing, invalid-request, and content-policy errors in both request-opening and stream-error paths.
  • Return context overflow immediately to the existing compression recovery flow.
  • Preserve the unified attempt budget and recovery for transient, malformed, and unclassified provider responses.
  • Add request-count and context-recovery coverage, and update focused verification commands.

Fixes #2690

Type and Areas

Type: Bug fix

Areas: Rust core / Agent execution, CLI integration tests, developer documentation

Motivation / Impact

The round executor checked only the remaining attempt budget, so deterministic provider rejections could resend the same request up to 10 times before surfacing the error.

These errors now stop after the first failed attempt. Context overflow starts compression immediately, and the subsequent model request uses the compressed context. Network failures, rate limits, timeouts, service unavailability, and malformed or unclassified responses retain bounded retry behavior.

Logs now distinguish non-retryable errors from exhausted retry budgets.

Verification

  • cargo test --locked --offline -p openbitfun-core --no-default-features --features agent-runtime,git --lib agentic::execution::round_executor::tests
    • 25 passed.
    • Covers HTTP and in-stream rejections, immediate recoverable context overflow, transient and malformed-response recovery, and full error-chain classification.
  • cargo test --locked --offline -p openbitfun-cli --test cli_command_contracts exec_cli_contracts::stream_json_
    • 8 passed.
    • Verifies one request for authorization rejection, two requests for disconnect followed by authorization rejection, and preserved malformed-SSE recovery.
    • Verifies context overflow produces an initial rejected request, a summary request, and a recovered request with updated context.
    • Preserves exactly one final terminal event.
  • pnpm run fmt:rs — passed.
  • git diff --check — passed.

Tests ran on Windows using local mock providers. Remote workspace, remote control, Peer Device Mode, and Detached Dispatch were not exercised.

Reviewer Notes

The retry decision remains in the shared round executor. Adapter calls still make one attempt, preserving the single 10-attempt budget without restoring nested retries.

The execution policy intentionally preserves retries for ModelError and Unknown; those categories do not prove that a request is permanently invalid.

No protocol or persisted data shapes change.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@kev1n77
kev1n77 merged commit 1178853 into GCWing:1.0.0-explore Sep 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant