mirror of
https://github.com/openai/codex.git
synced 2026-11-05 08:28:29 +00:00
[codex] add current time reminder delivery mode config (#30031)
```python delivery_mode = "any_inference" # default delivery_mode = "after_user_or_tool_output" # new mode ``` ## Validation - just test -p codex-core load_config_resolves_current_time_reminder - just test -p codex-core lock_contains_prompts_and_materializes_features
This commit is contained in:
1 parent
c65cfeab14
commit
e8d4a1a411
6 files changed
+45
No files matched your search
@@ -810,6 +810,9 @@
|
|||||||
"clock_source": {
|
"clock_source": {
|
||||||
"$ref": "#/definitions/CurrentTimeSource"
|
"$ref": "#/definitions/CurrentTimeSource"
|
||||||
},
|
},
|
||||||
|
"delivery_mode": {
|
||||||
|
"$ref": "#/definitions/CurrentTimeReminderDeliveryMode"
|
||||||
|
},
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
@@ -825,6 +828,25 @@
|
|||||||
},
|
},
|
||||||
"type": "object"
|
"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": {
|
"CurrentTimeSource": {
|
||||||
"enum": [
|
"enum": [
|
||||||
"system",
|
"system",
|
||||||
|
|||||||
@@ -627,11 +627,13 @@ current_time_reminder = true
|
|||||||
enabled = true
|
enabled = true
|
||||||
reminder_interval_seconds = 0
|
reminder_interval_seconds = 0
|
||||||
clock_source = "external"
|
clock_source = "external"
|
||||||
|
delivery_mode = "after_user_or_tool_output"
|
||||||
sleep_tool = true
|
sleep_tool = true
|
||||||
"#,
|
"#,
|
||||||
CurrentTimeReminderConfig {
|
CurrentTimeReminderConfig {
|
||||||
reminder_interval_seconds: 0,
|
reminder_interval_seconds: 0,
|
||||||
clock_source: CurrentTimeSource::External,
|
clock_source: CurrentTimeSource::External,
|
||||||
|
delivery_mode: CurrentTimeReminderDeliveryMode::AfterUserOrToolOutput,
|
||||||
sleep_tool: true,
|
sleep_tool: true,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ use codex_exec_server::ExecutorFileSystem;
|
|||||||
use codex_exec_server::LOCAL_FS;
|
use codex_exec_server::LOCAL_FS;
|
||||||
use codex_features::CodeModeConfigToml;
|
use codex_features::CodeModeConfigToml;
|
||||||
use codex_features::CurrentTimeReminderConfigToml;
|
use codex_features::CurrentTimeReminderConfigToml;
|
||||||
|
use codex_features::CurrentTimeReminderDeliveryMode;
|
||||||
use codex_features::CurrentTimeSource;
|
use codex_features::CurrentTimeSource;
|
||||||
use codex_features::Feature;
|
use codex_features::Feature;
|
||||||
use codex_features::FeatureConfigSource;
|
use codex_features::FeatureConfigSource;
|
||||||
@@ -1120,6 +1121,7 @@ pub struct RolloutBudgetConfig {
|
|||||||
pub struct CurrentTimeReminderConfig {
|
pub struct CurrentTimeReminderConfig {
|
||||||
pub reminder_interval_seconds: u64,
|
pub reminder_interval_seconds: u64,
|
||||||
pub clock_source: CurrentTimeSource,
|
pub clock_source: CurrentTimeSource,
|
||||||
|
pub delivery_mode: CurrentTimeReminderDeliveryMode,
|
||||||
/// Whether to expose the input-interruptible `clock.sleep` tool.
|
/// Whether to expose the input-interruptible `clock.sleep` tool.
|
||||||
pub sleep_tool: bool,
|
pub sleep_tool: bool,
|
||||||
}
|
}
|
||||||
@@ -1129,6 +1131,7 @@ impl Default for CurrentTimeReminderConfig {
|
|||||||
Self {
|
Self {
|
||||||
reminder_interval_seconds: 1,
|
reminder_interval_seconds: 1,
|
||||||
clock_source: CurrentTimeSource::System,
|
clock_source: CurrentTimeSource::System,
|
||||||
|
delivery_mode: CurrentTimeReminderDeliveryMode::AnyInference,
|
||||||
sleep_tool: false,
|
sleep_tool: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2691,6 +2694,9 @@ fn resolve_current_time_reminder_config(
|
|||||||
clock_source: base
|
clock_source: base
|
||||||
.and_then(|config| config.clock_source)
|
.and_then(|config| config.clock_source)
|
||||||
.unwrap_or(default.clock_source),
|
.unwrap_or(default.clock_source),
|
||||||
|
delivery_mode: base
|
||||||
|
.and_then(|config| config.delivery_mode)
|
||||||
|
.unwrap_or(default.delivery_mode),
|
||||||
sleep_tool: base
|
sleep_tool: base
|
||||||
.and_then(|config| config.sleep_tool)
|
.and_then(|config| config.sleep_tool)
|
||||||
.unwrap_or(default.sleep_tool),
|
.unwrap_or(default.sleep_tool),
|
||||||
|
|||||||
@@ -361,6 +361,7 @@ mod tests {
|
|||||||
enabled: Some(true),
|
enabled: Some(true),
|
||||||
reminder_interval_seconds: Some(1),
|
reminder_interval_seconds: Some(1),
|
||||||
clock_source: Some(codex_features::CurrentTimeSource::System),
|
clock_source: Some(codex_features::CurrentTimeSource::System),
|
||||||
|
delivery_mode: Some(codex_features::CurrentTimeReminderDeliveryMode::AnyInference),
|
||||||
sleep_tool: Some(false),
|
sleep_tool: Some(false),
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -141,6 +141,17 @@ pub enum CurrentTimeSource {
|
|||||||
External,
|
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)]
|
#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, JsonSchema)]
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct CurrentTimeReminderConfigToml {
|
pub struct CurrentTimeReminderConfigToml {
|
||||||
@@ -150,6 +161,8 @@ pub struct CurrentTimeReminderConfigToml {
|
|||||||
pub reminder_interval_seconds: Option<u64>,
|
pub reminder_interval_seconds: Option<u64>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub clock_source: Option<CurrentTimeSource>,
|
pub clock_source: Option<CurrentTimeSource>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub delivery_mode: Option<CurrentTimeReminderDeliveryMode>,
|
||||||
/// Expose the input-interruptible `clock.sleep` tool.
|
/// Expose the input-interruptible `clock.sleep` tool.
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub sleep_tool: Option<bool>,
|
pub sleep_tool: Option<bool>,
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ mod feature_configs;
|
|||||||
mod legacy;
|
mod legacy;
|
||||||
pub use feature_configs::CodeModeConfigToml;
|
pub use feature_configs::CodeModeConfigToml;
|
||||||
pub use feature_configs::CurrentTimeReminderConfigToml;
|
pub use feature_configs::CurrentTimeReminderConfigToml;
|
||||||
|
pub use feature_configs::CurrentTimeReminderDeliveryMode;
|
||||||
pub use feature_configs::CurrentTimeSource;
|
pub use feature_configs::CurrentTimeSource;
|
||||||
pub use feature_configs::MultiAgentV2ConfigToml;
|
pub use feature_configs::MultiAgentV2ConfigToml;
|
||||||
pub use feature_configs::NetworkProxyConfigToml;
|
pub use feature_configs::NetworkProxyConfigToml;
|
||||||
|
|||||||
Reference in new issue
Block a user