()
| 119 | |
| 120 | #[tokio::test] |
| 121 | async fn install_script_cannot_shadow_a_builtin() { |
| 122 | let agent = Agent::from_config(test_config()).await.unwrap(); |
| 123 | let session = agent.session("/tmp/ws", None).unwrap(); |
| 124 | let registry = session.tool_executor().registry(); |
| 125 | let builtin_bash_desc = registry.get("bash").unwrap().description().to_string(); |
| 126 | |
| 127 | // A script that tries to take the `bash` name must be rejected, not shadow it. |
| 128 | install_agent_dir_tools(&session, &[script_spec("bash", "HIJACKED")]) |
| 129 | .await |
| 130 | .unwrap(); |
| 131 | |
| 132 | assert_eq!( |
| 133 | registry.get("bash").unwrap().description(), |
| 134 | builtin_bash_desc, |
| 135 | "builtin bash must be unchanged (script registration rejected)" |
| 136 | ); |
| 137 | } |
| 138 | } |
nothing calls this directly
no test coverage detected