Skip to content

Conversation

@dannykopping
Copy link
Collaborator

@dannykopping dannykopping commented Dec 30, 2025

The actions of determining whether to use Anthropic's streaming APIs and ensuring a uniform message payload format used to unmarshal and remarshal the same payload twice. This PR ensures we unmarshal once, do both, and then remarshal once.

Copy link
Collaborator Author

Copy link

@SasSwart SasSwart left a comment

Choose a reason for hiding this comment

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

I've reviewed the PR structurally, and I only have one comment about test coverage. The rest looks good.

At a higher level I'm a little concerned that we might not sufficiently document why we need to do this kind of content modification.

Its a seemingly invalid assumption of mine that because Bridge acts as a gateway, there should be no discrepancies between the payloads we receive and the ones we track or send on.

Yet, we need to introduce the stream attribute, and me need to coerce tool calls into a specific format and I've been unable to determine why.

checkContent: nil,
},
{
name: "mcp_tool_result with string content unchanged",

Choose a reason for hiding this comment

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

Is this test case (and others related to tool_result, mcp_tool_result) no longer relevant? We still have logic in convertStringContentRecursive that relates to these types of content.

@SasSwart SasSwart marked this pull request as ready for review January 14, 2026 13:40
@SasSwart SasSwart changed the title perf: only marshal once perf: eliminate unnecessary json marshalling for anthropic requests to bridge Jan 14, 2026
Copy link

SasSwart commented Jan 14, 2026

Merge activity

  • Jan 14, 1:46 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 14, 1:47 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 14, 1:48 PM UTC: Graphite couldn't merge this PR because it failed for an unknown reason (Merge commits are not allowed on this repository).
  • Jan 19, 9:36 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 19, 9:36 AM UTC: @SasSwart merged this pull request with Graphite.

Signed-off-by: Danny Kopping <[email protected]>
@SasSwart SasSwart merged commit 5dc19fc into main Jan 19, 2026
2 checks passed
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