mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-26 11:49:36 +00:00
- 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.
2.0 KiB
2.0 KiB
Python SDK Reorganization Plan
Identified Issues
1. Duplicate Packages
- hanzo_network: Exists in both
./hanzo-network/and./hanzo-mcp/hanzo_network/ - hanzo-cli: Exists in both
./hanzo-cli/and./hanzo-mcp/pkg/hanzo-cli/
2. Unclear Package Structure
hanzo-cli-wrappervshanzo-cli- purpose overlap- Multiple nested
pkg/directories
Recommended Actions
Phase 1: Remove Duplicates
- Remove
./hanzo-mcp/hanzo_network/- use the package version in./hanzo-network/ - Remove
./hanzo-mcp/pkg/hanzo-cli/- use the main./hanzo-cli/package - Update all imports in hanzo-mcp to use the package versions
Phase 2: Clarify Package Structure
- Merge
hanzo-cli-wrapperfunctionality intohanzo-cliif they serve the same purpose - Move all packages to a consistent location (root level, not nested in hanzo-mcp)
Phase 3: Update Dependencies
- Update
hanzo-mcp/pyproject.tomlto reference the correct package locations - Ensure all cross-package dependencies use consistent paths
Commands to Execute
# Phase 1: Remove duplicates
rm -rf ./hanzo-mcp/hanzo_network/
rm -rf ./hanzo-mcp/pkg/
# Phase 2: Update imports (need to search and replace)
# In hanzo-mcp files, replace:
# from hanzo_network import ... → from hanzo_network import ...
# (No change needed as import path remains the same)
# Phase 3: Update dependencies in pyproject.toml files
# Ensure hanzo-mcp depends on hanzo-network package properly
For Go Consensus Project
The error shows an incorrect import in chains/atomic/shared_memory.go:7:2:
github.com/luxfi/crypto/database # This package doesn't exist
To fix:
-
Check what the correct database import should be (likely one of):
github.com/luxfi/consensus/databasegithub.com/luxfi/luxd/database- Or check other files in the project for the correct import
-
Update the import in
chains/atomic/shared_memory.go -
Run:
go mod tidy make test