Migration from Docker to Standalone Python Server (#73)
* Migration from docker to standalone server Migration handling Fixed tests Use simpler in-memory storage Support for concurrent logging to disk Simplified direct connections to localhost * Migration from docker / redis to standalone script Updated tests Updated run script Fixed requirements Use dotenv Ask if user would like to install MCP in Claude Desktop once Updated docs * More cleanup and references to docker removed * Cleanup * Comments * Fixed tests * Fix GitHub Actions workflow for standalone Python architecture - Install requirements-dev.txt for pytest and testing dependencies - Remove Docker setup from simulation tests (now standalone) - Simplify linting job to use requirements-dev.txt - Update simulation tests to run directly without Docker Fixes unit test failures in CI due to missing pytest dependency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Remove simulation tests from GitHub Actions - Removed simulation-tests job that makes real API calls - Keep only unit tests (mocked, no API costs) and linting - Simulation tests should be run manually with real API keys - Reduces CI costs and complexity GitHub Actions now only runs: - Unit tests (569 tests, all mocked) - Code quality checks (ruff, black) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fixed tests * Fixed tests --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
9d72545ecd
commit
4151c3c3a5
@@ -246,9 +246,9 @@ class TestLargePromptHandling:
|
||||
|
||||
assert len(result) == 1
|
||||
output = json.loads(result[0].text)
|
||||
# The precommit tool may return success or clarification_required depending on git state
|
||||
# The precommit tool may return success or files_required_to_continue depending on git state
|
||||
# The core fix ensures large prompts are detected at the right time
|
||||
assert output["status"] in ["success", "clarification_required", "resend_prompt"]
|
||||
assert output["status"] in ["success", "files_required_to_continue", "resend_prompt"]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_debug_large_error_description(self, large_prompt):
|
||||
@@ -298,17 +298,26 @@ class TestLargePromptHandling:
|
||||
)
|
||||
mock_get_provider.return_value = mock_provider
|
||||
|
||||
# Mock the centralized file preparation method to avoid file system access
|
||||
with patch.object(tool, "_prepare_file_content_for_prompt") as mock_prepare_files:
|
||||
mock_prepare_files.return_value = ("File content", [other_file])
|
||||
# Mock handle_prompt_file to verify prompt.txt is handled
|
||||
with patch.object(tool, "handle_prompt_file") as mock_handle_prompt:
|
||||
# Return the prompt content and updated files list (without prompt.txt)
|
||||
mock_handle_prompt.return_value = ("Large prompt content from file", [other_file])
|
||||
|
||||
await tool.execute({"prompt": "", "files": [temp_prompt_file, other_file]})
|
||||
# Mock the centralized file preparation method
|
||||
with patch.object(tool, "_prepare_file_content_for_prompt") as mock_prepare_files:
|
||||
mock_prepare_files.return_value = ("File content", [other_file])
|
||||
|
||||
# Verify prompt.txt was removed from files list
|
||||
mock_prepare_files.assert_called_once()
|
||||
files_arg = mock_prepare_files.call_args[0][0]
|
||||
assert len(files_arg) == 1
|
||||
assert files_arg[0] == other_file
|
||||
# Use a small prompt to avoid triggering size limit
|
||||
await tool.execute({"prompt": "Test prompt", "files": [temp_prompt_file, other_file]})
|
||||
|
||||
# Verify handle_prompt_file was called with the original files list
|
||||
mock_handle_prompt.assert_called_once_with([temp_prompt_file, other_file])
|
||||
|
||||
# Verify _prepare_file_content_for_prompt was called with the updated files list (without prompt.txt)
|
||||
mock_prepare_files.assert_called_once()
|
||||
files_arg = mock_prepare_files.call_args[0][0]
|
||||
assert len(files_arg) == 1
|
||||
assert files_arg[0] == other_file
|
||||
|
||||
temp_dir = os.path.dirname(temp_prompt_file)
|
||||
shutil.rmtree(temp_dir)
|
||||
|
||||
Reference in New Issue
Block a user