aboutsummaryrefslogtreecommitdiff
path: root/tests/api_ping.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-04-16 22:12:44 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-04-16 22:17:09 +0300
commit0b831c86274486af9f9f7052c2534374b498bb3a (patch)
tree3e8130be85cb387c8c3e57591617c4c7be0a26ec /tests/api_ping.rs
parent318e6a3033b61082d9c330c79ef584cf37e6c6d0 (diff)
feat: allow hook-reported custom agent labels
Diffstat (limited to 'tests/api_ping.rs')
-rw-r--r--tests/api_ping.rs45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/api_ping.rs b/tests/api_ping.rs
index ea4a9ef1..acd7f1b8 100644
--- a/tests/api_ping.rs
+++ b/tests/api_ping.rs
@@ -957,6 +957,51 @@ fn pane_report_agent_updates_effective_state() {
#[cfg(not(target_os = "macos"))]
#[test]
+fn pane_report_agent_accepts_unknown_agent_labels() {
+ let _lock = test_lock();
+ let base = unique_test_dir();
+ let config_home = base.join("config");
+ let runtime_dir = base.join("runtime");
+ let socket_path = runtime_dir.join("herdr.sock");
+ let child = spawn_herdr(&config_home, &runtime_dir, &socket_path);
+ wait_for_socket(&socket_path, Duration::from_secs(5));
+
+ let created = send_request(
+ &socket_path,
+ &format!(
+ r#"{{"id":"req_hook_generic_1","method":"workspace.create","params":{{"cwd":"{}","focus":true}}}}"#,
+ base.display()
+ ),
+ );
+ let pane_id = created["result"]["workspace"]["workspace_id"]
+ .as_str()
+ .map(|workspace_id| format!("{}-1", workspace_id))
+ .unwrap();
+
+ let hook = send_request(
+ &socket_path,
+ &format!(
+ r#"{{"id":"req_hook_generic_2","method":"pane.report_agent","params":{{"pane_id":"{}","source":"custom:hermes","agent":"hermes","state":"working"}}}}"#,
+ pane_id
+ ),
+ );
+ assert_eq!(hook["result"]["type"], "ok");
+
+ let pane = send_request(
+ &socket_path,
+ &format!(
+ r#"{{"id":"req_hook_generic_3","method":"pane.get","params":{{"pane_id":"{}"}}}}"#,
+ pane_id
+ ),
+ );
+ assert_eq!(pane["result"]["pane"]["agent"], "hermes");
+ assert_eq!(pane["result"]["pane"]["agent_status"], "working");
+
+ cleanup_spawned_herdr(child, base);
+}
+
+#[cfg(not(target_os = "macos"))]
+#[test]
fn pane_release_agent_suppresses_reacquire_during_graceful_exit() {
let _lock = test_lock();
let base = unique_test_dir();