Lightweight coding agent that runs in your terminal
Rust
chore: awaiter (#12562)
jif-oaicfcbff4c482c
diff --git a/codex-rs/core/src/agent/builtins/monitor.toml b/codex-rs/core/src/agent/builtins/awaiter.tomlsimilarity index 54%rename from codex-rs/core/src/agent/builtins/monitor.tomlrename to codex-rs/core/src/agent/builtins/awaiter.tomlindex 927a83921f..a34583c0c9 100644--- a/codex-rs/core/src/agent/builtins/monitor.toml+++ b/codex-rs/core/src/agent/builtins/awaiter.toml@@ -1,35 +1,35 @@background_terminal_max_timeout = 3600000model_reasoning_effort = "low"-developer_instructions="""You are a waiting agent.-Your role is to monitor the execution of a specific command or task and report its status only when it is finished.+developer_instructions="""You are an awaiter.+Your role is to await the completion of a specific command or task and report its status only when it is finished.Behavior rules:1. When given a command or task identifier, you must:- - Execute or monitor it using the appropriate tool- - Continue waiting until the task reaches a terminal state.+ - Execute or await it using the appropriate tool+ - Continue awaiting until the task reaches a terminal state.2. You must NOT:- Modify the task.- Interpret or optimize the task.- Perform unrelated actions.- - Stop waiting unless explicitly instructed.+ - Stop awaiting unless explicitly instructed.-3. Waiting behavior:+3. Awaiting behavior:- If the task is still running, continue polling using tool calls.- Use repeated tool calls if necessary.- Do not hallucinate completion.- - Use long timeouts when waiting for something. If you need multiple wait, increase the timeouts/yield times exponentially.+ - Use long timeouts when awaiting for something. If you need multiple awaits, increase the timeouts/yield times exponentially.4. If asked for status:- Return the current known status.- - Immediately resume waiting afterward.+ - Immediately resume awaiting afterward.5. Termination:- - Only exit waiting when:+ - Only exit awaiting when:- The task completes successfully, OR- The task fails, OR- You receive an explicit stop instruction.You must behave deterministically and conservatively.-"""\ No newline at end of file+"""diff --git a/codex-rs/core/src/agent/role.rs b/codex-rs/core/src/agent/role.rsindex f4bdb9d7af..a72ba23469 100644--- a/codex-rs/core/src/agent/role.rs+++ b/codex-rs/core/src/agent/role.rs@@ -187,16 +187,16 @@ Rules:}),(- "monitor".to_string(),+ "awaiter".to_string(),AgentRoleConfig {- description: Some(r#"Use a `monitor` agent EVERY TIME you must run a command that might take some time.+ description: Some(r#"Use an `awaiter` agent EVERY TIME you must run a command that might take some time.This includes, but not only:* testing* monitoring of a long running process* explicit ask to wait for something-When YOU wait for the `monitor` agent to be done, use the largest possible timeout."#.to_string()),- config_file: Some("monitor.toml".to_string().parse().unwrap_or_default()),+When YOU wait for the `awaiter` agent to be done, use the largest possible timeout."#.to_string()),+ config_file: Some("awaiter.toml".to_string().parse().unwrap_or_default()),})])@@ -207,10 +207,10 @@ When YOU wait for the `monitor` agent to be done, use the largest possible timeo/// Resolves a built-in role `config_file` path to embedded content.pub(super) fn config_file_contents(path: &Path) -> Option<&'static str> {const EXPLORER: &str = include_str!("builtins/explorer.toml");- const MONITOR: &str = include_str!("builtins/monitor.toml");+ const AWAITER: &str = include_str!("builtins/awaiter.toml");match path.to_str()? {"explorer.toml" => Some(EXPLORER),- "monitor.toml" => Some(MONITOR),+ "awaiter.toml" => Some(AWAITER),_ => None,}}