Skip to content

Commit 19dd901

Browse files
committed
Bind run_state.get_prior result before chaining .content access
Mypy on CI flagged ``second_run_state.get_prior(...).content`` because ``get_prior`` returns Optional[AgentResponse]. The preceding ``is not None`` assert doesn't narrow the next call's return type. Bind the result first, assert non-None, then access .content.
1 parent eede220 commit 19dd901

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/unit/app/test_agents.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,9 @@ def get_agent_side_effect(agent_type, deps):
719719
assert first_run_state is second_run_state
720720

721721
# First agent saw an empty run_state; second agent saw history recorded
722-
assert second_run_state.get_prior("history") is not None
723-
assert second_run_state.get_prior("history").content == "History summary content"
722+
history_prior = second_run_state.get_prior("history")
723+
assert history_prior is not None
724+
assert history_prior.content == "History summary content"
724725

725726
@pytest.mark.asyncio
726727
async def test_orchestrator_sequential_passes_original_query(self):

0 commit comments

Comments
 (0)