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 f04916b820..d41e973391 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 @@ -3479,6 +3479,23 @@ ], "type": "object" }, + "EphemeralContext": { + "properties": { + "text": { + "description": "Free-form text payload for additional context sent with one turn.", + "type": "string" + }, + "title": { + "description": "Human-readable title for additional context sent with one turn.", + "type": "string" + } + }, + "required": [ + "text", + "title" + ], + "type": "object" + }, "ErrorNotification": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -10933,6 +10950,16 @@ ], "description": "Override the reasoning effort for this turn and subsequent turns." }, + "ephemeralContext": { + "description": "Additional model-visible context for this turn, such as editor or IDE state. If compaction happens while this turn is still in progress, the current turn's ephemeral context is preserved so the turn can continue. Ephemeral context from older turns is stripped during compaction, so clients should send a fresh snapshot on each turn instead of expecting it to persist automatically.", + "items": { + "$ref": "#/definitions/EphemeralContext" + }, + "type": [ + "array", + "null" + ] + }, "input": { "items": { "$ref": "#/definitions/UserInput" diff --git a/codex-rs/core/tests/suite/permissions_messages.rs b/codex-rs/core/tests/suite/permissions_messages.rs index 5515390d4c..3533a5d316 100644 --- a/codex-rs/core/tests/suite/permissions_messages.rs +++ b/codex-rs/core/tests/suite/permissions_messages.rs @@ -107,6 +107,7 @@ async fn permissions_message_mentions_additional_permissions_for_legacy_exec_flo text: "hello".into(), text_elements: Vec::new(), }], + ephemeral_context: Vec::new(), final_output_json_schema: None, }) .await?; @@ -149,6 +150,7 @@ async fn permissions_message_omits_additional_permissions_without_exec_approvals text: "hello".into(), text_elements: Vec::new(), }], + ephemeral_context: Vec::new(), final_output_json_schema: None, }) .await?; diff --git a/codex-rs/core/tests/suite/plugins.rs b/codex-rs/core/tests/suite/plugins.rs index b84675b7c8..f01dd55267 100644 --- a/codex-rs/core/tests/suite/plugins.rs +++ b/codex-rs/core/tests/suite/plugins.rs @@ -387,6 +387,7 @@ async fn explicit_plugin_mentions_track_plugin_used_analytics() -> Result<()> { name: "sample".into(), path: format!("plugin://{SAMPLE_PLUGIN_CONFIG_NAME}"), }], + ephemeral_context: Vec::new(), final_output_json_schema: None, }) .await?;