Skip to content
Merged
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
22 changes: 22 additions & 0 deletions codex-rs/core/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,9 @@
"clock_source": {
"$ref": "#/definitions/CurrentTimeSource"
},
"delivery_mode": {
"$ref": "#/definitions/CurrentTimeReminderDeliveryMode"
},
"enabled": {
"type": "boolean"
},
Expand All @@ -825,6 +828,25 @@
},
"type": "object"
},
"CurrentTimeReminderDeliveryMode": {
"description": "Which inference boundaries may receive current-time reminders.",
"oneOf": [
{
"description": "Allow a reminder before any inference request once the interval is due.",
"enum": [
"any_inference"
],
"type": "string"
},
{
"description": "Allow reminders after user input or tool output; new context windows still force one.",
"enum": [
"after_user_or_tool_output"
],
"type": "string"
}
]
},
"CurrentTimeSource": {
"enum": [
"system",
Expand Down
2 changes: 2 additions & 0 deletions codex-rs/core/src/config/config_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,13 @@ current_time_reminder = true
enabled = true
reminder_interval_seconds = 0
clock_source = "external"
delivery_mode = "after_user_or_tool_output"
sleep_tool = true
"#,
CurrentTimeReminderConfig {
reminder_interval_seconds: 0,
clock_source: CurrentTimeSource::External,
delivery_mode: CurrentTimeReminderDeliveryMode::AfterUserOrToolOutput,
sleep_tool: true,
},
),
Expand Down
6 changes: 6 additions & 0 deletions codex-rs/core/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ use codex_exec_server::ExecutorFileSystem;
use codex_exec_server::LOCAL_FS;
use codex_features::CodeModeConfigToml;
use codex_features::CurrentTimeReminderConfigToml;
use codex_features::CurrentTimeReminderDeliveryMode;
use codex_features::CurrentTimeSource;
use codex_features::Feature;
use codex_features::FeatureConfigSource;
Expand Down Expand Up @@ -1120,6 +1121,7 @@ pub struct RolloutBudgetConfig {
pub struct CurrentTimeReminderConfig {
pub reminder_interval_seconds: u64,
pub clock_source: CurrentTimeSource,
pub delivery_mode: CurrentTimeReminderDeliveryMode,
Comment thread
rka-oai marked this conversation as resolved.
/// Whether to expose the input-interruptible `clock.sleep` tool.
pub sleep_tool: bool,
}
Expand All @@ -1129,6 +1131,7 @@ impl Default for CurrentTimeReminderConfig {
Self {
reminder_interval_seconds: 1,
clock_source: CurrentTimeSource::System,
delivery_mode: CurrentTimeReminderDeliveryMode::AnyInference,
sleep_tool: false,
}
}
Expand Down Expand Up @@ -2691,6 +2694,9 @@ fn resolve_current_time_reminder_config(
clock_source: base
.and_then(|config| config.clock_source)
.unwrap_or(default.clock_source),
delivery_mode: base
.and_then(|config| config.delivery_mode)
.unwrap_or(default.delivery_mode),
sleep_tool: base
.and_then(|config| config.sleep_tool)
.unwrap_or(default.sleep_tool),
Expand Down
1 change: 1 addition & 0 deletions codex-rs/core/src/session/config_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ mod tests {
enabled: Some(true),
reminder_interval_seconds: Some(1),
clock_source: Some(codex_features::CurrentTimeSource::System),
delivery_mode: Some(codex_features::CurrentTimeReminderDeliveryMode::AnyInference),
sleep_tool: Some(false),
}))
);
Expand Down
13 changes: 13 additions & 0 deletions codex-rs/features/src/feature_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ pub enum CurrentTimeSource {
External,
}

/// Which inference boundaries may receive current-time reminders.
#[derive(Serialize, Deserialize, Debug, Clone, Copy, Default, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum CurrentTimeReminderDeliveryMode {
/// Allow a reminder before any inference request once the interval is due.
#[default]
AnyInference,
/// Allow reminders after user input or tool output; new context windows still force one.
AfterUserOrToolOutput,
}

#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, JsonSchema)]
#[serde(deny_unknown_fields)]
pub struct CurrentTimeReminderConfigToml {
Expand All @@ -150,6 +161,8 @@ pub struct CurrentTimeReminderConfigToml {
pub reminder_interval_seconds: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub clock_source: Option<CurrentTimeSource>,
#[serde(skip_serializing_if = "Option::is_none")]
pub delivery_mode: Option<CurrentTimeReminderDeliveryMode>,
Comment thread
rka-oai marked this conversation as resolved.
/// Expose the input-interruptible `clock.sleep` tool.
#[serde(skip_serializing_if = "Option::is_none")]
pub sleep_tool: Option<bool>,
Expand Down
1 change: 1 addition & 0 deletions codex-rs/features/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mod feature_configs;
mod legacy;
pub use feature_configs::CodeModeConfigToml;
pub use feature_configs::CurrentTimeReminderConfigToml;
pub use feature_configs::CurrentTimeReminderDeliveryMode;
pub use feature_configs::CurrentTimeSource;
pub use feature_configs::MultiAgentV2ConfigToml;
pub use feature_configs::NetworkProxyConfigToml;
Expand Down
Loading