34 34 The extension records input origin in extension-instance memory because `agent_end` does not expose it.
35 35 It records idle `input` as a candidate, then confirms it at `before_agent_start` only when Pi accepts the prompt.
36 36 This prevents handled input from leaking eligibility into extension-triggered runs that start without an `input` event.
37 -Pi drains steering and queued follow-ups inside the active agent lifecycle.
38 -Interactive input received while active becomes a candidate, then a user `message_start` confirms Pi accepted it before making the lifecycle eligible.
39 -Handled active input therefore cannot create a notification or leak into the next run.
37 +The accepted input that starts the lifecycle determines eligibility.
38 +Later steering and queued follow-ups do not reclassify extension-driven work.
39 +If pre-prompt compaction starts the lifecycle before `before_agent_start`, that hook still promotes its accepted input into the active lifecycle.
40 40 Pi dispatches extension events serially, so this is event-order bookkeeping rather than cross-thread synchronization.
41 41 State is cleared on completion and session shutdown.
42 42 Nothing is written to disk or session history.
44 -Interactive steering and queued follow-up input make the active agent lifecycle eligible.
45 44 RPC, SDK, extension, JSON, and print activity never makes a run eligible.
47 46 Low-level `agent_end` events update the latest outcome without notifying.
124 123 ##
Failure Handling 126 125 Native delivery is best-effort and never blocks or fails the Pi turn.
127 -Spawn errors and nonzero exits fall back once to OSC.
126 +Spawn errors, nonzero exits, and a five-second native-command timeout fall back once to OSC.
128 127 OSC write failures are ignored because no further backend remains.
129 128 Focus setup and teardown remain best-effort and session-scoped.
137 136 - native backend choice and Kitty/generic OSC fallback choice
138 137 - direct interactive TUI eligibility
139 138 - suppression for RPC, JSON, print, SDK-style, and extension input
140 -- candidate, accepted, and active-lifecycle input-origin bookkeeping
139 +- candidate, accepted, and active-lifecycle input-origin bookkeeping, including pre-prompt compaction ordering
141 140 - focused-terminal suppression and no notification before `agent_settled`
142 141 - native success and native failure through a controlled fake executable on the current platform
143 142 - loading through the real Pi extension harness