diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-30 23:54:41 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-30 23:54:41 +0300 |
| commit | d477341e6af816ff4396042b084a0378ef437b4a (patch) | |
| tree | e332b6f7a0d23d9effd21c3ca8ab27698ed83444 /src/detect/agents/hermes.rs | |
| parent | 8df1639048529b383358000879b5ee078a90b9f9 (diff) | |
refactor: split agent detection by agent
Move screen detection into per-agent modules and keep visible-state arbitration centralized in terminal state.
Tighten Codex prompt-scoped working detection and Claude hook/screen recovery for stale blocked and idle reports.
Add a focused just recipe for single-test runs.
refs #349
refs #352
Diffstat (limited to 'src/detect/agents/hermes.rs')
| -rw-r--r-- | src/detect/agents/hermes.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/detect/agents/hermes.rs b/src/detect/agents/hermes.rs new file mode 100644 index 00000000..d6c4c97e --- /dev/null +++ b/src/detect/agents/hermes.rs @@ -0,0 +1,26 @@ +use super::super::AgentState; + +/// Hermes Agent detection. +/// +/// Hermes shows a bottom status bar while turns are active and modal approval +/// dialogs for dangerous terminal commands. Prefer the modal controls for +/// blocked detection, then the live interrupt/status controls for working. +pub(super) fn detect(content: &str) -> AgentState { + let lower = content.to_lowercase(); + + let has_approval_options = lower.contains("allow once") + && lower.contains("allow for this session") + && lower.contains("deny"); + let has_approval_controls = lower.contains("enter to confirm") + || lower.contains("↑/↓ to select") + || lower.contains("show full command"); + if (lower.contains("dangerous command") || has_approval_options) && has_approval_controls { + return AgentState::Blocked; + } + + if lower.contains("msg=interrupt") || lower.contains("ctrl+c cancel") { + return AgentState::Working; + } + + AgentState::Idle +} |
