Files
codex/codex-rs/message-board/src/host.rs
T
Adam Perry @ OpenAI cdfcc18dba Clarify remote message board and clock documentation (#61197)
Describe remote board connection settings, host ownership, and configured
clocks in general terms. Update the remote board test credential to match
that terminology.

GitOrigin-RevId: c2c32808c98afad849f6e4f59f75d8d204f51694
2026-11-12 22:41:50 +00:00

39 lines
1.4 KiB
Rust

//! Host capabilities needed by a board without depending on codex-core.
use crate::PostPreview;
use chrono::DateTime;
use chrono::Utc;
use codex_protocol::AgentPath;
use codex_protocol::ThreadId;
use codex_protocol::error::Result;
use futures::future::BoxFuture;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NotificationDelivery {
Accepted,
SkippedInactive,
}
/// Board-scoped membership, clock and notification access supplied by the host.
///
/// The host remains authoritative for membership even when runtimes are unloaded.
/// Clock reads use the posting agent's configured source.
/// Notifications follow the host's ordinary queue-only agent-message scheduling
/// and wake policy, and may be buffered for an idle recipient.
/// Acceptance does not guarantee that the model has consumed the notification.
/// Backends may implement these capabilities with local handles or remote RPCs.
pub trait MessageBoardHost: Send + Sync {
fn agent_path(&self, caller: ThreadId) -> BoxFuture<'_, Result<AgentPath>>;
fn resolve_agent(&self, path: AgentPath) -> BoxFuture<'_, Result<ThreadId>>;
fn current_time(&self, caller: ThreadId) -> BoxFuture<'_, Result<DateTime<Utc>>>;
/// Push metadata and a bounded preview. Full content is retrieved through bounded reads.
fn notify(
&self,
recipient: ThreadId,
post: PostPreview,
) -> BoxFuture<'_, Result<NotificationDelivery>>;
}