Skip to content

fix: #3321 validate prompt configs#3322

Draft
Aphroq wants to merge 1 commit intoopenai:mainfrom
Aphroq:fix/prompt-config-validation
Draft

fix: #3321 validate prompt configs#3322
Aphroq wants to merge 1 commit intoopenai:mainfrom
Aphroq:fix/prompt-config-validation

Conversation

@Aphroq
Copy link
Copy Markdown
Contributor

@Aphroq Aphroq commented May 9, 2026

Summary

  • Validate prompt configs before forwarding them to model providers, so missing or non-string id values and invalid optional fields raise UserError.
  • Apply the shared validation to static Agent prompts, dynamic prompt return values, and RealtimeAgent prompt settings while preserving existing valid prompt payloads.

Test plan

  • bash .agents/skills/code-change-verification/scripts/run.sh

Issue number

Closes #3321

Checks

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

@github-actions github-actions Bot added bug Something isn't working feature:realtime labels May 9, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f210aa5e8b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1105 to +1107
prompt = vars(agent).get("prompt")
if prompt is not None:
updated_settings["prompt"] = validate_prompt(prompt, source="RealtimeAgent prompt")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate the final realtime prompt setting

In RealtimeSession, this validates only the agent prompt before the already-supported run_config.model_settings / model_config.initial_model_settings prompt can remain in updated_settings or starting_settings can overwrite it later. For example, a session with initial_model_settings={"prompt": {}} and no agent prompt still forwards the invalid prompt to _get_session_config, where _passed_prompt["id"] raises KeyError instead of the new UserError; validate updated_settings["prompt"] after all realtime settings have been merged.

Useful? React with 👍 / 👎.

@seratch seratch marked this pull request as draft May 9, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:realtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prompt config validation misses invalid ids

1 participant