refactor(agents,core,frontends): typed kinds, prompts per kind, frontend agents as parameters
This commit is contained in:
@@ -634,3 +634,24 @@ async def test_spawn_defaults_agent_and_materializes(world: World) -> None:
|
||||
with pytest.raises(ValueError, match="no default agent for kind 'job'"):
|
||||
await world.conversations.spawn(kind="job", seed="clean")
|
||||
await world.settle(deep, 1)
|
||||
|
||||
|
||||
def test_agent_kinds_follow_prompts(tmp_path: Path) -> None:
|
||||
from beaver_gateway.agents.claude import Prompts
|
||||
|
||||
plain = ClaudeAgent(name="p", model="m", system_prompt="hi", cwd=tmp_path)
|
||||
assert plain.kinds == ("deep",)
|
||||
dispatcher = ClaudeAgent(
|
||||
name="x", model="m", cwd=tmp_path, prompts=Prompts(master=("a.md",), fork=())
|
||||
)
|
||||
assert dispatcher.kinds == ("master", "fork")
|
||||
assert dispatcher.prompt_for("master") == ("a.md",)
|
||||
assert dispatcher.prompt_for("deep") is None
|
||||
with pytest.raises(ValueError, match=r"serves \['deep'\] without a prompt"):
|
||||
ClaudeAgent(
|
||||
name="y",
|
||||
model="m",
|
||||
cwd=tmp_path,
|
||||
kinds=("master", "deep"),
|
||||
prompts=Prompts(master=()),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user