kimi-code/packages/agent-core/test
Kimi Agent d96b4a0149
fix: fail fast on provider-filtered empty responses (#3101)
* 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>
2026-08-20 11:55:26 +08:00
..
agent fix: fail fast on provider-filtered empty responses (#3101) 2026-08-20 11:55:26 +08:00
base/common feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
config feat: replace the secondary-model experiment with a declarative subagent model pool (#2700) 2026-08-13 12:29:03 +08:00
di feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
errors fix(kosong): fail fast on quota-exhausted 429 instead of retrying (#1857) 2026-07-28 14:35:12 +08:00
fixtures refactor(kaos): move Environment into kaos, slim package API (#147) 2026-05-28 16:50:10 +08:00
flags fix: allow obsolete experimental config entries (#584) 2026-06-09 17:00:48 +08:00
harness chore: remove internal-network references from comments and test fixtures (#3029) 2026-08-18 14:14:56 +08:00
hooks test: cut slow suite runtimes and isolate experimental flag from host env (#1595) 2026-07-13 17:45:22 +08:00
logging fix: preserve the crash error in diagnostic logs on unexpected exit (#1757) 2026-07-16 01:26:27 +08:00
loop fix(kosong): fail fast on quota-exhausted 429 instead of retrying (#1857) 2026-07-28 14:35:12 +08:00
mcp feat(agent-core): unify the v1 MCP management plane (#2858) 2026-08-17 13:19:51 +08:00
plugin feat(agent-core): unify the v1 MCP management plane (#2858) 2026-08-17 13:19:51 +08:00
profile test: remove wording-pinning tests of model-facing prose across both suites (#3031) 2026-08-18 16:36:57 +08:00
rpc feat(agent-core): unify the v1 MCP management plane (#2858) 2026-08-17 13:19:51 +08:00
services feat: unify the host identity across OAuth, telemetry, and kap-server (#2382) 2026-07-30 13:45:41 +08:00
session feat(agent-core): unify the v1 MCP management plane (#2858) 2026-08-17 13:19:51 +08:00
skill fix(agent-core): only discover the root SKILL.md for plugin skills fallback (#2847) 2026-08-12 14:24:48 +08:00
tools feat(kimi-code): support two OAuth login endpoints (#2862) 2026-08-20 11:24:02 +08:00
utils feat(agent-core): progressive tool disclosure via select_tools (#1369) 2026-07-06 15:51:08 +08:00
prompt-placeholders.test.ts feat(agent-core): rework compaction to keep only user prompts and summary (#1214) 2026-07-01 01:17:30 +08:00
setup.ts fix(agent-core): strip the no-op subagent model parameter while the secondary-model experiment is off (#2449) 2026-07-31 13:09:56 +08:00