mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-08-25 16:46:17 +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> |
||
|---|---|---|
| .. | ||
| anthropic-compliance.test.ts | ||
| compaction-scenarios.test.ts | ||
| full.test.ts | ||
| handoff.test.ts | ||
| micro.test.ts | ||
| strategy.test.ts | ||