pub enum Agent {
Claude,
Pi,
Codex,
}Expand description
Which coding agent a session belongs to.
The registry is keyed by session_id alone. Claude Code’s ids are UUID v4,
while pi.dev’s and Codex’s are both UUID v7, so the version nibble no longer
separates every pair (#1907): single-key identity instead rests on v7’s 74
random bits, which make a pi/Codex collision improbable — not impossible, and
not worth a re-key (ADR-0087). The tag lets a consumer tell the agents apart.
Serialized snake_case; absent on the wire means Claude, so
the Claude feeds (hooks, watcher, claude-wrap) send it by omission and stay
byte-identical to senders that predate it (#1901).
A daemon built with an older variant set rejects an unknown value
(unknown variant), so a newer sink’s observe is dropped until the daemon
is upgraded — the sinks are fail-open, so that is silent.
Variants§
Claude
Claude Code — every feed but the pi extension.
Pi
pi.dev’s coding agent, reported by the extension sessions install-hooks
writes into ~/.pi/agent/extensions/.
Codex
OpenAI Codex (CLI, VS Code extension and Desktop), reported by
sessions hook --agent codex from $CODEX_HOME/hooks.json (#1907).
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn display_name(self) -> &'static str
pub fn display_name(self) -> &'static str
The agent’s display name, for the tray and other human-facing labels.
Sourcepub fn is_claude(&self) -> bool
pub fn is_claude(&self) -> bool
Whether this is the default agent, so ObserveRequest can omit it.
Trait Implementations§
impl Copy for Agent
Source§impl<'de> Deserialize<'de> for Agent
impl<'de> Deserialize<'de> for Agent
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>,
impl Eq for Agent
impl StructuralPartialEq for Agent
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl UnwindSafe for Agent
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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