diff --git a/codex-rs/app-server-protocol/src/export.rs b/codex-rs/app-server-protocol/src/export.rs index 4de66dfb3..a60c1be62 100644 --- a/codex-rs/app-server-protocol/src/export.rs +++ b/codex-rs/app-server-protocol/src/export.rs @@ -31,6 +31,7 @@ use std::process::Command; use ts_rs::TS; const HEADER: &str = "// GENERATED CODE! DO NOT MODIFY BY HAND!\n\n"; +const IGNORED_DEFINITIONS: &[&str] = &["Option<()>"]; #[derive(Clone)] pub struct GeneratedSchema { @@ -184,7 +185,6 @@ fn build_schema_bundle(schemas: Vec) -> Result { "ServerNotification", "ServerRequest", ]; - const IGNORED_DEFINITIONS: &[&str] = &["Option<()>"]; let namespaced_types = collect_namespaced_types(&schemas); let mut definitions = Map::new(); @@ -304,8 +304,11 @@ where out_dir.join(format!("{file_stem}.json")) }; - write_pretty_json(out_path, &schema_value) - .with_context(|| format!("Failed to write JSON schema for {file_stem}"))?; + if !IGNORED_DEFINITIONS.contains(&logical_name) { + write_pretty_json(out_path, &schema_value) + .with_context(|| format!("Failed to write JSON schema for {file_stem}"))?; + } + let namespace = match raw_namespace { Some("v1") | None => None, Some(ns) => Some(ns.to_string()),