Commit Graph

445 Commits

Author SHA1 Message Date
Ming
4a95197846 Fix remaining validate_model_name parameter order inconsistency
Address code review feedback from Gemini Code Assist bot:
- Fix parameter order in validate_model_name method (line 256)
- Ensure consistent use of original model name for restriction validation
- All is_allowed() calls now properly use (provider, original_name, resolved_name)

This completes the fix for GOOGLE_ALLOWED_MODELS shorthand restriction validation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 21:16:01 +08:00
Ming
3ba22d8336 Fix GOOGLE_ALLOWED_MODELS shorthand restriction validation
- Fixed parameter order in is_allowed() calls to check original model name first
- Fixed validate_parameters() to use original model name instead of resolved name
- Fixed thinking capabilities check to use original model name
- Enables GOOGLE_ALLOWED_MODELS=pro,flash to work correctly with shorthand names

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 21:02:24 +08:00
Fahad
d6d7bf8cac Fixed internal file path translation into docker 2025-06-16 11:30:02 +04:00
Fahad
d498e9854b Updated readme with an amazing new discovery 2025-06-16 10:35:39 +04:00
Fahad
8307e32541 Updated readme with an amazing new discovery
Lint
2025-06-16 10:28:39 +04:00
Fahad
8bbadc6505 Updated readme with an amazing new discovery 2025-06-16 10:25:17 +04:00
Fahad
8e2b53b90d Updated readme with an amazing new discovery
Improved prompt
2025-06-16 09:55:40 +04:00
Beehive Innovations
eebe67170d Merge pull request #51 from BeehiveInnovations/improve/file-loading
Fix file prioritization and improve test quality
2025-06-16 07:19:07 +04:00
Fahad
0b94dd8cdd Lint 2025-06-16 07:18:45 +04:00
Fahad
4c0bd3b86d Improved documentation for conversation / file collection strategy, context budget allocation etc 2025-06-16 07:17:35 +04:00
Fahad
5a49d196c8 More integration tests 2025-06-16 07:07:38 +04:00
Fahad
35f37fb92e Fixed integration test for auto mode 2025-06-16 07:00:27 +04:00
Fahad
c643970ffb Fixed integration test for auto mode 2025-06-16 06:57:06 +04:00
Fahad
903aabd311 Fixed imports and lint 2025-06-16 06:24:33 +04:00
Fahad
b43b30b49d Fixed regex 2025-06-16 06:22:10 +04:00
Fahad
e183e1bfff Refactor log monitor to eliminate code duplication
Addressed Gemini code review feedback by refactoring repetitive log processing:

 **Added _process_log_stream helper function**:
- Encapsulates common pattern of reading, filtering, formatting, and printing log lines
- Takes tailer, filter_func, and format_func as parameters
- Eliminates repetitive timestamp and formatting logic

 **Simplified main monitoring loop**:
- Reduced from ~35 lines of repetitive code to 4 clean function calls
- Each log stream now uses: _process_log_stream(tailer, filter, formatter)
- Eliminated duplicate timestamp creation (reduced from 4 to 1 occurrence)

 **Improved maintainability**:
- Changes to log processing logic now only need to be made in one place
- Cleaner, more readable main loop
- Better separation of concerns

 **Verified functionality**:
