|
17 | 17 | from agent_env.task.task import Task |
18 | 18 | from agent_env.task_step.context import TaskStepContext |
19 | 19 | from agent_env.task_step.task_steps.install_agent import InstallAgentTaskStep |
| 20 | +from agent_env.task_step.task_steps.prompt_agent import user_sim_agents |
20 | 21 | from tst.unit.bundle._support import layout, store_agent |
21 | 22 |
|
22 | 23 | ROOT = "@local/~/triage" |
@@ -119,6 +120,41 @@ def test_only_the_steps_deploying_or_installing_the_agent_a_step_prompts_are_the |
119 | 120 | assert solver_steps(steps) == ("solver", "installed") |
120 | 121 |
|
121 | 122 |
|
| 123 | +def test_the_agent_an_always_on_step_wakes_is_the_solver(): |
| 124 | + steps = [ |
| 125 | + {"id": "solver", "type": "deploy_agent"}, |
| 126 | + {"id": "user", "type": "deploy_user_sim_agent", "agent_name": "linda"}, |
| 127 | + {"id": "loop", "type": "always_on", "user_sim": "linda"}, |
| 128 | + ] |
| 129 | + |
| 130 | + assert solver_steps(steps) == ("solver",) |
| 131 | + |
| 132 | + |
| 133 | +def test_the_agent_an_always_on_step_talks_to_as_its_user_is_never_the_solvers(): |
| 134 | + """Even when a step prompts it, as a briefing would, and another step installs it.""" |
| 135 | + steps = [ |
| 136 | + {"id": "solver", "type": "deploy_agent"}, |
| 137 | + {"id": "user", "type": "deploy_user_sim_agent", "agent_name": "linda"}, |
| 138 | + {"id": "installed", "type": "install_agent", "agent_name": "linda", "sandbox_name": "box"}, |
| 139 | + {"id": "brief", "type": "prompt_agent", "agent_name": "linda"}, |
| 140 | + {"id": "loop", "type": "always_on", "user_sim": "linda"}, |
| 141 | + ] |
| 142 | + |
| 143 | + assert solver_steps(steps) == ("solver",) |
| 144 | + assert user_sim_agents(steps) == {"linda", "human_agent"} |
| 145 | + |
| 146 | + |
| 147 | +def test_a_prompt_agent_tasks_solver_and_user_agents_are_as_on_main(): |
| 148 | + steps = [ |
| 149 | + {"id": "solver", "type": "deploy_agent"}, |
| 150 | + {"id": "user", "type": "deploy_agent", "agent_name": "human_agent"}, |
| 151 | + {"id": "ask", "type": "prompt_agent", "max_conversation_turns": 3}, |
| 152 | + ] |
| 153 | + |
| 154 | + assert solver_steps(steps) == ("solver",) |
| 155 | + assert user_sim_agents(steps) == {"human_agent"} |
| 156 | + |
| 157 | + |
122 | 158 | def test_preflight_checks_the_agent_the_solver_deploys(bundle_dir, monkeypatch): |
123 | 159 | checked = [] |
124 | 160 | original = preflight_module._Walk._agent_deploy |
|
0 commit comments