Returns true if the tool has entered an active execution phase (Running, Streaming, or any terminal state). Early pipeline stages (ParamsPartial, Queued, Waiting) should not overwrite these states, since priority queue ordering can cause late-arriving low-priority events to arrive after high-priority state transitions.
(&self)
| 42 | /// since priority queue ordering can cause late-arriving low-priority |
| 43 | /// events to arrive after high-priority state transitions. |
| 44 | pub fn is_execution_phase(&self) -> bool { |
| 45 | matches!( |
| 46 | self, |
| 47 | ToolDisplayStatus::Running |
| 48 | | ToolDisplayStatus::Streaming |
| 49 | | ToolDisplayStatus::Success |
| 50 | | ToolDisplayStatus::Failed |
| 51 | | ToolDisplayStatus::Cancelled |
| 52 | | ToolDisplayStatus::Rejected |
| 53 | ) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /// Message role for display |