Add DocGen tool with comprehensive documentation generation capabilities (#109)

* WIP: new workflow architecture

* WIP: further improvements and cleanup

* WIP: cleanup and docks, replace old tool with new

* WIP: cleanup and docks, replace old tool with new

* WIP: new planner implementation using workflow

* WIP: precommit tool working as a workflow instead of a basic tool
Support for passing False to use_assistant_model to skip external models completely and use Claude only

* WIP: precommit workflow version swapped with old

* WIP: codereview

* WIP: replaced codereview

* WIP: replaced codereview

* WIP: replaced refactor

* WIP: workflow for thinkdeep

* WIP: ensure files get embedded correctly

* WIP: thinkdeep replaced with workflow version

* WIP: improved messaging when an external model's response is received

* WIP: analyze tool swapped

* WIP: updated tests
* Extract only the content when building history
* Use "relevant_files" for workflow tools only

* WIP: updated tests
* Extract only the content when building history
* Use "relevant_files" for workflow tools only

* WIP: fixed get_completion_next_steps_message missing param

* Fixed tests
Request for files consistently

* Fixed tests
Request for files consistently

* Fixed tests

* New testgen workflow tool
Updated docs

* Swap testgen workflow

* Fix CI test failures by excluding API-dependent tests

- Update GitHub Actions workflow to exclude simulation tests that require API keys
- Fix collaboration tests to properly mock workflow tool expert analysis calls
- Update test assertions to handle new workflow tool response format
- Ensure unit tests run without external API dependencies in CI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* WIP - Update tests to match new tools

* WIP - Update tests to match new tools

* WIP - Update tests to match new tools

* Should help with https://github.com/BeehiveInnovations/zen-mcp-server/issues/97
Clear python cache when running script: https://github.com/BeehiveInnovations/zen-mcp-server/issues/96
Improved retry error logging
Cleanup

* WIP - chat tool using new architecture and improved code sharing

* Removed todo

* Removed todo

* Cleanup old name

* Tweak wordings

* Tweak wordings
Migrate old tests

* Support for Flash 2.0 and Flash Lite 2.0

* Support for Flash 2.0 and Flash Lite 2.0

* Support for Flash 2.0 and Flash Lite 2.0
Fixed test

* Improved consensus to use the workflow base class

* Improved consensus to use the workflow base class

* Allow images

* Allow images

* Replaced old consensus tool

* Cleanup tests

* Tests for prompt size

* New tool: docgen
Tests for prompt size
Fixes: https://github.com/BeehiveInnovations/zen-mcp-server/issues/107
Use available token size limits: https://github.com/BeehiveInnovations/zen-mcp-server/issues/105

* Improved docgen prompt
Exclude TestGen from pytest inclusion

* Updated errors

* Lint

* DocGen instructed not to fix bugs, surface them and stick to d

* WIP

* Stop claude from being lazy and only documenting a small handful

* More style rules

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Beehive Innovations
2025-06-21 23:21:19 -07:00
committed by GitHub
parent 0655590a51
commit c960bcb720
58 changed files with 5492 additions and 5558 deletions

View File

@@ -51,6 +51,18 @@ ModelProviderRegistry.register_provider(ProviderType.GOOGLE, GeminiModelProvider
ModelProviderRegistry.register_provider(ProviderType.OPENAI, OpenAIModelProvider)
ModelProviderRegistry.register_provider(ProviderType.XAI, XAIModelProvider)
# Register CUSTOM provider if CUSTOM_API_URL is available (for integration tests)
# But only if we're actually running integration tests, not unit tests
if os.getenv("CUSTOM_API_URL") and "test_prompt_regression.py" in os.getenv("PYTEST_CURRENT_TEST", ""):
from providers.custom import CustomProvider # noqa: E402
def custom_provider_factory(api_key=None):
"""Factory function that creates CustomProvider with proper parameters."""
base_url = os.getenv("CUSTOM_API_URL", "")
return CustomProvider(api_key=api_key or "", base_url=base_url)
ModelProviderRegistry.register_provider(ProviderType.CUSTOM, custom_provider_factory)
@pytest.fixture
def project_path(tmp_path):
@@ -99,6 +111,20 @@ def mock_provider_availability(request, monkeypatch):
if ProviderType.XAI not in registry._providers:
ModelProviderRegistry.register_provider(ProviderType.XAI, XAIModelProvider)
# Ensure CUSTOM provider is registered if needed for integration tests
if (
os.getenv("CUSTOM_API_URL")
and "test_prompt_regression.py" in os.getenv("PYTEST_CURRENT_TEST", "")
and ProviderType.CUSTOM not in registry._providers
):
from providers.custom import CustomProvider
def custom_provider_factory(api_key=None):
base_url = os.getenv("CUSTOM_API_URL", "")
return CustomProvider(api_key=api_key or "", base_url=base_url)
ModelProviderRegistry.register_provider(ProviderType.CUSTOM, custom_provider_factory)
from unittest.mock import MagicMock
original_get_provider = ModelProviderRegistry.get_provider_for_model
@@ -108,7 +134,7 @@ def mock_provider_availability(request, monkeypatch):
if model_name in ["unavailable-model", "gpt-5-turbo", "o3"]:
return None
# For common test models, return a mock provider
if model_name in ["gemini-2.5-flash", "gemini-2.5-pro", "pro", "flash"]:
if model_name in ["gemini-2.5-flash", "gemini-2.5-pro", "pro", "flash", "local-llama"]:
# Try to use the real provider first if it exists
real_provider = original_get_provider(model_name)
if real_provider:
@@ -118,10 +144,16 @@ def mock_provider_availability(request, monkeypatch):
provider = MagicMock()
# Set up the model capabilities mock with actual values
capabilities = MagicMock()
capabilities.context_window = 1000000 # 1M tokens for Gemini models
capabilities.supports_extended_thinking = False
capabilities.input_cost_per_1k = 0.075
capabilities.output_cost_per_1k = 0.3
if model_name == "local-llama":
capabilities.context_window = 128000 # 128K tokens for local-llama
capabilities.supports_extended_thinking = False
capabilities.input_cost_per_1k = 0.0 # Free local model
capabilities.output_cost_per_1k = 0.0 # Free local model
else:
capabilities.context_window = 1000000 # 1M tokens for Gemini models
capabilities.supports_extended_thinking = False
capabilities.input_cost_per_1k = 0.075
capabilities.output_cost_per_1k = 0.3
provider.get_model_capabilities.return_value = capabilities
return provider
# Otherwise use the original logic
@@ -131,7 +163,7 @@ def mock_provider_availability(request, monkeypatch):
# Also mock is_effective_auto_mode for all BaseTool instances to return False
# unless we're specifically testing auto mode behavior
from tools.base import BaseTool
from tools.shared.base_tool import BaseTool
def mock_is_effective_auto_mode(self):
# If this is an auto mode test file or specific auto mode test, use the real logic