mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
chore(mypy): part-04 resolve mypy errors in meta_reference agents (#3969)
## Summary Fixes all mypy type errors in `providers/inline/agents/meta_reference/` and removes exclusions from pyproject.toml. ## Changes - Fix type annotations for Safety API message parameters (OpenAIMessageParam) - Add Action enum usage in access control checks - Correct method signatures to match API supertype (parameter ordering) - Handle optional return types with proper None checks - Remove 3 meta_reference exclusions from mypy config **Files fixed:** 25 errors across 3 files (safety.py, persistence.py, agents.py)
This commit is contained in:
parent
e6b27db30a
commit
c9d4b6c54f
7 changed files with 69 additions and 31 deletions
|
|
@ -192,18 +192,18 @@ async def test_create_agent_session_persistence(agents_impl, sample_agent_config
|
|||
assert session_response.session_id is not None
|
||||
|
||||
# Verify the session was stored
|
||||
session = await agents_impl.get_agents_session(agent_id, session_response.session_id)
|
||||
session = await agents_impl.get_agents_session(session_response.session_id, agent_id)
|
||||
assert session.session_name == "test_session"
|
||||
assert session.session_id == session_response.session_id
|
||||
assert session.started_at is not None
|
||||
assert session.turns == []
|
||||
|
||||
# Delete the session
|
||||
await agents_impl.delete_agents_session(agent_id, session_response.session_id)
|
||||
await agents_impl.delete_agents_session(session_response.session_id, agent_id)
|
||||
|
||||
# Verify the session was deleted
|
||||
with pytest.raises(ValueError):
|
||||
await agents_impl.get_agents_session(agent_id, session_response.session_id)
|
||||
await agents_impl.get_agents_session(session_response.session_id, agent_id)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("enable_session_persistence", [True, False])
|
||||
|
|
@ -226,11 +226,11 @@ async def test_list_agent_sessions_persistence(agents_impl, sample_agent_config,
|
|||
assert session2.session_id in session_ids
|
||||
|
||||
# Delete one session
|
||||
await agents_impl.delete_agents_session(agent_id, session1.session_id)
|
||||
await agents_impl.delete_agents_session(session1.session_id, agent_id)
|
||||
|
||||
# Verify the session was deleted
|
||||
with pytest.raises(ValueError):
|
||||
await agents_impl.get_agents_session(agent_id, session1.session_id)
|
||||
await agents_impl.get_agents_session(session1.session_id, agent_id)
|
||||
|
||||
# List sessions again
|
||||
sessions = await agents_impl.list_agent_sessions(agent_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue