Skip to content

fix(config): recognize provider model capabilities#346

Open
LiPu-jpg wants to merge 5 commits into
MoonshotAI:mainfrom
LiPu-jpg:fix/env-model-provider-capabilities
Open

fix(config): recognize provider model capabilities#346
LiPu-jpg wants to merge 5 commits into
MoonshotAI:mainfrom
LiPu-jpg:fix/env-model-provider-capabilities

Conversation

@LiPu-jpg
Copy link
Copy Markdown

@LiPu-jpg LiPu-jpg commented Jun 2, 2026

Related Issue

Resolve #250

Problem

Environment-configured OpenAI and Anthropic models could inherit Kimi-only default capabilities. Several current provider models were also missing from static capability detection, so media, thinking, and tool support could be under-detected.

What changed

  • Limit default KIMI_MODEL_CAPABILITIES to the Kimi provider.
  • Add capability recognition for current MiMo, MiniMax, DeepSeek, and Kimi Open Platform models.
  • Keep provider-path limitations conservative, such as not enabling MiniMax-M3 video_in while the Anthropic adapter does not send video_url.
  • Add regression tests, docs updates, and changesets.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Verification

  • corepack pnpm --filter @moonshot-ai/agent-core exec vitest run test/config/env-model.test.ts
  • corepack pnpm --filter @moonshot-ai/kosong exec vitest run test/capability-providers.test.ts
  • corepack pnpm --filter @moonshot-ai/agent-core exec tsc -p tsconfig.json --noEmit
  • corepack pnpm --filter @moonshot-ai/kosong exec tsc -p tsconfig.json --noEmit
  • corepack pnpm lint -- packages/agent-core/src/config/env-model.ts packages/agent-core/test/config/env-model.test.ts
  • corepack pnpm lint -- packages/kosong/src/providers/capability-registry.ts packages/kosong/src/providers/kimi.ts packages/kosong/test/capability-providers.test.ts
  • corepack pnpm -C docs run build
  • git diff --check

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

🦋 Changeset detected

Latest commit: 2cc09f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LiPu-jpg LiPu-jpg force-pushed the fix/env-model-provider-capabilities branch from a535748 to 2cc09f1 Compare June 3, 2026 16:47
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cc09f13a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


const KIMI_K2_5_CAPABILITY: ModelCapability = Object.freeze({
image_in: true,
video_in: false,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enable video input for Kimi K2.5

For kimi-k2.5, leaving video_in false under-detects a supported modality: the Kimi K2.5 API accepts video input, but ToolManager.initializeBuiltinTools only exposes ReadMediaFile for video when modelCapabilities.video_in is true. In sessions using the catalogued kimi-k2.5 model, users will be told the current model does not support video and cannot attach videos even though the provider can send/upload them; this should be true like K2.6.

Useful? React with 👍 / 👎.

image_in: false,
video_in: false,
audio_in: false,
thinking: false,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark MiniMax M2.7 as thinking-capable

This shared capability object makes MiniMax-M2.7 and MiniMax-M2.7-highspeed report thinking: false, even though the Anthropic-compatible M2.7 API emits thinking blocks as part of its interleaved-thinking tool flow. Any caller relying on getCapability() will under-report those models and can hide or avoid thinking support for a model whose tool-loop responses include reasoning blocks; split M2.7 out or mark the M2.x entries that support interleaved thinking as thinking-capable.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KIMI_MODEL_* 环境变量路径会给 OpenAI/Anthropic 模型默认声明 Kimi 能力

1 participant