Skip to content

fix(proxy): preserve mixed user content in Responses - #9

Draft
LPFchan wants to merge 1 commit into
StringKe:mainfrom
LPFchan:fix/responses-mixed-user-content
Draft

fix(proxy): preserve mixed user content in Responses#9
LPFchan wants to merge 1 commit into
StringKe:mainfrom
LPFchan:fix/responses-mixed-user-content

Conversation

@LPFchan

@LPFchan LPFchan commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • preserve text and image blocks that accompany tool_result blocks in Anthropic user messages
  • emit Responses input items in source order around each function_call_output
  • add regression coverage for mixed text, images, multiple tool results, and ordering

Root cause

The Responses translator selected an all-or-nothing tool_result path whenever any block in a user message was a tool result. That path emitted the tool outputs and silently discarded every sibling block. Claude Code may combine a tool result with subsequent user guidance to preserve role alternation, so corrective prompts could disappear while the model continued the previous task.

Closes #8.

Verification

  • cargo fmt --check
  • cargo test (345 unit tests and 1 integration test)
  • cargo clippy -- -D warnings
  • git diff --check

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.

OpenAI Responses translator drops text beside tool_result blocks

1 participant