Skip to content

fix(agent-core-v2): retry with media-stripped projection on content-t… - #2996

Open
jekhy wants to merge 8 commits into
MoonshotAI:mainfrom
jekhy:fix/text-model-content-type
Open

fix(agent-core-v2): retry with media-stripped projection on content-t…#2996
jekhy wants to merge 8 commits into
MoonshotAI:mainfrom
jekhy:fix/text-model-content-type

Conversation

@jekhy

@jekhy jekhy commented Aug 17, 2026

Copy link
Copy Markdown

…ype-invalid 400

A text-only model rejects media content blocks in history with a 400 'content.type is invalid' error, breaking the conversation after switching from a multimodal model. Detect the error via isUnsupportedContentTypeError and resend with the media-stripped projection, mirroring the existing image-format recovery path.

Related Issue

Resolve #2986

Problem

What changed

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.

…ype-invalid 400

A text-only model rejects media content blocks in history with a 400
'content.type is invalid' error, breaking the conversation after
switching from a multimodal model. Detect the error via
isUnsupportedContentTypeError and resend with the media-stripped
projection, mirroring the existing image-format recovery path.
@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 57ca8d8

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

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

Copy link
Copy Markdown

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: 029f9276fe

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/agent-core-v2/src/agent/llmRequester/llmRequesterService.ts Outdated
jekhy added 6 commits August 17, 2026 14:44
…ojection

A media-stripped resend rebuilt the request from the normal projection,
dropping the structural repairs a preceding strict resend had applied: a
history needing both (e.g. duplicate tool-use ids plus media) re-introduced
the structural defect and could not recover, since the structural retry is
gated on the normal projection. Rebuild media-stripped on the strict
projection so the repairs ride along; healthy histories are unaffected
because strict repairs only fire on anomalous history.
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.

从视觉模型切换到纯文本模型后,会话卡死

1 participant