mirror of
https://github.com/openai/codex.git
synced 2026-05-29 23:40:29 +00:00
Support --output-schema for exec resume (#23123)
## Why `codex exec resume` should have the same structured-output support as top-level `codex exec`. Without `--output-schema`, multi-turn automation has to choose between resumed session context and schema-validated JSON output. Fixes #22998. ## What changed - Marked `--output-schema` as a global `codex exec` flag so it can be passed after `resume`. - Reused the existing output schema plumbing so resumed turns attach the schema to the final response request while preserving session context.
This commit is contained in:
@@ -36,7 +36,7 @@ fn resume_parses_prompt_after_global_flags() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn resume_accepts_output_last_message_flag_after_subcommand() {
|
||||
fn resume_accepts_output_flags_after_subcommand() {
|
||||
const PROMPT: &str = "echo resume-with-output-file";
|
||||
let cli = Cli::parse_from([
|
||||
"codex-exec",
|
||||
@@ -44,6 +44,8 @@ fn resume_accepts_output_last_message_flag_after_subcommand() {
|
||||
"session-123",
|
||||
"-o",
|
||||
"/tmp/resume-output.md",
|
||||
"--output-schema",
|
||||
"/tmp/schema.json",
|
||||
PROMPT,
|
||||
]);
|
||||
|
||||
@@ -51,6 +53,7 @@ fn resume_accepts_output_last_message_flag_after_subcommand() {
|
||||
cli.last_message_file,
|
||||
Some(PathBuf::from("/tmp/resume-output.md"))
|
||||
);
|
||||
assert_eq!(cli.output_schema, Some(PathBuf::from("/tmp/schema.json")));
|
||||
let Some(Command::Resume(args)) = cli.command else {
|
||||
panic!("expected resume command");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user