- All containers rebuild and start successfully
- Log monitor functions correctly with refactored code
- No functional changes, only code organization improvements

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 06:19:53 +04:00
Fahad
be157ab771 Remove unused create_line_handler function
Fixed code quality issues identified by Gemini code review:
- Removed dead code: create_line_handler function was defined but never used
- Eliminated unused parameter warning
- Cleaned up unnecessary complexity in log_monitor.py
- The monitor_mcp_activity function implements all needed logic inline

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 06:16:21 +04:00
Fahad
c9798325c7 Extra logging 2025-06-16 06:09:58 +04:00
Fahad
805e8d6d01 Fix remaining TestGenRequest reference in format_response method
Fixed NameError that was causing Docker container crashes:
- Updated type annotation in format_response method from TestGenRequest to TestGenerationRequest
- This was the last missing reference from the class rename

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 06:08:58 +04:00
Fahad
2cfe0b163a Fix all failing tests and pytest collection warnings
Fixed MagicMock comparison errors across multiple test suites by:
- Adding proper ModelCapabilities mocks with real values instead of MagicMock objects
- Updating test_auto_mode.py with correct provider mocking for model availability tests
- Updating test_thinking_modes.py with proper capabilities mocking in all thinking mode tests
- Updating test_tools.py with proper capabilities mocking for CodeReview and Analyze tools
- Fixing test_large_prompt_handling.py by adding proper provider mocking to prevent errors before large prompt detection

Fixed pytest collection warnings by:
- Renaming TestGenRequest to TestGenerationRequest to avoid pytest collecting it as a test class
- Renaming TestGenTool to TestGenerationTool to avoid pytest collecting it as a test class
- Updated all imports and references across server.py, tools/__init__.py, and test files

All 459 tests now pass without warnings or MagicMock comparison errors.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 06:02:12 +04:00
Fahad
8c3efd5676 Bump 2025-06-16 05:52:17 +04:00
Fahad
91077e3810 Performance improvements when embedding files:
- Exit early at MCP boundary if files won't fit within given context of chosen model
- Encourage claude to re-run with better context
- Check file sizes before embedding
- Drop files from older conversations when building continuations and give priority to newer files
- List and mention excluded files to Claude on return
- Improved tests
- Improved precommit prompt
- Added a new Low severity to precommit
- Improved documentation of file embedding strategy
- Refactor
2025-06-16 05:51:52 +04:00
Fahad
56333cbd86 Fixed numbering 2025-06-15 19:23:45 +04:00
Fahad
1d070e43fd Improved 2025-06-15 19:23:08 +04:00
Fahad
d8f4eb99f5 Improved 2025-06-15 19:21:57 +04:00
Fahad
978b6ef155 Improved 2025-06-15 19:20:15 +04:00
Fahad
0bb54d721a Moved API editing instructions above run-server 2025-06-15 19:16:01 +04:00
Fahad
7ef99fb9ce Improved schema description for precommit 2025-06-15 19:11:37 +04:00
Fahad
6dcf095c3d Improved schema description to allow Claude to pre-think harder before invoking thinkdeep 2025-06-15 19:05:23 +04:00
Fahad
ad6cff4498 Lint, bump 2025-06-15 18:43:37 +04:00
Fahad
dfed6f0cbd New tool: "tracer" helps with static analysis / call-flow generation. Does NOT use external models. Used as a quick prompt generator to aid in call-flow / dependency-chart generation. Can be used as an input into another tool / model for extended analysis and deeper thought.
Faster docker restarts
2025-06-15 18:42:10 +04:00
Fahad
6f8d3059a1 Merge branch 'main' into feature/tracer
# Conflicts:
#	tools/base.py
#	tools/debug.py
#	tools/thinkdeep.py
2025-06-15 16:09:54 +04:00
Fahad
f3720ad8e9 Use mock-reddis 2025-06-15 16:09:07 +04:00
Fahad
07a078b4f2 Updated tests and additional tests for folder expansion during conversation tracking 2025-06-15 16:03:43 +04:00
Fahad
d36a85a3f3 Fix directory expansion tracking in conversation memory
When directories were provided to tools, only the directory path was stored
in conversation history instead of the individual expanded files. This caused
file filtering to incorrectly skip files in continued conversations.

Changes:
- Modified _prepare_file_content_for_prompt to return (content, processed_files)
- Updated all tools to track actually processed files for conversation memory
- Ensures directories are tracked as their expanded individual files

