pub struct CloseRule { /* private fields */ }Implementations§
Source§impl CloseRule
impl CloseRule
Sourcepub fn for_agent(agent: AgentKind) -> Self
pub fn for_agent(agent: AgentKind) -> Self
The close rule for a specific agent.
Selects the marker predicate by agent: Claude keeps
[crate::agent_result::event_is_top_level_result_marker]; Antigravity
uses [crate::agent_result::event_is_top_level_antigravity_result_marker]
(round-3 B1). Without the agent-aware predicate, an Antigravity stream’s
event: "result" object never sets marker_seen, stdin is never
released, and every real stage idle-times-out before its capture is read.
Vacuously-satisfied drain arms (Antigravity, B1). The
background_tasks / open_tasks arms read type: "system" subtypes
(background_tasks_changed, task_started, task_notification, …)
that the Antigravity CLI never emits — its event-key schema has no
type field at all. An Antigravity rule therefore stays at
NeverAnnounced / empty forever and CloseRule::should_close reduces
to the marker predicate. This is STATED, not silently inherited: it is a
documented property of the Antigravity transport, asserted by the
close-rule tests (close_rule_antigravity_*).
Sourcepub fn has_open_background_tasks(&self) -> bool
pub fn has_open_background_tasks(&self) -> bool
Whether any background task is known to be outstanding.
The idle-timeout arm consults this: a parent that is correctly quiet while a subagent works is not idle, and killing it is the defect this predicate exists to prevent.
Sourcepub fn should_close(&self) -> bool
pub fn should_close(&self) -> bool
Whether both arms hold and the child’s stdin may be released.