pub struct ObserveRequest {
pub agent_id: Option<String>,
pub session_id: String,
pub cwd: Option<PathBuf>,
pub transcript_path: Option<PathBuf>,
pub event: SessionEvent,
pub repo: Option<String>,
pub model: Option<String>,
pub agent: Agent,
pub pid: Option<u32>,
}Expand description
An idempotent session sighting sent to the registry — the wire payload of the
observe op, and the argument to SessionsRegistry::observe.
The hook sink and the transcript watcher both produce these; every field but
session_id and event is best-effort and fills in missing data on an
existing entry without ever clobbering known data with None.
Fields§
§agent_id: Option<String>Claude subagent identity; absent for parent hooks and other feeds.
session_id: StringThe Claude session_id (a UUID) — the primary key. Equal to the
transcript filename stem and (per ADR-0052) the VS Code extension’s tab
key, so the three feeds join without heuristics.
cwd: Option<PathBuf>The session’s working directory, when known (from the hook cwd).
transcript_path: Option<PathBuf>The ~/.claude/projects/**/<session-id>.jsonl transcript path, when known.
event: SessionEventThe event that produced this sighting; drives the state inference.
repo: Option<String>The repository name enriched from cwd by the adapter (git2), when
resolvable. Stored verbatim; the engine does no disk I/O.
model: Option<String>The model id, when a hook reports one.
agent: AgentWhich agent the session belongs to; omitted for Claude Code.
pid: Option<u32>The agent process’s pid, when known: the hook sink’s parent, or
claude-wrap’s wrapped child. Tells a resumed session’s new process
from the old one it replaced, which share a session_id (#1948). Every
other feed (the watchers, the Codex app-server, pi.dev) sends None.
This is also the seed for pid-based liveness (#1916): the
[pid_watcher] independently probes every pid it sees here, off this
wire and off the registry lock, rather than trusting a client-supplied
process identity — see SessionEntry::pid_start.
Trait Implementations§
Source§impl Clone for ObserveRequest
impl Clone for ObserveRequest
Source§impl Debug for ObserveRequest
impl Debug for ObserveRequest
Source§impl<'de> Deserialize<'de> for ObserveRequest
impl<'de> Deserialize<'de> for ObserveRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ObserveRequest
impl RefUnwindSafe for ObserveRequest
impl Send for ObserveRequest
impl Sync for ObserveRequest
impl Unpin for ObserveRequest
impl UnsafeUnpin for ObserveRequest
impl UnwindSafe for ObserveRequest
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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