Skip to content

Conversation

@jessicaalder-lgtm
Copy link

@jessicaalder-lgtm jessicaalder-lgtm commented Feb 11, 2026

Issue

The Anthropic Ruby SDK uses system_: (with trailing underscore) as the keyword argument name because system is a reserved method in Ruby (Kernel#system).

Our instrumentation implementation was checking for params[:system] which never matched, causing system prompts to be silently dropped from Braintrust traces:

RubyAnthropicSystemBug

Changes

Update both messages.rb and beta_messages.rb to use params[:system_] to match the official Anthropic Ruby SDK semantics.

Tested fix and we are now properly capturing system_ as the system prompt in our logs:
RubyAnthropicSystemFix

The Anthropic Ruby SDK uses `system_:` (with trailing underscore) as
the keyword argument name because `system` is a reserved method in Ruby
(Kernel#system). The instrumentation was checking for `params[:system]`
which never matched, causing system prompts to be silently dropped from
Braintrust traces.

Update both messages.rb and beta_messages.rb to use `params[:system_]`
to match the official Anthropic Ruby SDK semantics.
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.

1 participant