Skip to content

fix: Use requests byte payload in messages interceptor#185

Merged
pawbana merged 2 commits intomainfrom
pb/anthropic-adaptive-thinking-fix
Feb 20, 2026
Merged

fix: Use requests byte payload in messages interceptor#185
pawbana merged 2 commits intomainfrom
pb/anthropic-adaptive-thinking-fix

Conversation

@pawbana
Copy link
Contributor

@pawbana pawbana commented Feb 19, 2026

Adds WithRequestBody option use to messages interceptor.
Any structured request modifications are mirrored on original request payload.

Fixes missing adaptive thinking from request after re-marshaling due to golang SDK not supporting it.

Fixes: #177

Copy link
Contributor Author

pawbana commented Feb 19, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@pawbana pawbana changed the title fix: fix adaptive thinking being removed from request fix: Feb 19, 2026
@pawbana pawbana changed the title fix: fix: Use requests byte payload in messages interceptor Feb 19, 2026
@pawbana pawbana marked this pull request as ready for review February 19, 2026 10:55
@pawbana pawbana requested a review from dannykopping February 19, 2026 10:55
Copy link
Collaborator

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM except for one perf-related change.

path := strings.TrimPrefix(r.URL.Path, p.RoutePrefix())
switch path {
case routeMessages:
payload, err := io.ReadAll(r.Body)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should stick with json.NewDecoder; it's more memory-efficient.

Copy link
Collaborator

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor Author

pawbana commented Feb 20, 2026

Merge activity

  • Feb 20, 12:54 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 20, 12:54 PM UTC: @pawbana merged this pull request with Graphite.

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.

Claude Opus 4.6 support: thinking configuration and JSON schema responses not working

2 participants