chore: remove belief collector and small tweaks
This commit is contained in:
@@ -359,6 +359,30 @@ async def test_simulated_real_turn_remove_belief(agent, llm, sample_program):
|
||||
assert any(b.name == "no_more_booze" for b in agent._current_beliefs.false)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_infer_goal_completions_sends_beliefs(agent, llm):
|
||||
"""Test that inferred goal completions are sent to the BDI core."""
|
||||
goal = BaseGoal(
|
||||
id=uuid.uuid4(), name="Say Hello", description="The user said hello", can_fail=True
|
||||
)
|
||||
agent.goal_inferrer.goals = {goal}
|
||||
|
||||
# Mock goal inference: goal is achieved
|
||||
llm.query = AsyncMock(return_value=True)
|
||||
|
||||
await agent._infer_goal_completions()
|
||||
|
||||
# Should send belief change to BDI core
|
||||
agent.send.assert_awaited_once()
|
||||
sent: InternalMessage = agent.send.call_args.args[0]
|
||||
assert sent.to == settings.agent_settings.bdi_core_name
|
||||
assert sent.thread == "beliefs"
|
||||
|
||||
parsed = BeliefMessage.model_validate_json(sent.body)
|
||||
assert len(parsed.create) == 1
|
||||
assert parsed.create[0].name == "achieved_say_hello"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_llm_failure_handling(agent, llm, sample_program):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user