Conversation
This commit implements a new feature that allows users to provide project-specific context to AWorld agents through AWORLD.md files, similar to Claude Code's CLAUDE.md. Key Features: - Auto-discovery of AWORLD.md files in .aworld/, project root, or ~/.aworld/ - Support for @import syntax to include other markdown files - Circular import detection and graceful error handling - File caching with modification time-based invalidation - Seamless integration with existing Neuron system Implementation: - Added AWORLDFileNeuron class with priority 50 - Updated AgentContextConfig with enable_aworld_file option (default: true) - Integrated with SystemPromptAugmentOp for automatic injection - Added comprehensive unit tests - Created example AWORLD.md and documentation Benefits: - Non-technical users can customize agent behavior via markdown - Project-specific context can be version controlled - Backward compatible with existing code - Improves agent understanding of project conventions Files Changed: - aworld/core/context/amni/prompt/neurons/aworld_file_neuron.py (new) - aworld/core/context/amni/prompt/neurons/__init__.py (updated) - aworld/core/context/amni/config.py (updated) - aworld/core/context/amni/processor/op/system_prompt_augment_op.py (updated) - tests/core/context/amni/prompt/neurons/test_aworld_file_neuron.py (new) - .aworld/AWORLD.md (example) - .aworld/README.md (documentation)
This commit adds CLI support for managing AWORLD.md files and comprehensive integration tests. Key Features: - /memory command to edit AWORLD.md in default editor - /memory view to display current content - /memory status to show system status - /memory reload to inform about reload behavior Implementation: - Added command handlers in console.py - Integrated with existing command completion system - Updated .aworld/README.md with CLI documentation - Created comprehensive integration test suite Testing: - test_aworld_md_integration.py with 6 test cases - All tests passing (basic loading, imports, caching, etc.) - Example AWORLD.md files for testing Files Changed: - aworld-cli/src/aworld_cli/console.py (new /memory commands) - .aworld/README.md (CLI documentation) - examples/cast/.aworld/AWORLD.md (test file) - examples/cast/.aworld/test-import.md (test import) - examples/cast/test_aworld_md_integration.py (integration tests) Test Results: ✅ All 6 integration tests passed ✅ Basic loading works ✅ Import functionality works ✅ Circular import detection works ✅ Caching works correctly ✅ Formatted output works ✅ No file handling works
The /memory command was failing with: NameError: cannot access free variable 'os' where it is not associated with a value in enclosing scope Root Cause: - The get_editor() function is defined inside the /memory command handler - It references 'os' module but 'os' was not imported in the local scope - Although 'os' is imported at file level, nested functions need explicit access to it in their enclosing scope Fix: - Added 'import os' at line 1183 in the /memory command handler - This ensures 'os' is available in the local scope for get_editor() - Also ensures subprocess is available for open_in_editor() Testing: - Syntax check passed - Logic tests passed for get_editor() function - All three priority levels work correctly: 1. VISUAL environment variable 2. EDITOR environment variable 3. 'nano' as fallback Impact: - /memory command now works correctly - /memory view, /memory status, /memory reload all functional - Editor selection logic works as designed
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the memory and context management capabilities for AWorld agents by introducing a new mechanism for providing project-specific context. Agents can now automatically load and utilize information defined in Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Changes: - Changed search order to prioritize user-level config (~/.aworld/AWORLD.md) - Updated priority: User > Project > Root (was: Project > Root > User) - Updated documentation in README.md to reflect new priority - Cleaned up temporary test files Priority Rationale: - User-level config should override project defaults - Allows users to have personal preferences across all projects - Follows standard configuration hierarchy (User > Project > System) Files Modified: - aworld/core/context/amni/prompt/neurons/aworld_file_neuron.py - aworld-cli/src/aworld_cli/console.py - .aworld/README.md Cleanup: - Removed /Users/hgc/hgc_repo/basic/.aworld/AWORLD.md (temp test file) - Removed /Users/hgc/hgc_repo/AWorld/.aworld/README.md.bak (backup file)
There was a problem hiding this comment.
Code Review
This pull request introduces a new AWORLD.md file feature, allowing users to provide project-specific context to AWorld agents. This includes the implementation of an AWORLDFileNeuron responsible for loading, processing (with @import support and circular import detection), and caching content from these markdown files. The feature integrates with the agent's context configuration, enabling it by default and allowing custom file paths. New /memory CLI commands have been added to the aworld-cli for editing, viewing, reloading, and checking the status of AWORLD.md files. Comprehensive unit and integration tests, along with example files, have been added to validate the new functionality. There are no feedback comments to address.
BREAKING CHANGE: Default path changed from project directory to user directory Problem: - Previously, /memory command created AWORLD.md in project directory by default - This was conceptually wrong: default should be user-level, not project-level - Confused "search priority" with "default creation path" Solution: - Changed default creation path to ~/.aworld/AWORLD.md (user directory) - User-level config is now the DEFAULT (most universal, applies to all projects) - Project-level config (.aworld/AWORLD.md) is OPTIONAL OVERRIDE - Updated documentation to clarify default vs optional paths Key Concepts: - DEFAULT = User directory (~/.aworld/AWORLD.md) - applies to all projects - OPTIONAL = Project directory (.aworld/AWORLD.md) - overrides for specific project - Search Priority ≠ Default Creation Path * Search priority: User > Project > Root (find first existing) * Default creation: Always user directory (most universal) Files Modified: - aworld-cli/src/aworld_cli/console.py: Changed default_location to Path.home() - aworld/core/context/amni/prompt/neurons/aworld_file_neuron.py: Updated comments - .aworld/README.md: Clarified default vs optional paths - test_default_path.py: Added test to verify default path Testing: - test_default_path.py passes - Verifies default path is in user directory - Verifies default path is NOT in current directory Rationale: - User directory is the most common and universal location - Applies to all projects by default - Project-specific config is for overrides only - Follows standard configuration hierarchy: User > Project > System
Cleanup: - Removed examples/cast/.aworld/ (temporary test directory) - Removed .aworld/ (temporary project config) - Removed test_default_path.py (temporary test file) These were created during development/testing and should not be in the repository. Proper tests are in tests/ directory and examples/cast/test_aworld_md_integration.py
No description provided.