mirror of
https://github.com/openai/codex.git
synced 2026-11-21 22:50:37 +00:00
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
39 lines
1.4 KiB
Rust
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>>;
|
|
}
|