Skip to content

fix: Exclude None/null values in request data - #3060

Open
SootyOwl wants to merge 11 commits into
letta-ai:mainfrom
SootyOwl:patch-1
Open

fix: Exclude None/null values in request data#3060
SootyOwl wants to merge 11 commits into
letta-ai:mainfrom
SootyOwl:patch-1

Conversation

@SootyOwl

@SootyOwl SootyOwl commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

Please describe the purpose of this pull request.

Prevents sending null values to OpenAI-compatible endpoints. Optional parameters should be excluded entirely - don't rely on endpoints to handle null values identically.

Fixes a 400 error I was having when using https://synthetic.new as my OpenAI-proxy, specifically when attempting to run summarization.

How to test
Run summarization and verify that the request made no longer contains {..., "tools": null, "tool_choice": null}

Have you tested this PR?

Only by manually sending requests to my chosen endpoint to verify what the issue was.

Summarization API response with nulls:

Details

``` Error code: 400, Response JSON: {'error': '[object Object] failed the following checks:\n' '[object Object] failed the following checks:\n' 'null is not an array\n' 'null failed the following checks:\n' 'null failed the following checks:\n' 'null is not equal to auto\n' 'null failed the following checks:\n' 'null is not equal to none\n' 'null is not equal to required\n' 'null is null\n' "missing key 'stream'\n" '[object Object] failed the following checks:\n' 'null is not an array\n' 'null failed the following checks:\n' 'null failed the following checks:\n' 'null is not equal to auto\n' 'null failed the following checks:\n' 'null is not equal to none\n' 'null is not equal to required\n' 'null is null'} ```

Summarization API response without nulls:

Details

``` Code: 200, Response JSON: {'choices': [...], 'created': 1762445699, 'id': '6c8e5475-33bb-4679-8158-d350262d8fd6', 'model': 'accounts/fireworks/models/gpt-oss-120b', 'object': 'chat.completion', 'usage': {...}} ```

prevents sending null values to OpenAI endpoints
@SootyOwl SootyOwl changed the title fix: Exclude None values in request data fix: Exclude None/null values in request data Nov 6, 2025
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