Capture context_management In Anthropic Messages Tracer - #227
Abhijeet Prasad (AbhiPrasad) merged 11 commits into
Conversation
Signed-off-by: atharvamhaske <atharvamhaske76@gmail.com>
Signed-off-by: atharvamhaske <atharvamhaske76@gmail.com>
Signed-off-by: atharvamhaske <atharvamhaske76@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7186e2f5c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
|
note: i haven't tried on braintrust dashboard as i dont have anthropic api key to test, you can test it ! |
… responses Signed-off-by: atharvamhaske <atharvamhaske76@gmail.com>
…' into fix/anthropic-context-management
|
fixed above suggestion by bot,
cc: Abhijeet Prasad (@AbhiPrasad) re run ci jobs, once you get time :) |
Abhijeet Prasad (AbhiPrasad)
left a comment
There was a problem hiding this comment.
Let's delete the mocks/fakes tests we have in favor of adding a vcr test. Once we have the vcr test, I can record the cassette with my api key
sure on it |
Signed-off-by: atharvamhaske <atharvamhaske76@gmail.com>
|
reverted all fake tests in latest commit, ci is green |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
push up the cassette and made some fixes + cleanup |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c67cbe0459
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
5d9babc
into
braintrustdata:main
Summary
The Anthropic Messages tracer does not capture context_management. This field controls Claude's server-side context editing. It clears oldtool-use results or thinking blocks as a conversation grows.
Changes
trace/contrib/anthropic/messages.go: addcontext_managementto the request metadata fields. Add the response-sideapplied_editsfield, nested under the samecontext_managementkey.trace/contrib/anthropic/traceanthropic_test.go: add a test for both the request config and the responseapplied_edits.examples/internal/anthropic/main.go: add a context management example.Closes #222
Screenshot