Fixes issue where Swift directory with 46 files was not properly embedded
in conversation continuations.
2025-06-15 15:36:45 +04:00
Fahad
99ed09be8d Update tracer tool for new file tracking system 2025-06-15 15:36:33 +04:00
Fahad
64a1d8664e Fix directory expansion tracking in conversation memory
When directories were provided to tools, only the directory path was stored
in conversation history instead of the individual expanded files. This caused
file filtering to incorrectly skip files in continued conversations.

Changes:
- Modified _prepare_file_content_for_prompt to return (content, processed_files)
- Updated all tools to track actually processed files for conversation memory
- Ensures directories are tracked as their expanded individual files

Fixes issue where Swift directory with 46 files was not properly embedded
in conversation continuations.
2025-06-15 15:36:12 +04:00
Fahad
86728a1442 WIP 2025-06-15 15:32:41 +04:00
Fahad
9b8ea72280 Fixed for git actions 2025-06-15 14:14:15 +04:00
Fahad
3bc7956239 Implement TracePath tool for static call path analysis
Add comprehensive TracePath tool that predicts and explains full call paths
and control flow without executing code. Features include:

**Core Functionality:**
- Static call path prediction with confidence levels (🟢🟡🔴)
- Multi-language support (Python, JavaScript, TypeScript, C#, Java)
- Value-driven flow analysis based on parameter combinations
- Side effects identification (database, network, filesystem)
- Polymorphism and dynamic dispatch analysis
- Entry point parsing for multiple syntax patterns

**Technical Implementation:**
- Hybrid AI-first architecture (Phase 1: pure AI, Phase 2: AST enhancement)
- Export formats: Markdown, JSON, PlantUML
- Confidence threshold filtering for speculative branches
- Integration with existing tool ecosystem and conversation threading
- Comprehensive error handling and token management

**Files Added:**
- tools/tracepath.py - Main tool implementation
- systemprompts/tracepath_prompt.py - System prompt for analysis
- tests/test_tracepath.py - Comprehensive unit tests (32 tests)

**Files Modified:**
- server.py - Tool registration
- tools/__init__.py - Tool exports
- systemprompts/__init__.py - Prompt exports

**Quality Assurance:**
- All 449 unit tests pass including 32 new TracePath tests
- Full linting and formatting compliance
- Follows established project patterns and conventions
- Multi-model validation with O3 and Gemini Pro insights

**Usage Examples:**
- "Use zen tracepath to analyze BookingManager::finalizeInvoice(invoiceId: 123)"
- "Trace payment.process_payment() with confidence levels and side effects"

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 14:07:23 +04:00
Fahad
6304b7af6b Native support for xAI Grok3
Model shorthand mapping related fixes
Comprehensive auto-mode related tests
2025-06-15 12:21:44 +04:00
Fahad
4becd70a82 Perform prompt size checks only at the MCP boundary
New test to confirm history build-up and system prompt does not affect prompt size checks
Also check for large prompts in focus_on
Fixed .env.example incorrectly did not comment out CUSTOM_API causing the run-server script to think at least one key exists
2025-06-15 10:37:08 +04:00
Fahad
3b03783ea7 Instructions on how to add a new tool 2025-06-15 09:42:28 +04:00
Fahad
44db8c9e63 Updated to reflect actual prompt 2025-06-15 09:37:56 +04:00
Fahad
3c56694d3f Formatting 2025-06-15 09:34:37 +04:00
Fahad
f4395a796c Typo 2025-06-15 09:33:48 +04:00
Fahad
81ab4da60c Typo 2025-06-15 09:33:18 +04:00
Fahad
77faea24e1 Typo 2025-06-15 09:30:55 +04:00
Fahad
8364170881 Merge remote-tracking branch 'origin/main' 2025-06-15 09:25:58 +04:00
Fahad
c7835e7eef Easier access to logs at startup with -f on the run script
Improved prompt for immediate action
Additional logging of tool names
Updated documentation
Context aware decomposition system prompt
New script to run code quality checks
2025-06-15 09:25:52 +04:00