Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 31 additions & 4 deletions codex-rs/app-server-protocol/src/protocol/v2/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ use codex_protocol::config_types::WebSearchToolConfig;
use codex_protocol::openai_models::ReasoningEffort;
use codex_utils_absolute_path::AbsolutePathBuf;
use schemars::JsonSchema;
use schemars::r#gen::SchemaGenerator;
use schemars::schema::Schema;
use serde::Deserialize;
use serde::Serialize;
use serde_json::Value as JsonValue;
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::path::PathBuf;
Expand Down Expand Up @@ -731,6 +734,32 @@ pub struct TextRange {
pub end: TextPosition,
}

struct RequiredNullable<T>(std::marker::PhantomData<T>);

impl<T> JsonSchema for RequiredNullable<T>
where
Option<T>: JsonSchema,
{
fn is_referenceable() -> bool {
false
}

fn schema_name() -> String {
format!(
"RequiredNullable_for_{}",
<Option<T> as JsonSchema>::schema_name()
)
}

fn schema_id() -> Cow<'static, str> {
Cow::Owned(Self::schema_name())
}

fn json_schema(generator: &mut SchemaGenerator) -> Schema {
<Option<T> as JsonSchema>::json_schema(generator)
}
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
Expand All @@ -740,11 +769,9 @@ pub struct ConfigWarningNotification {
/// Optional extra guidance or error details.
pub details: Option<String>,
/// Optional path to the config file that triggered the warning.
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
#[schemars(with = "RequiredNullable<String>", required)]
pub path: Option<String>,
/// Optional range for the error location inside the config file.
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
#[schemars(with = "RequiredNullable<TextRange>", required)]
pub range: Option<TextRange>,
}
2 changes: 1 addition & 1 deletion codex-rs/app-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ Event notifications are the server-initiated event stream for thread lifecycles,

Thread realtime uses a separate thread-scoped notification surface. `thread/realtime/*` notifications are ephemeral transport events, not `ThreadItem`s, and are not returned by `thread/read`, `thread/resume`, or `thread/fork`.

Recoverable configuration and initialization warnings use the existing `configWarning` notification: `{ summary, details?, path?, range? }`. App-server may emit it during initialization for config parsing and related setup diagnostics.
Recoverable configuration and initialization warnings use the existing `configWarning` notification: `{ summary, details, path, range }`, where nullable fields are present as `null`. App-server may emit it during initialization for config parsing and related setup diagnostics.

Generic runtime warnings use the `warning` notification: `{ threadId?, message }`. App-server emits this for non-fatal warnings from the core event stream, including cases where not all enabled skills are included in the model-visible skills list for a session.

Expand Down
2 changes: 2 additions & 0 deletions codex-rs/app-server/src/outgoing_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ mod tests {
"params": {
"summary": "Config error: using defaults",
"details": "error loading config: bad config",
"path": null,
"range": null,
},
}),
serde_json::to_value(jsonrpc_notification)
Expand Down
Loading