kimi-code/packages/acp-server
Kai 80480c01d2
feat(agent-core-v2): accept HEIC, HEIF, and BMP images for Kimi models (#3649)
* feat(agent-core-v2): accept HEIC, HEIF, and BMP images for Kimi models

Key the accepted image MIME set by the provider the agent is bound to
instead of a single global allowlist: Kimi accepts PNG/JPEG/GIF/WebP plus
BMP/HEIC/HEIF, every other provider keeps the baseline set. The provider
image policy lives in the human layer (`llm/media/image-formats`) so both
the agent-side gates and the Anthropic protocol lowering share it.

- thread the provider type through every ingestion gate: ReadMediaFile,
  prompt entry, MCP tool results, session media references, kap-server
  prompt/skill routes; expose it via IAgentProfileService.getModelProviderType
- ReadMediaFile sends accepted formats it cannot re-encode locally inline
  up to the provider's per-image budget (5MB for Kimi, 3.75MB otherwise)
  and points at a conversion command above that; full_resolution uses the
  same provider budget
- acp-server no longer gates formats itself and leaves the decision to the
  engine prompt pipeline, which knows the bound provider
- the Anthropic lowering allowlist follows the bound provider so Kimi over
  the Anthropic-compatible protocol no longer rejects HEIC client-side

* fix(agent-core-v2): resolve the image format policy on the production paths

Follow-ups from review of the provider-aware image formats:

- the Anthropic lowering read the policy from `LlmModel.provider`, which
  the adapter registry sets to the route id (`anthropic`) rather than the
  model's provider type, so Kimi over the Anthropic-compatible protocol
  still rejected HEIC client-side; the accepted set now comes from a
  `ProtocolTrait.acceptedImageMimes` hook that the Kimi traits implement,
  and the test goes through the real trait with the routed provider id
- kap-server prompt ingestion gated media against the currently bound
  model even when the same request selected another model; the profile
  service now resolves the provider type for a requested alias
- the session media memo served a cached inline image to a provider that
  does not accept its format; memo hits are re-judged against the current
  provider before being returned
- the media tools registrar keyed ReadMediaFile only by alias and
  capabilities, so a reload that changed the alias's provider type or
  protocol kept the stale tool; both now take part in the key

* test(kap-server): keep the optional chain the lint autofix dropped
2026-09-08 19:28:23 +08:00
..
src feat(agent-core-v2): accept HEIC, HEIF, and BMP images for Kimi models (#3649) 2026-09-08 19:28:23 +08:00
test feat(agent-core-v2): accept HEIC, HEIF, and BMP images for Kimi models (#3649) 2026-09-08 19:28:23 +08:00
CHANGELOG.md ci: release packages (#2881) 2026-08-14 20:51:17 +08:00
package.json refactor(protocol): remove package and relocate wire types into agent-core-v2 (#3646) 2026-09-08 17:41:41 +08:00
tsconfig.json feat(acp): add experimental agent-core-v2 ACP server (kimi acp-v2) (#2571) 2026-08-04 10:20:24 +08:00
tsdown.config.ts feat(acp): add experimental agent-core-v2 ACP server (kimi acp-v2) (#2571) 2026-08-04 10:20:24 +08:00
vitest.config.ts feat(acp): add experimental agent-core-v2 ACP server (kimi acp-v2) (#2571) 2026-08-04 10:20:24 +08:00