Skip to content

fix: Use requests byte payload in messages interceptor#185

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

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

Conversation

@pawbana
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread provider/anthropic.go
path := strings.TrimPrefix(r.URL.Path, p.RoutePrefix())
switch path {
case routeMessages:
payload, err := io.ReadAll(r.Body)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@pawbana pawbana merged commit 11fe079 into main Feb 20, 2026
5 checks passed
f0ssel pushed a commit to coder/coder that referenced this pull request Feb 23, 2026
Backports #22264

Includes fixes coder/aibridge#189 and
coder/aibridge#185

Signed-off-by: Danny Kopping <danny@coder.com>
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