Skip to content

Revert "fix: aws text content blocks must be non-empty"#3083

Merged
Calcium-Ion merged 1 commit intomainfrom
revert-3077-fix/aws-non-empty-text
Mar 2, 2026
Merged

Revert "fix: aws text content blocks must be non-empty"#3083
Calcium-Ion merged 1 commit intomainfrom
revert-3077-fix/aws-non-empty-text

Conversation

@seefs001
Copy link
Collaborator

@seefs001 seefs001 commented Mar 2, 2026

Reverts #3077

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved handling of assistant messages containing tool calls by preserving existing content
    • Enhanced tool call argument parsing to gracefully skip invalid entries instead of resetting
    • Streamlined message delta processing for more consistent function argument extraction
    • Optimized content assembly when handling tool uses in message streams
  • Tests

    • Updated test framework to use explicit conditionals instead of external dependencies

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4298891 and b1b3def.

📒 Files selected for processing (2)
  • relay/channel/claude/relay-claude.go
  • relay/channel/claude/relay_claude_test.go

Walkthrough

The PR simplifies Claude message relay processing by removing content coercion logic, streamlining tool-call argument parsing to skip invalid calls rather than reset, and directly using PartialJson for stream handling. Test assertions are refactored to remove testify dependency with some test cases removed.

Changes

Cohort / File(s) Summary
Claude Relay Logic
relay/channel/claude/relay-claude.go
Removed automatic null coercion of empty content for assistant messages with ToolCalls; simplified content presence check; replaced common.UnmarshalJsonStr with json.Unmarshal and changed invalid tool-call handling from reset to skip; eliminated intermediate PartialJson transformation, now directly using raw stream data.
Test Refactoring
relay/channel/claude/relay_claude_test.go
Removed testify/assert/require dependency and replaced assertions with manual conditionals and t.Fatal/t.Errorf; removed test cases for OpenAI Claude assistant tool calls and malformed arguments; maintained existing test logic for message_start, message_delta, and content_block_delta paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • Calcium-Ion

Poem

🐰 Claude's messages now flow so pure,
No coercion tricks, just raw and sure,
Tool calls skip the broken way,
Simpler tests to save the day,
Stream data flows—no transform delay! ✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-3077-fix/aws-non-empty-text

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Calcium-Ion Calcium-Ion merged commit 1d3dcc0 into main Mar 2, 2026
1 check was pending
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