Skip to content

fix: use non-None value for output in FunctionSpanData#3475

Merged
seratch merged 1 commit into
openai:mainfrom
rmotgi1227:fix/function-span-falsy-output
May 21, 2026
Merged

fix: use non-None value for output in FunctionSpanData#3475
seratch merged 1 commit into
openai:mainfrom
rmotgi1227:fix/function-span-falsy-output

Conversation

@rmotgi1227
Copy link
Copy Markdown
Contributor

The export() method used a truthiness check to serialize the tool output:

# before
"output": str(self.output) if self.output else None,

Any falsy return value (0, False, "", [], {}) was silently dropped and shown as null in the traces dashboard. A function tool returning 0 (counter, difference) or False (predicate) would appear to have returned nothing.

# after
"output": str(self.output) if self.output is not None else None,

Truthiness check dropped falsy return values (0, False, '', [], {})
from function tool traces, showing null in the dashboard instead.

Fixes: tool returning 0 or False appears as null in traces
@seratch seratch added this to the 0.17.x milestone May 21, 2026
@seratch seratch changed the title use 'is not None' for FunctionSpanData output in traces fix: use non-None value for output in FunctionSpanData May 21, 2026
@seratch seratch merged commit 9303389 into openai:main May 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants