Skip to content

Commit 9d2679d

Browse files
committed
codex: fix rebase drift on PR #13657
1 parent 2bc923b commit 9d2679d

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

codex-rs/core/src/config/config_tests.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,6 +2248,7 @@ fn load_config_rejects_missing_agent_role_config_file() -> std::io::Result<()> {
22482248
max_threads: None,
22492249
max_depth: None,
22502250
job_max_runtime_seconds: None,
2251+
use_function_call_inbox: false,
22512252
roles: BTreeMap::from([(
22522253
"researcher".to_string(),
22532254
AgentRoleToml {
@@ -2327,6 +2328,7 @@ fn load_config_normalizes_agent_role_nickname_candidates() -> std::io::Result<()
23272328
max_threads: None,
23282329
max_depth: None,
23292330
job_max_runtime_seconds: None,
2331+
use_function_call_inbox: false,
23302332
roles: BTreeMap::from([(
23312333
"researcher".to_string(),
23322334
AgentRoleToml {
@@ -2368,6 +2370,7 @@ fn load_config_rejects_empty_agent_role_nickname_candidates() -> std::io::Result
23682370
max_threads: None,
23692371
max_depth: None,
23702372
job_max_runtime_seconds: None,
2373+
use_function_call_inbox: false,
23712374
roles: BTreeMap::from([(
23722375
"researcher".to_string(),
23732376
AgentRoleToml {
@@ -2403,6 +2406,7 @@ fn load_config_rejects_duplicate_agent_role_nickname_candidates() -> std::io::Re
24032406
max_threads: None,
24042407
max_depth: None,
24052408
job_max_runtime_seconds: None,
2409+
use_function_call_inbox: false,
24062410
roles: BTreeMap::from([(
24072411
"researcher".to_string(),
24082412
AgentRoleToml {
@@ -2438,6 +2442,7 @@ fn load_config_rejects_unsafe_agent_role_nickname_candidates() -> std::io::Resul
24382442
max_threads: None,
24392443
max_depth: None,
24402444
job_max_runtime_seconds: None,
2445+
use_function_call_inbox: false,
24412446
roles: BTreeMap::from([(
24422447
"researcher".to_string(),
24432448
AgentRoleToml {
@@ -2677,6 +2682,7 @@ fn test_precedence_fixture_with_o3_profile() -> std::io::Result<()> {
26772682
agent_roles: BTreeMap::new(),
26782683
memories: MemoriesConfig::default(),
26792684
agent_job_max_runtime_seconds: DEFAULT_AGENT_JOB_MAX_RUNTIME_SECONDS,
2685+
agent_use_function_call_inbox: false,
26802686
codex_home: fixture.codex_home(),
26812687
sqlite_home: fixture.codex_home(),
26822688
log_dir: fixture.codex_home().join("log"),
@@ -2806,6 +2812,7 @@ fn test_precedence_fixture_with_gpt3_profile() -> std::io::Result<()> {
28062812
agent_roles: BTreeMap::new(),
28072813
memories: MemoriesConfig::default(),
28082814
agent_job_max_runtime_seconds: DEFAULT_AGENT_JOB_MAX_RUNTIME_SECONDS,
2815+
agent_use_function_call_inbox: false,
28092816
codex_home: fixture.codex_home(),
28102817
sqlite_home: fixture.codex_home(),
28112818
log_dir: fixture.codex_home().join("log"),
@@ -2933,6 +2940,7 @@ fn test_precedence_fixture_with_zdr_profile() -> std::io::Result<()> {
29332940
agent_roles: BTreeMap::new(),
29342941
memories: MemoriesConfig::default(),
29352942
agent_job_max_runtime_seconds: DEFAULT_AGENT_JOB_MAX_RUNTIME_SECONDS,
2943+
agent_use_function_call_inbox: false,
29362944
codex_home: fixture.codex_home(),
29372945
sqlite_home: fixture.codex_home(),
29382946
log_dir: fixture.codex_home().join("log"),
@@ -3046,6 +3054,7 @@ fn test_precedence_fixture_with_gpt5_profile() -> std::io::Result<()> {
30463054
agent_roles: BTreeMap::new(),
30473055
memories: MemoriesConfig::default(),
30483056
agent_job_max_runtime_seconds: DEFAULT_AGENT_JOB_MAX_RUNTIME_SECONDS,
3057+
agent_use_function_call_inbox: false,
30493058
codex_home: fixture.codex_home(),
30503059
sqlite_home: fixture.codex_home(),
30513060
log_dir: fixture.codex_home().join("log"),

codex-rs/core/src/config/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ pub struct Config {
356356
pub agent_max_threads: Option<usize>,
357357
/// Maximum runtime in seconds for agent job workers before they are failed.
358358
pub agent_job_max_runtime_seconds: Option<u64>,
359+
/// When true, inbound agent messages to non-subagent threads are delivered
360+
/// as a synthetic function_call/function_call_output pair instead of plain
361+
/// user input.
362+
pub agent_use_function_call_inbox: bool,
359363

360364
/// Maximum nesting depth allowed for spawned agent threads.
361365
pub agent_max_depth: i32,
@@ -1376,6 +1380,10 @@ pub struct AgentsToml {
13761380
/// Default maximum runtime in seconds for agent job workers.
13771381
#[schemars(range(min = 1))]
13781382
pub job_max_runtime_seconds: Option<u64>,
1383+
/// Deliver inbound agent messages to non-subagent threads as a synthetic
1384+
/// function_call/function_call_output pair instead of plain user input.
1385+
#[serde(default)]
1386+
pub use_function_call_inbox: bool,
13791387

13801388
/// User-defined role declarations keyed by role name.
13811389
///
@@ -1919,6 +1927,10 @@ impl Config {
19191927
.as_ref()
19201928
.and_then(|agents| agents.job_max_runtime_seconds)
19211929
.or(DEFAULT_AGENT_JOB_MAX_RUNTIME_SECONDS);
1930+
let agent_use_function_call_inbox = cfg
1931+
.agents
1932+
.as_ref()
1933+
.is_some_and(|agents| agents.use_function_call_inbox);
19221934
if agent_job_max_runtime_seconds == Some(0) {
19231935
return Err(std::io::Error::new(
19241936
std::io::ErrorKind::InvalidInput,
@@ -2177,6 +2189,7 @@ impl Config {
21772189
agent_roles,
21782190
memories: cfg.memories.unwrap_or_default().into(),
21792191
agent_job_max_runtime_seconds,
2192+
agent_use_function_call_inbox,
21802193
codex_home,
21812194
sqlite_home,
21822195
log_dir,

0 commit comments

Comments
 (0)