From 5253106741821a2712d940c5ef7679fbeb7415c1 Mon Sep 17 00:00:00 2001 From: Filinto Duran <1373693+filintod@users.noreply.github.com> Date: Mon, 20 Oct 2025 19:00:25 -0500 Subject: [PATCH] running make format always shows this diff for me Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com> --- src/agents/extensions/models/litellm_model.py | 2 +- .../memory/test_sqlalchemy_session.py | 21 +++++++++---------- .../test_openai_chatcompletions_converter.py | 11 ++++++---- tests/test_strict_schema_oneof.py | 8 ++----- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/agents/extensions/models/litellm_model.py b/src/agents/extensions/models/litellm_model.py index 055df15a3..2fc10ae43 100644 --- a/src/agents/extensions/models/litellm_model.py +++ b/src/agents/extensions/models/litellm_model.py @@ -269,7 +269,7 @@ async def _fetch_response( ) # Fix for interleaved thinking bug: reorder messages to ensure tool_use comes before tool_result # noqa: E501 - if 'anthropic' in self.model.lower() or 'claude' in self.model.lower(): + if "anthropic" in self.model.lower() or "claude" in self.model.lower(): converted_messages = self._fix_tool_message_ordering(converted_messages) if system_instructions: diff --git a/tests/extensions/memory/test_sqlalchemy_session.py b/tests/extensions/memory/test_sqlalchemy_session.py index 496d0b027..5d4f35bc3 100644 --- a/tests/extensions/memory/test_sqlalchemy_session.py +++ b/tests/extensions/memory/test_sqlalchemy_session.py @@ -219,19 +219,20 @@ async def test_get_items_same_timestamp_consistent_order(): ) ) id_map = { - json.loads(message_json)["id"]: row_id - for row_id, message_json in rows.fetchall() + json.loads(message_json)["id"]: row_id for row_id, message_json in rows.fetchall() } shared = datetime(2025, 10, 15, 17, 26, 39, 132483) older = shared - timedelta(milliseconds=1) await sess.execute( update(session._messages) - .where(session._messages.c.id.in_( - [ - id_map["rs_same_ts"], - id_map["msg_same_ts"], - ] - )) + .where( + session._messages.c.id.in_( + [ + id_map["rs_same_ts"], + id_map["msg_same_ts"], + ] + ) + ) .values(created_at=shared) ) await sess.execute( @@ -320,9 +321,7 @@ async def test_pop_item_same_timestamp_returns_latest(): async with session._session_factory() as sess: await sess.execute( text( - "UPDATE agent_messages " - "SET created_at = :created_at " - "WHERE session_id = :session_id" + "UPDATE agent_messages SET created_at = :created_at WHERE session_id = :session_id" ), { "created_at": "2025-10-15 17:26:39.132483", diff --git a/tests/test_openai_chatcompletions_converter.py b/tests/test_openai_chatcompletions_converter.py index 4c5674388..18dfdf045 100644 --- a/tests/test_openai_chatcompletions_converter.py +++ b/tests/test_openai_chatcompletions_converter.py @@ -303,10 +303,13 @@ def test_extract_all_content_rejects_invalid_input_audio(): """ input_audio requires both data and format fields to be present. """ - audio_missing_data = cast(ResponseInputAudioParam, { - "type": "input_audio", - "input_audio": {"format": "wav"}, - }) + audio_missing_data = cast( + ResponseInputAudioParam, + { + "type": "input_audio", + "input_audio": {"format": "wav"}, + }, + ) with pytest.raises(UserError): Converter.extract_all_content([audio_missing_data]) diff --git a/tests/test_strict_schema_oneof.py b/tests/test_strict_schema_oneof.py index d6a145b57..7e289e70f 100644 --- a/tests/test_strict_schema_oneof.py +++ b/tests/test_strict_schema_oneof.py @@ -239,9 +239,7 @@ def test_oneof_with_refs(): schema = { "type": "object", "properties": { - "value": { - "oneOf": [{"$ref": "#/$defs/StringType"}, {"$ref": "#/$defs/IntType"}] - } + "value": {"oneOf": [{"$ref": "#/$defs/StringType"}, {"$ref": "#/$defs/IntType"}]} }, "$defs": { "StringType": {"type": "string"}, @@ -254,9 +252,7 @@ def test_oneof_with_refs(): expected = { "type": "object", "properties": { - "value": { - "anyOf": [{"$ref": "#/$defs/StringType"}, {"$ref": "#/$defs/IntType"}] - } + "value": {"anyOf": [{"$ref": "#/$defs/StringType"}, {"$ref": "#/$defs/IntType"}]} }, "$defs": { "StringType": {"type": "string"},