mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-08-21 06:35:50 +00:00
* fix: fail fast on provider-filtered empty responses An APIEmptyResponseError carrying finishReason 'filtered' (OpenAI content_filter, Anthropic refusal) is deterministic: replaying the same request re-triggers the provider safety filter. Both isRetryableGenerateError implementations (kosong, agent-core-v2) treated every empty response as retryable, so step retry replayed the doomed request the full 10 attempts before the filter notice surfaced. Return non-retryable for filtered empty responses in both engines; the error already carries the provider.filtered code, so the turn fails immediately with the existing filter notice. * fix: skip the compaction shrink-retry for filtered empty responses Both full-compaction loops routed every APIEmptyResponseError into the shrink-and-continue branch before isRetryableGenerateError was consulted, so a filtered response was retried with shrinking input instead of failing fast. Exclude finishReason 'filtered' from the shrink branch in both engines; it now falls through to the retryability check and throws immediately. Add end-to-end tests (real kosong generate over a filtered think-only stream) asserting a single attempt with the history untouched. --------- Co-authored-by: kimi-agent-bot <kimi-agent-bot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| src | ||
| test | ||
| CHANGELOG.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsconfig.type-negative.json | ||
| tsdown.config.ts | ||
| vitest.config.ts | ||