Skip to content

Strip nulls from remote eval prompt parameter defaults#508

Merged
ekeith (evanmkeith) merged 1 commit into
mainfrom
06-11-fix-remote-eval-prompt-default-nulls
Jun 12, 2026
Merged

Strip nulls from remote eval prompt parameter defaults#508
ekeith (evanmkeith) merged 1 commit into
mainfrom
06-11-fix-remote-eval-prompt-default-nulls

Conversation

@evanmkeith

Copy link
Copy Markdown
Contributor

Summary

Fix Python remote eval prompt parameter defaults that include explicit None / JSON null values from PromptData.as_dict().

PromptData.as_dict() currently preserves optional prompt fields like tools, name, function_call, and tool_calls as None. When these values are used as a type: "prompt" parameter default, the remote eval manifest contains explicit nulls. The playground schema expects these fields to be omitted when unset, so the remote eval can fail
to appear or fail to parse.

This strips None values recursively only when serializing prompt parameter defaults, leaving the generic PromptData.as_dict() behavior unchanged.

Test Plan

  • Add/updated Python parameter serialization test covering a PromptData prompt default with unset optional fields.
  • Verify serialized remote eval parameter container omits tools, name, function_call, and tool_calls when unset.
  • Manually verify bt eval <repro>.py --dev lists the remote eval in the playground.

 ## Summary

  Fix Python remote eval prompt parameter defaults that include explicit `None` / JSON `null` values from `PromptData.as_dict()`.

  `PromptData.as_dict()` currently preserves optional prompt fields like `tools`, `name`, `function_call`, and `tool_calls` as `None`. When these values are used as a `type:
  "prompt"` parameter default, the remote eval manifest contains explicit `null`s. The playground schema expects these fields to be omitted when unset, so the remote eval can fail
  to appear or fail to parse.

  This strips `None` values recursively only when serializing prompt parameter defaults, leaving the generic `PromptData.as_dict()` behavior unchanged.

  ## Test Plan

  - Add/updated Python parameter serialization test covering a `PromptData` prompt default with unset optional fields.
  - Verify serialized remote eval parameter container omits `tools`, `name`, `function_call`, and `tool_calls` when unset.
  - Manually verify `bt eval <repro>.py --dev` lists the remote eval in the playground.

@j13huang john (j13huang) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, after mucking around a little bit, this looks pretty good. Thanks Evan. I made some frontend changes to support the null-fields format as well https://github.com/braintrustdata/braintrust/pull/15672

(For posterity, I explored some other serialization changes for SerializableDataClass but it's probably overkill 60ae807)

@evanmkeith ekeith (evanmkeith) merged commit 28fae42 into main Jun 12, 2026
82 checks passed
@evanmkeith ekeith (evanmkeith) deleted the 06-11-fix-remote-eval-prompt-default-nulls branch June 12, 2026 16:11
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