Skip to content

Conversation

@bigboateng
Copy link
Contributor

@bigboateng bigboateng commented Dec 15, 2025

Important

Fixes critical message history issues by validating extended thinking blocks and tool use/result pairing to prevent 400 errors.

  • Behavior:
    • Added ensureThinkingBlocksForExtendedThinking() to filter out assistant messages without thinking blocks when thinkingBudget is enabled.
    • Rewrote cleanMessageHistory() to ensure tool_result blocks have corresponding tool_use blocks in the immediately previous message.
  • Errors Fixed:
    • Fixed errors: "Expected thinking or redacted_thinking, but found text" and "unexpected tool_use_id found in tool_result blocks".
  • Testing:
    • Extended thinking test passes with 15+ tool calls across multiple turns without errors.

This description was created by Ellipsis for 2a28db5. You can customize this summary. It will automatically update as commits are pushed.

@bigboateng bigboateng merged commit d6f8163 into main Dec 15, 2025
1 check passed
@ellipsis-dev ellipsis-dev bot changed the title ... fix: validate extended thinking blocks and tool use/result pairing Dec 15, 2025
@bigboateng bigboateng deleted the fix/extended-thinking-400-error branch December 15, 2025 18:17
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 2a28db5 in 39 seconds. Click for details.
  • Reviewed 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .changeset/fix-extended-thinking-blocks.md:9
  • Draft comment:
    Extended Thinking Block Validation fix is clearly described. Consider adding a reference to related tests or documentation for easier context lookup.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. .changeset/fix-extended-thinking-blocks.md:11
  • Draft comment:
    Tool Use/Result Pairing fix is well-documented. It might help to clarify any backwards compatibility implications if the new per-message pairing changes behavior.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
3. .changeset/fix-extended-thinking-blocks.md:14
  • Draft comment:
    Error message quotes are clear. Double-check that these strings match the actual runtime error messages exactly.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. .changeset/fix-extended-thinking-blocks.md:17
  • Draft comment:
    Testing note is helpful. Consider including a reference or link to the extended thinking test results for future maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_PJUz2wtI3HjbKZFg

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

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.

2 participants