fix: drop empty text blocks during projection - #910
Conversation
🦋 Changeset detectedLatest commit: a328707 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ff88012dd
ℹ️ 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".
1 similar comment
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
upstream: 7644f10 Author: _Kerman <kermanx@qq.com>
Related Issue
No linked issue; the problem is described below.
Problem
Some providers reject empty text content blocks in request messages. Restored conversation history can replay empty streamed assistant text parts into the next provider request, causing the turn to fail before the model can continue.
What changed
textcontent parts while projecting context history for LLM requests.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.Validation
pnpm vitest run packages/agent-core/test/agent/context.test.tspnpm exec oxlint --type-aware packages/agent-core/src/agent/context/projector.ts packages/agent-core/test/agent/context.test.tsgit diff --check -- packages/agent-core/src/agent/context/projector.ts packages/agent-core/test/agent/context.test.ts