Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

fix(app-server): fix optional bool annotations (#24099)

Owen Lincff960896c41
diff --git a/codex-rs/app-server-protocol/schema/json/ClientRequest.json b/codex-rs/app-server-protocol/schema/json/ClientRequest.json
index 97b5f698c2..7595527c21 100644
--- a/codex-rs/app-server-protocol/schema/json/ClientRequest.json
+++ b/codex-rs/app-server-protocol/schema/json/ClientRequest.json
@@ -423,7 +423,6 @@
]
},
"includeLayers": {
- "default": false,
"type": "boolean"
}
},
@@ -721,8 +720,7 @@
}
},
"required": [
- "classification",
- "includeLogs"
+ "classification"
],
"type": "object"
},
@@ -1034,7 +1032,6 @@
"GetAccountParams": {
"properties": {
"refreshToken": {
- "default": false,
"description": "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.",
"type": "boolean"
}
@@ -3424,7 +3421,6 @@
"ThreadReadParams": {
"properties": {
"includeTurns": {
- "default": false,
"description": "When true, include turns and their items from rollout history.",
"type": "boolean"
},
diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json
index 155afbb29b..c0fbcc1653 100644
--- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json
+++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json
@@ -7691,7 +7691,6 @@
]
},
"includeLayers": {
- "default": false,
"type": "boolean"
}
},
@@ -8593,8 +8592,7 @@
}
},
"required": [
- "classification",
- "includeLogs"
+ "classification"
],
"title": "FeedbackUploadParams",
"type": "object"
@@ -9370,7 +9368,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"refreshToken": {
- "default": false,
"description": "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.",
"type": "boolean"
}
@@ -16965,7 +16962,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"includeTurns": {
- "default": false,
"description": "When true, include turns and their items from rollout history.",
"type": "boolean"
},
diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json
index a636cf1de3..c27890931d 100644
--- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json
+++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json
@@ -4060,7 +4060,6 @@
]
},
"includeLayers": {
- "default": false,
"type": "boolean"
}
},
@@ -4962,8 +4961,7 @@
}
},
"required": [
- "classification",
- "includeLogs"
+ "classification"
],
"title": "FeedbackUploadParams",
"type": "object"
@@ -5850,7 +5848,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"refreshToken": {
- "default": false,
"description": "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.",
"type": "boolean"
}
@@ -14789,7 +14786,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"includeTurns": {
- "default": false,
"description": "When true, include turns and their items from rollout history.",
"type": "boolean"
},
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ConfigReadParams.json b/codex-rs/app-server-protocol/schema/json/v2/ConfigReadParams.json
index b173d2ba95..db38089a5d 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ConfigReadParams.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ConfigReadParams.json
@@ -9,7 +9,6 @@
]
},
"includeLayers": {
- "default": false,
"type": "boolean"
}
},
diff --git a/codex-rs/app-server-protocol/schema/json/v2/FeedbackUploadParams.json b/codex-rs/app-server-protocol/schema/json/v2/FeedbackUploadParams.json
index 07c2098606..3bf0c62194 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/FeedbackUploadParams.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/FeedbackUploadParams.json
@@ -39,8 +39,7 @@
}
},
"required": [
- "classification",
- "includeLogs"
+ "classification"
],
"title": "FeedbackUploadParams",
"type": "object"
diff --git a/codex-rs/app-server-protocol/schema/json/v2/GetAccountParams.json b/codex-rs/app-server-protocol/schema/json/v2/GetAccountParams.json
index ca18a451e9..445e90c101 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/GetAccountParams.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/GetAccountParams.json
@@ -2,7 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"refreshToken": {
- "default": false,
"description": "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.",
"type": "boolean"
}
diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadParams.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadParams.json
index f5e5503cc0..5fb1bcc17b 100644
--- a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadParams.json
+++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadParams.json
@@ -2,7 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"includeTurns": {
- "default": false,
"description": "When true, include turns and their items from rollout history.",
"type": "boolean"
},
diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigReadParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigReadParams.ts
index 1fd418d182..7acf72c850 100644
--- a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigReadParams.ts
+++ b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigReadParams.ts
@@ -2,7 +2,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
-export type ConfigReadParams = { includeLayers: boolean,
+export type ConfigReadParams = { includeLayers?: boolean,
/**
* Optional working directory to resolve project config layers. If specified,
* return the effective config as seen from that directory (i.e., including any
diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FeedbackUploadParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FeedbackUploadParams.ts
index 86d9de2f0d..2afabd6e4a 100644
--- a/codex-rs/app-server-protocol/schema/typescript/v2/FeedbackUploadParams.ts
+++ b/codex-rs/app-server-protocol/schema/typescript/v2/FeedbackUploadParams.ts
@@ -2,4 +2,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
-export type FeedbackUploadParams = { classification: string, reason?: string | null, threadId?: string | null, includeLogs: boolean, extraLogFiles?: Array<string> | null, tags?: { [key in string]?: string } | null, };
+export type FeedbackUploadParams = { classification: string, reason?: string | null, threadId?: string | null, includeLogs?: boolean, extraLogFiles?: Array<string> | null, tags?: { [key in string]?: string } | null, };
diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountParams.ts
index a5c5c25f66..9e82ef5e13 100644
--- a/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountParams.ts
+++ b/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountParams.ts
@@ -10,4 +10,4 @@ export type GetAccountParams = {
* external auth mode this flag is ignored. Clients should refresh tokens
* themselves and call `account/login/start` with `chatgptAuthTokens`.
*/
-refreshToken: boolean, };
+refreshToken?: boolean, };
diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadReadParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadReadParams.ts
index 64169d2bf6..c26e896481 100644
--- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadReadParams.ts
+++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadReadParams.ts
@@ -6,4 +6,4 @@ export type ThreadReadParams = { threadId: string,
/**
* When true, include turns and their items from rollout history.
*/
-includeTurns: boolean, };
+includeTurns?: boolean, };
diff --git a/codex-rs/app-server-protocol/src/protocol/common.rs b/codex-rs/app-server-protocol/src/protocol/common.rs
index dd19711168..a8bec6b402 100644
--- a/codex-rs/app-server-protocol/src/protocol/common.rs
+++ b/codex-rs/app-server-protocol/src/protocol/common.rs
@@ -2547,8 +2547,22 @@ mod tests {
json!({
"method": "account/read",
"id": 6,
+ "params": {}
+ }),
+ serde_json::to_value(&request)?,
+ );
+ let request = ClientRequest::GetAccount {
+ request_id: RequestId::Integer(7),
+ params: v2::GetAccountParams {
+ refresh_token: true,
+ },
+ };
+ assert_eq!(
+ json!({
+ "method": "account/read",
+ "id": 7,
"params": {
- "refreshToken": false
+ "refreshToken": true
}
}),
serde_json::to_value(&request)?,
diff --git a/codex-rs/app-server-protocol/src/protocol/v2/account.rs b/codex-rs/app-server-protocol/src/protocol/v2/account.rs
index efb4a26f60..796c93d555 100644
--- a/codex-rs/app-server-protocol/src/protocol/v2/account.rs
+++ b/codex-rs/app-server-protocol/src/protocol/v2/account.rs
@@ -224,7 +224,7 @@ pub struct GetAccountParams {
/// In managed auth mode this triggers the normal refresh-token flow. In
/// external auth mode this flag is ignored. Clients should refresh tokens
/// themselves and call `account/login/start` with `chatgptAuthTokens`.
- #[serde(default)]
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub refresh_token: bool,
}
diff --git a/codex-rs/app-server-protocol/src/protocol/v2/config.rs b/codex-rs/app-server-protocol/src/protocol/v2/config.rs
index 16f9bf154b..c30106b1d4 100644
--- a/codex-rs/app-server-protocol/src/protocol/v2/config.rs
+++ b/codex-rs/app-server-protocol/src/protocol/v2/config.rs
@@ -357,7 +357,7 @@ pub enum ConfigWriteErrorCode {
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ConfigReadParams {
- #[serde(default)]
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub include_layers: bool,
/// Optional working directory to resolve project config layers. If specified,
/// return the effective config as seen from that directory (i.e., including any
diff --git a/codex-rs/app-server-protocol/src/protocol/v2/feedback.rs b/codex-rs/app-server-protocol/src/protocol/v2/feedback.rs
index aaf966a4bf..fdddb3aaa7 100644
--- a/codex-rs/app-server-protocol/src/protocol/v2/feedback.rs
+++ b/codex-rs/app-server-protocol/src/protocol/v2/feedback.rs
@@ -14,6 +14,7 @@ pub struct FeedbackUploadParams {
pub reason: Option<String>,
#[ts(optional = nullable)]
pub thread_id: Option<String>,
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub include_logs: bool,
#[ts(optional = nullable)]
pub extra_log_files: Option<Vec<PathBuf>>,
diff --git a/codex-rs/app-server-protocol/src/protocol/v2/thread.rs b/codex-rs/app-server-protocol/src/protocol/v2/thread.rs
index 01d8bc2a6d..4971d5f4b8 100644
--- a/codex-rs/app-server-protocol/src/protocol/v2/thread.rs
+++ b/codex-rs/app-server-protocol/src/protocol/v2/thread.rs
@@ -162,13 +162,13 @@ pub struct ThreadStartParams {
/// If true, opt into emitting raw Responses API items on the event stream.
/// This is for internal use only (e.g. Codex Cloud).
#[experimental("thread/start.experimentalRawEvents")]
- #[serde(default)]
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub experimental_raw_events: bool,
/// Deprecated and ignored by app-server. Kept only so older clients can
/// continue sending the field while rollout persistence always uses the
/// limited history policy.
#[experimental("thread/start.persistFullHistory")]
- #[serde(default)]
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub persist_extended_history: bool,
}
@@ -401,7 +401,7 @@ pub struct ThreadResumeParams {
/// continue sending the field while rollout persistence always uses the
/// limited history policy.
#[experimental("thread/resume.persistFullHistory")]
- #[serde(default)]
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub persist_extended_history: bool,
}
@@ -518,7 +518,7 @@ pub struct ThreadForkParams {
/// continue sending the field while rollout persistence always uses the
/// limited history policy.
#[experimental("thread/fork.persistFullHistory")]
- #[serde(default)]
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub persist_extended_history: bool,
}
@@ -1132,7 +1132,7 @@ pub enum ThreadActiveFlag {
pub struct ThreadReadParams {
pub thread_id: String,
/// When true, include turns and their items from rollout history.
- #[serde(default)]
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub include_turns: bool,
}