chore: add specific return type hints to file_system_toolkits functions#3
chore: add specific return type hints to file_system_toolkits functions#3himanshu748 wants to merge 185 commits intomainfrom
Conversation
Update AnthropicProvider.complete to accept response_format and forward it to LiteLLMProvider. Added unit test in test_litellm_provider.py to verify parameter forwarding.
- Remove redundant register_web_search(mcp) call on line 54 - Keep single registration with credentials parameter - Tool implementation handles both credential sources internally - Added clarifying comment explaining the credential handling Fixes aden-hive#172
- Update .claude/skills/ structure in getting-started.md - Reflect actual skills generated by quickstart.sh: - agent-workflow/ - building-agents-construction/ - building-agents-core/ - building-agents-patterns/ - testing-agent/ Fixes aden-hive#177
Fixes aden-hive#202 - Update docs/getting-started.md to explain exports/ is created by users - Remove references to non-existent support_ticket_agent example - Update DEVELOPER.md with correct agent creation instructions
…file Add support for custom file encoding and size limits when viewing files. The max_size parameter prevents loading excessively large files by truncating content and adding a warning message when the limit is exceeded. Also includes validation for negative max_size values and checks if path is a file.
- Replace hardcoded /home/timothy/oss/hive/ with generic instruction - Add troubleshooting section for PEP 668 externally-managed-environment error - Document virtual environment setup for Python 3.12+ on macOS/WSL/Linux Fixes aden-hive#322 Fixes aden-hive#355
- Remove hardcoded max_retries_per_node = 3 - Use node_spec.max_retries for all retry logic - Add comprehensive test suite (6 test cases) - Allows per-node retry configuration as intended Fixes aden-hive#363
…detection Previously, the hallucination detection in SharedMemory.write() and OutputValidator.validate_no_hallucination() only checked the first 500 characters for code indicators. This allowed hallucinated code to bypass detection by prefixing with innocuous text. Changes: - Add _contains_code_indicators() method to SharedMemory and OutputValidator - Check entire string for strings under 10KB - Use strategic sampling (start, 25%, 50%, 75%, end) for longer strings - Expand code indicators to include JavaScript, SQL, and HTML/script patterns - Add comprehensive test suite with 19 test cases Fixes aden-hive#443 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…s-1769383167894 Add claude GitHub actions 1769383167894
Translate Korean
…directory-structure docs: update skills directory structure to match actual output
…r-response-format fix: align AnthropicProvider.complete with LLMProvider (response_format)
…-to-excluded feat: allow micro fixes be passed as a PR
…aden-hive#951) * config: add .gitattributes for cross-platform line ending consistency - Add comprehensive .gitattributes to normalize line endings - Ensure shell scripts always use LF (required for Unix execution) - Mark binary files explicitly to prevent corruption - Eliminate CRLF warnings for Windows contributors - Follow cross-platform best practices This fixes persistent 'LF will be replaced by CRLF' warnings that confuse Windows contributors during normal git operations. Fixes aden-hive#950 * fix: add trailing newline at end of file Per review feedback from @Hundao
micro-fix: fix ruff and excluding Docs
chore: fix lint issues
docs: chore for calling claude skills
…ation-error-handling Fix/json validation error handling
…r-check fix(list_dir): add isdir check before listing
…pose-references docs: remove outdated Docker Compose references
fixed ruff format --check
Fixes aden-hive#1583 Updated the following functions to use dict[str, Any] instead of dict: - list_dir() in list_dir.py - view_file() in view_file.py - write_to_file() in write_to_file.py - grep_search() in grep_search.py This improves type safety and IDE autocomplete support. Co-Authored-By: Himanshu Jha <jhahimanshu653@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Hi! I'm Himanshu Jha (@himanshu748). I'd like to work on this issue. Could you please assign it to me? This PR adds specific return type hints (dict[str, Any]) to file_system_toolkits functions, fixing issue aden-hive#1583. |
|
Important Review skippedToo many files! This PR contains 186 files, which is 36 over the limit of 150. You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds specific dict[str, Any] return type hints to file_system_toolkits functions, improving type safety and IDE autocomplete support. However, the PR inadvertently includes 184 upstream sync commits that should not be part of this change.
Changes:
- Added
from typing import Anyimports to four file_system_toolkits files - Changed return type annotations from
dicttodict[str, Any]in four functions
Reviewed changes
Copilot reviewed 123 out of 186 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/architecture.md | UPSTREAM SYNC - File deletion, not part of intended changes |
| core/verify_mcp.py | UPSTREAM SYNC - Logging refactor, not part of intended changes |
| core/tests/*.py | UPSTREAM SYNC - Test formatting changes, not part of intended changes |
| All other files | UPSTREAM SYNC - Various upstream changes, not part of intended changes |
origin/main branch to include only the 4 intended file_system_toolkits changes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes based on Copilot AI review (5 issues): 1. Simplified _cleanup_stdio_async(): - Used try/finally pattern for cleaner reference clearing - References cleared in finally block (always executed) 2. Removed deprecated asyncio.get_event_loop(): - Removed complex temp loop pattern entirely - Simplified fallback to just log warning and clear refs 3. Simplified fallback path (Issue #4): - When loop exists but not running, resources are in undefined state - Complex event loop manipulation removed - Just log warning and proceed with reference clearing - OS will reclaim resources on process exit 4. Handled race condition (Issue #5): - Added comment documenting the inherent race condition - Added try/except around loop.call_soon_threadsafe() - Track cleanup_attempted flag for proper fallback handling 5. Added explanatory comments: - Documented why redundant None assignments exist (safety) - Explained race condition handling approach Note: Test coverage suggestion (#3) acknowledged but deferred to separate PR to keep this fix focused.
Changes based on Copilot AI review (3 issues): 1. Increased thread join timeout (Issue #1): - Changed from 2 to 5 seconds - Made proportional to cleanup timeout - Defined as class constant _THREAD_JOIN_TIMEOUT 2. Handle asyncio.CancelledError explicitly (Issue #2): - Added separate except clause for CancelledError - Logs specific warning for cancelled cleanup - Re-raises CancelledError as per asyncio best practices - Added for both session and stdio_context cleanup 3. Increased cleanup timeout to match connection timeout (Issue #3): - Changed from 5 to 10 seconds (matches _connect_stdio timeout) - Defined as class constant _CLEANUP_TIMEOUT - Prevents incomplete cleanup with slow MCP servers
Description
Adds specific
dict[str, Any]return type hints to file_system_toolkits functions instead of genericdict. This improves type safety and IDE autocomplete support.Recommendation: This PR should be closed and recreated with a branch based on
origin/mainto isolate only the intended changes.Type of Change
Related Issues
Fixes aden-hive#1583
Changes Made (Intended)
The following 4 files were modified to use
dict[str, Any]instead ofdict:tools/src/aden_tools/tools/file_system_toolkits/list_dir/list_dir.py- Addedfrom typing import Anyimport and changedlist_dir()return typetools/src/aden_tools/tools/file_system_toolkits/view_file/view_file.py- Addedfrom typing import Anyimport and changedview_file()return typetools/src/aden_tools/tools/file_system_toolkits/write_to_file/write_to_file.py- Addedfrom typing import Anyimport and changedwrite_to_file()return typetools/src/aden_tools/tools/file_system_toolkits/grep_search/grep_search.py- Addedfrom typing import Anyimport and changedgrep_search()return typeTesting
cd core && pytest tests/)cd core && ruff check .)Checklist
Human Review Checklist
from typing import Anyimports are correctly placed at top of each filedicttodict[str, Any]Link to Devin run: https://app.devin.ai/sessions/626b4e606d97495f9640088656d06c35
Requested by: Himanshu Jha (@himanshu748)