Skip to content

fix(agent-core-v2): skip deterministic provider validation retries#1603

Merged
kermanx merged 3 commits into
mainfrom
xtr/skip-deterministic-provider-retries
Jul 13, 2026
Merged

fix(agent-core-v2): skip deterministic provider validation retries#1603
kermanx merged 3 commits into
mainfrom
xtr/skip-deterministic-provider-retries

Conversation

@kermanx

@kermanx kermanx commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

Follow-up to #1598 and its review finding about deterministic provider validation errors.

Problem

The v2 retry fallback introduced in #1598 treats every base ChatProviderError as transient. The Anthropic adapter uses that base error for malformed image data URLs and unsupported base64 image media types before making an HTTP request, so retrying repeats the same deterministic failure, delays the final error, and emits misleading retry events.

What changed

  • Exclude the same two client-side image validation message families that v1 already excludes from its base provider-error retry fallback.
  • Keep generic unclassified provider failures retryable, along with the existing transient HTTP status handling.
  • Add regression coverage for both deterministic validation messages while retaining coverage for the generic fallback.

Validation

  • pnpm --filter @moonshot-ai/agent-core-v2 exec vitest run test/app/llmProtocol/errors.test.ts test/agent/stepRetry/stepRetry.test.ts --maxWorkers=2 (105 tests passed)
  • pnpm --filter @moonshot-ai/agent-core-v2 test -- --reporter=dot (3,159 tests passed)
  • pnpm --filter @moonshot-ai/agent-core-v2 typecheck
  • pnpm --filter @moonshot-ai/agent-core-v2 lint:domain
  • pnpm exec oxlint --type-aware packages/agent-core-v2/src/app/llmProtocol/errors.ts packages/agent-core-v2/test/app/llmProtocol/errors.test.ts
  • pnpm exec changeset status
  • pnpm --filter @moonshot-ai/agent-core-v2 dep-graph:lint still reports the 21 pre-existing unresolved IAgentWireService binding errors from main; none of its findings are in files changed by this PR.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update. (No documentation update is needed for this retry-classification bug fix.)

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3eaa673

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kermanx kermanx marked this pull request as ready for review July 13, 2026 10:11
@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@3eaa673
npx https://pkg.pr.new/@moonshot-ai/kimi-code@3eaa673

commit: 3eaa673

Signed-off-by: _Kerman <kermanx@qq.com>
@kermanx kermanx merged commit 22ec37b into main Jul 13, 2026
10 checks passed
@kermanx kermanx deleted the xtr/skip-deterministic-provider-retries branch July 13, 2026 10:40
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