pub struct PooledAgent {
pub ws_to_agent_tx: Sender<String>,
pub agent_to_ws_tx: Sender<String>,
pub connected: bool,
pub disconnected_at: Option<Instant>,
pub message_buffer: Vec<String>,
pub cached_init_response: Option<String>,
pub cached_session_response: Option<String>,
pub agent_command: String,
/* private fields */
}Expand description
A pooled agent process with its I/O handles
Fields§
§ws_to_agent_tx: Sender<String>Sender for messages going to the agent (from WebSocket to stdin)
agent_to_ws_tx: Sender<String>Broadcast sender for messages from agent stdout. Each new connection subscribes via .subscribe()
connected: boolWhether a client is currently connected
disconnected_at: Option<Instant>When the client last disconnected (for idle timeout)
message_buffer: Vec<String>Buffered messages from agent while client was disconnected
cached_init_response: Option<String>Cached initialize response from the agent (raw JSON-RPC result).
On reconnect we intercept the client’s initialize request and reply
with this cached response instead of forwarding to the agent.
cached_session_response: Option<String>Cached createSession response from the agent (raw JSON-RPC result).
On reconnect we intercept the client’s createSession request and reply
with this cached response, preserving the same session ID so the agent
keeps its conversation history.
agent_command: StringThe agent command used to spawn this agent
Implementations§
Auto Trait Implementations§
impl Freeze for PooledAgent
impl !RefUnwindSafe for PooledAgent
impl Send for PooledAgent
impl Sync for PooledAgent
impl Unpin for PooledAgent
impl UnsafeUnpin for PooledAgent
impl !UnwindSafe for PooledAgent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more