Skip to content

Fix output schema names for Literal types#3398

Closed
mindbomber wants to merge 1 commit into
openai:mainfrom
mindbomber:codex/fix-literal-output-schema-name
Closed

Fix output schema names for Literal types#3398
mindbomber wants to merge 1 commit into
openai:mainfrom
mindbomber:codex/fix-literal-output-schema-name

Conversation

@mindbomber
Copy link
Copy Markdown
Contributor

Fixes #3357.

Summary

  • Make AgentOutputSchema.name() handle typing arguments that are literal values rather than Python types.
  • Preserve existing formatting for normal types and generics.
  • Add regression coverage for top-level Literal["ok"] and nested list[Literal["ok", "done"]] output types.

Verification

  • uv run pytest tests/test_output_tool.py -q
  • uv run ruff check src/agents/agent_output.py tests/test_output_tool.py
  • uv run ruff format --check src/agents/agent_output.py tests/test_output_tool.py
  • git diff --check

@seratch seratch added feature:core duplicate This issue or pull request already exists labels May 14, 2026
@seratch
Copy link
Copy Markdown
Member

seratch commented May 14, 2026

resolved by #3358

@seratch seratch closed this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AgentOutputSchema.name() fails for Literal output types

2 participants