| 239 | /// appropriate subsystem. |
| 240 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
| 241 | pub enum Action { |
| 242 | /// Record the turn's file changes as an Atomic change. |
| 243 | /// |
| 244 | /// Replaces Entire CLI's `ActionCondense`. The orchestrator should: |
| 245 | /// 1. Call `watcher.end_turn()` to get `TurnChanges` |
| 246 | /// 2. Call `record_turn()` to create an Atomic change |
| 247 | /// 3. Apply the change to the agent's view |
| 248 | RecordTurn, |
| 249 | |
| 250 | /// Record only if files were actually modified during the turn. |
| 251 | /// |
| 252 | /// Replaces Entire CLI's `ActionCondenseIfFilesTouched`. Used in the |
| 253 | /// `Ended` phase when a record event occurs — only creates a change |
| 254 | /// if there are actual file modifications to capture. |
| 255 | RecordIfChanged, |
| 256 | |
| 257 | /// Discard the session if no files were touched. |
| 258 | /// |
| 259 | /// Same as Entire CLI's `ActionDiscardIfNoFiles`. If the session ended |
| 260 | /// and a record event occurs with no file changes, the session state |
| 261 | /// can be cleaned up. |
| 262 | DiscardIfNoFiles, |
| 263 | |
| 264 | /// Update the session's `last_interaction` timestamp. |
| 265 | /// |
| 266 | /// Applied directly to the session state by `apply_common_actions()`. |
| 267 | /// This is used for stale session detection in `atomic agent status`. |
| 268 | UpdateInteraction, |
| 269 | |
| 270 | /// Clear the `ended_at` timestamp (session is re-entering). |
| 271 | /// |
| 272 | /// Applied directly to the session state by `apply_common_actions()`. |
| 273 | /// This happens when a SessionStart event arrives for an ended session. |
| 274 | ClearEndedAt, |
| 275 | |
| 276 | /// Warn the user about stale concurrent sessions. |
| 277 | /// |
| 278 | /// This is emitted when a SessionStart or TurnStart event arrives |
| 279 | /// while another session is already active. The orchestrator should |
| 280 | /// log a warning but continue processing. |
| 281 | WarnStaleSession, |
| 282 | } |
| 283 | |
| 284 | impl Action { |
| 285 | /// Returns `true` if this action requires strategy-specific handling. |
nothing calls this directly
no outgoing calls
no test coverage detected