Files
python-sdk/pkg/TEST_RESULTS.md
T
zeekay 118b43f793 fix: add token limits to prevent MCP tool responses exceeding 25k tokens
- Add truncate_response with 25k token limit to directory_tree tool
- Add token limiting to read, grep, find filesystem tools
- Add token limiting to shell command output tools
- Fix test import errors and syntax issues
- Install hanzo-memory dependency for memory tests
- Reduce pytest collection errors from 45 to 7

All tools now properly gate their responses to prevent exceeding the MCP token limit.
2025-07-27 23:07:20 -05:00

2.4 KiB

Python SDK Test Results

Summary

After reorganizing the directory structure and removing duplicates, here's the current state of the Python SDK packages:

Packages Tested

1. hanzo-mcp ✅

  • Status: Mostly working
  • Issues Fixed:
    • Fixed import error: Changed from hanzo_mcp.tools.filesystem.symbols to from hanzo_mcp.tools.filesystem.symbols_tool
  • Current State: Basic imports work, CLI help works, but some tests need updating

2. hanzo-network ✅

  • Status: No tests found (needs test suite)
  • Installation: Successful
  • Dependencies: Properly configured

3. hanzo-cli ✅

  • Status: Installed successfully
  • CLI: Basic functionality appears to work

4. hanzo-agents ⚠️

  • Status: Needs dependency installation
  • Issue: Missing structlog dependency during test (though it's listed in pyproject.toml)
  • Fix: Run pip install -e ./hanzo-agents to install all dependencies

5. hanzo-memory 🔄

  • Status: Not tested yet

Actions Taken

  1. Removed Duplicates:

    • Deleted ./hanzo-mcp/hanzo_network/ (duplicate of ./hanzo-network/)
    • Deleted ./hanzo-mcp/pkg/ (contained duplicate hanzo-cli)
  2. Fixed Import Issues:

    • Updated import in search_tool.py to use correct module name
  3. Package Structure:

    • All packages now have consistent structure
    • No more duplicate code
    • Clear separation between packages

Recommendations

  1. For Go Consensus Project:

    cd /path/to/consensus
    # Fix the import in chains/atomic/shared_memory.go:7:2
    # The import github.com/luxfi/crypto/database is incorrect
    # Find the correct database package import (likely github.com/luxfi/consensus/database or similar)
    go mod tidy
    make test
    
  2. For Python SDK:

    • Add comprehensive test suites to hanzo-network
    • Ensure all packages are installed with their dependencies before testing
    • Consider creating a top-level Makefile to test all packages

Build Commands

To ensure all packages build and test properly:

# Install all packages in development mode
pip install -e ./hanzo-mcp
pip install -e ./hanzo-network
pip install -e ./hanzo-cli
pip install -e ./hanzo-agents
pip install -e ./hanzo-memory

# Run tests (where available)
cd hanzo-mcp && python -m pytest
cd ../hanzo-agents && python -m pytest
cd ../hanzo-memory && python -m pytest