fix: #3321 validate prompt configs#3322
Conversation
There was a problem hiding this comment.
💡 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".
| prompt = vars(agent).get("prompt") | ||
| if prompt is not None: | ||
| updated_settings["prompt"] = validate_prompt(prompt, source="RealtimeAgent prompt") |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
idvalues and invalid optional fields raiseUserError.Test plan
bash .agents/skills/code-change-verification/scripts/run.shIssue number
Closes #3321
Checks
make lintandmake format