mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-08 06:23:59 -05:00
Add litellm_extra_body metadata for V1 conversations (#12266)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -793,7 +793,15 @@ class TestLiveStatusAppConversationService:
|
||||
"""Test _finalize_conversation_request with skills loading."""
|
||||
# Arrange
|
||||
mock_agent = Mock(spec=Agent)
|
||||
|
||||
# Create mock LLM with required attributes for _update_agent_with_llm_metadata
|
||||
mock_llm = Mock(spec=LLM)
|
||||
mock_llm.model = 'gpt-4' # Non-openhands model, so no metadata update
|
||||
mock_llm.usage_id = 'agent'
|
||||
|
||||
mock_updated_agent = Mock(spec=Agent)
|
||||
mock_updated_agent.llm = mock_llm
|
||||
mock_updated_agent.condenser = None # No condenser
|
||||
mock_experiment_manager.run_agent_variant_tests__v1.return_value = (
|
||||
mock_updated_agent
|
||||
)
|
||||
@@ -852,7 +860,15 @@ class TestLiveStatusAppConversationService:
|
||||
"""Test _finalize_conversation_request without remote workspace (no skills)."""
|
||||
# Arrange
|
||||
mock_agent = Mock(spec=Agent)
|
||||
|
||||
# Create mock LLM with required attributes for _update_agent_with_llm_metadata
|
||||
mock_llm = Mock(spec=LLM)
|
||||
mock_llm.model = 'gpt-4' # Non-openhands model, so no metadata update
|
||||
mock_llm.usage_id = 'agent'
|
||||
|
||||
mock_updated_agent = Mock(spec=Agent)
|
||||
mock_updated_agent.llm = mock_llm
|
||||
mock_updated_agent.condenser = None # No condenser
|
||||
mock_experiment_manager.run_agent_variant_tests__v1.return_value = (
|
||||
mock_updated_agent
|
||||
)
|
||||
@@ -890,7 +906,15 @@ class TestLiveStatusAppConversationService:
|
||||
"""Test _finalize_conversation_request when skills loading fails."""
|
||||
# Arrange
|
||||
mock_agent = Mock(spec=Agent)
|
||||
|
||||
# Create mock LLM with required attributes for _update_agent_with_llm_metadata
|
||||
mock_llm = Mock(spec=LLM)
|
||||
mock_llm.model = 'gpt-4' # Non-openhands model, so no metadata update
|
||||
mock_llm.usage_id = 'agent'
|
||||
|
||||
mock_updated_agent = Mock(spec=Agent)
|
||||
mock_updated_agent.llm = mock_llm
|
||||
mock_updated_agent.condenser = None # No condenser
|
||||
mock_experiment_manager.run_agent_variant_tests__v1.return_value = (
|
||||
mock_updated_agent
|
||||
)
|
||||
|
||||
@@ -139,6 +139,7 @@ class TestExperimentManagerIntegration:
|
||||
|
||||
mock_agent = Mock(spec=Agent)
|
||||
mock_agent.llm = mock_llm
|
||||
mock_agent.condenser = None # No condenser for this test
|
||||
mock_agent.system_prompt_filename = 'default_system_prompt.j2'
|
||||
mock_agent.model_copy = Mock(return_value=mock_agent)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user