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> |
||
|---|---|---|
| .. | ||
| e2e | ||
| fixtures | ||
| providers | ||
| anthropic-errors.test.ts | ||
| anthropic.test.ts | ||
| capability-providers.test.ts | ||
| capability.test.ts | ||
| catalog.test.ts | ||
| echo-provider.test.ts | ||
| errors.test.ts | ||
| finish-reason.test.ts | ||
| generate.test.ts | ||
| google-genai.test.ts | ||
| kimi-files.test.ts | ||
| kimi.test.ts | ||
| message.test.ts | ||
| openai-common-errors.test.ts | ||
| openai-legacy.test.ts | ||
| openai-responses.test.ts | ||
| provider.test.ts | ||
| regression.test.ts | ||
| scripted-echo-provider.test.ts | ||
| select-tools.test.ts | ||
| simple-toolset.test.ts | ||
| step.test.ts | ||
| stress.test.ts | ||
| strict-role-alternation.test.ts | ||
| tool-message-conversion.test.ts | ||
| type-safety-negative.ts | ||
| type-safety.test.ts | ||
| typed-tool.test.ts | ||
| usage.test.ts | ||