Skip to content

fix: #3357 output schema names for Literal types#3358

Merged
seratch merged 1 commit into
openai:mainfrom
Aphroq:fix/agent-output-schema-literal
May 14, 2026
Merged

fix: #3357 output schema names for Literal types#3358
seratch merged 1 commit into
openai:mainfrom
Aphroq:fix/agent-output-schema-literal

Conversation

@Aphroq
Copy link
Copy Markdown
Contributor

@Aphroq Aphroq commented May 11, 2026

Summary

Fix AgentOutputSchema.name() so typing arguments without __name__, such as Literal values, are formatted instead of raising.

This keeps valid structured output types like Literal["ok"] and list[Literal["ok", "done"]] usable when the runner records the output type name for tracing.

Test plan

  • uv run pytest tests/test_output_tool.py -q
  • bash .agents/skills/code-change-verification/scripts/run.sh

The focused output tool test passes on this branch directly. The full shell verification script was run in a local validation checkout where this branch was temporarily combined with the pending tracing shutdown fix, so the tracing atexit cleanup test would not time out.

Issue number

Closes #3357

Checks

  • I've added new tests (if relevant)
  • I've run make lint and make format
  • I've made sure tests pass

@Aphroq Aphroq changed the title Fix output schema names for Literal types fix: #3357 output schema names for Literal types May 11, 2026
@seratch seratch added this to the 0.17.x milestone May 14, 2026
@seratch seratch merged commit 656baf8 into openai:main May 14, 2026
10 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.

AgentOutputSchema.name() fails for Literal output types

2 participants