This commit is contained in:
Fahad
2025-06-13 16:05:21 +04:00
parent 6739182c20
commit 048ebf90bf
13 changed files with 46 additions and 26 deletions

View File

@@ -284,7 +284,7 @@ I'd be happy to examine the error handling patterns in more detail if that would
turns = [
ConversationTurn(
role="assistant" if i % 2 else "user",
content=f"Turn {i+1}",
content=f"Turn {i + 1}",
timestamp="2023-01-01T00:00:00Z",
tool_name="test_continuation",
)

View File

@@ -246,9 +246,9 @@ class TestCollaborationWorkflow:
)
response = json.loads(result[0].text)
assert (
response["status"] == "requires_clarification"
), "Should request clarification when asked about dependencies without package files"
assert response["status"] == "requires_clarification", (
"Should request clarification when asked about dependencies without package files"
)
clarification = json.loads(response["content"])
assert "package.json" in str(clarification["files_needed"]), "Should specifically request package.json"

View File

@@ -95,7 +95,9 @@ class TestCustomProvider:
# Call with an alias
result = provider.generate_content(
prompt="test prompt", model_name="llama", temperature=0.7 # This is an alias
prompt="test prompt",
model_name="llama",
temperature=0.7, # This is an alias
)
# Verify parent method was called with resolved model name

View File

@@ -76,7 +76,6 @@ class TestIntelligentFallback:
patch("config.DEFAULT_MODEL", "auto"),
patch.dict(os.environ, {"OPENAI_API_KEY": "sk-test-key", "GEMINI_API_KEY": ""}, clear=False),
):
ModelProviderRegistry.clear_cache()
# Create a context with at least one turn so it doesn't exit early
@@ -115,7 +114,6 @@ class TestIntelligentFallback:
patch("config.DEFAULT_MODEL", "auto"),
patch.dict(os.environ, {"OPENAI_API_KEY": "", "GEMINI_API_KEY": "test-key"}, clear=False),
):
ModelProviderRegistry.clear_cache()
from utils.conversation_memory import ConversationTurn
@@ -148,7 +146,6 @@ class TestIntelligentFallback:
from utils.conversation_memory import ThreadContext, build_conversation_history
with patch("config.IS_AUTO_MODE", False), patch("config.DEFAULT_MODEL", "gemini-2.5-pro-preview-06-05"):
from utils.conversation_memory import ConversationTurn
context = ThreadContext(

View File

@@ -233,7 +233,11 @@ TEMPERATURE_ANALYTICAL = 0.2 # For code review, debugging
# Test the centralized file preparation method directly
file_content = tool._prepare_file_content_for_prompt(
[config_path], None, "Test files", max_tokens=100000, reserve_tokens=1000 # No continuation
[config_path],
None,
"Test files",
max_tokens=100000,
reserve_tokens=1000, # No continuation
)
# Should contain file markers

View File

@@ -34,9 +34,9 @@ class TestThinkingModes:
]
for tool, expected_default in tools:
assert (
tool.get_default_thinking_mode() == expected_default
), f"{tool.__class__.__name__} should default to {expected_default}"
assert tool.get_default_thinking_mode() == expected_default, (
f"{tool.__class__.__name__} should default to {expected_default}"
)
@pytest.mark.asyncio
@patch("tools.base.BaseTool.get_model_provider")