Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Skip message-board notification previews when there are no recipients (#48072)

jifca60d6fa72aa
diff --git a/codex-rs/core/tests/suite/scenarios_agent_message_board.rs b/codex-rs/core/tests/suite/scenarios_agent_message_board.rs
index 2abb0a8fb8..d110775998 100644
--- a/codex-rs/core/tests/suite/scenarios_agent_message_board.rs
+++ b/codex-rs/core/tests/suite/scenarios_agent_message_board.rs
@@ -131,8 +131,12 @@ async fn board_requires_persistent_v2_runtime(
Ok(())
}
+#[test_case::test_case(false; "disk")]
+#[test_case::test_case(true; "in_memory")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
-async fn board_post_and_reads_reach_model_context_without_self_notices() -> anyhow::Result<()> {
+async fn board_post_and_reads_reach_model_context_without_self_notices(
+ in_memory: bool,
+) -> anyhow::Result<()> {
let server = responses::start_mock_server().await;
let mock = responses::mount_sse_sequence(&server, vec![
tool("post-decision", "post", json!({"new_channel_name":"design", "text":"A shared decision.", "agents_to_notify":["/root"]})),
@@ -140,8 +144,9 @@ async fn board_post_and_reads_reach_model_context_without_self_notices() -> anyh
done(),
]).await;
let test = test_codex()
- .with_config(|config| {
+ .with_config(move |config| {
configure(config);
+ config.multi_agent_v2.message_board_in_memory = in_memory;
config.current_time_reminder = Some(codex_core::config::CurrentTimeReminderConfig {
clock_source: codex_features::CurrentTimeSource::External,
..Default::default()
diff --git a/codex-rs/ext/agent-message-board/src/in_memory.rs b/codex-rs/ext/agent-message-board/src/in_memory.rs
index 572ab1c401..0dca16cede 100644
--- a/codex-rs/ext/agent-message-board/src/in_memory.rs
+++ b/codex-rs/ext/agent-message-board/src/in_memory.rs
@@ -326,6 +326,9 @@ impl InMemoryAgentMessageBoard {
}
}
state.subscribe(SubscriptionTarget::Thread(root), caller);
+ if recipients.is_empty() {
+ return Ok(metadata);
+ }
(metadata, state.posts[index].preview(/*max_chars*/ 150))
};
futures::stream::iter(recipients).for_each_concurrent(/*limit*/ 16, |recipient| {