-
Notifications
You must be signed in to change notification settings - Fork 363
feat: Use Sandbox Runtime for Bash tool and refactor artifact utils tools #1071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the skills system architecture to separate file operations and bash execution into dedicated tools, enabling more granular control and better separation of concerns. The changes also introduce centralized session path management and an artifacts toolset for managing file uploads and downloads.
- Introduced dedicated file operation tools (ReadFileTool, WriteFileTool, EditFileTool) separate from bash execution
- Moved BashTool from skills to a shared tools module and updated it to use Anthropic Sandbox Runtime
- Centralized session path management with caching via new session_path module
- Created ArtifactsToolset to manage file upload/download lifecycle independently from skills
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/kagent-adk/src/kagent/adk/tools/file_tools.py | New file operation tools for reading, writing, and editing files with line numbers and precise string replacement |
| python/packages/kagent-adk/src/kagent/adk/tools/bash_tool.py | Relocated and refactored bash tool to use Anthropic Sandbox Runtime with improved sandboxing |
| python/packages/kagent-adk/src/kagent/adk/tools/init.py | New tools module exporting file and bash tools |
| python/packages/kagent-adk/src/kagent/adk/skills/skills_toolset.py | Updated to include new file operation tools alongside bash and skills tools |
| python/packages/kagent-adk/src/kagent/adk/skills/skills_plugin.py | Enhanced to initialize session paths and register all tools via plugin hooks |
| python/packages/kagent-adk/src/kagent/adk/skills/skill_tool.py | Minor documentation update for script location guidance |
| python/packages/kagent-adk/src/kagent/adk/skills/skill_system_prompt.py | Removed legacy system prompt generation (functionality replaced) |
| python/packages/kagent-adk/src/kagent/adk/skills/bash_tool.py | Removed old bash tool implementation (replaced by tools/bash_tool.py) |
| python/packages/kagent-adk/src/kagent/adk/skills/init.py | Updated exports to reflect module reorganization |
| python/packages/kagent-adk/src/kagent/adk/skills/README.md | Comprehensive documentation updates explaining new architecture and workflow |
| python/packages/kagent-adk/src/kagent/adk/artifacts/stage_artifacts_tool.py | Refactored to use centralized session path management and improved file handling |
| python/packages/kagent-adk/src/kagent/adk/artifacts/session_path.py | New centralized session path initialization and caching system |
| python/packages/kagent-adk/src/kagent/adk/artifacts/return_artifacts_tool.py | New tool for uploading generated files back to artifact service |
| python/packages/kagent-adk/src/kagent/adk/artifacts/artifacts_toolset.py | New toolset bundling stage and return artifact tools |
| python/packages/kagent-adk/src/kagent/adk/artifacts/init.py | Updated exports to include new artifact tools and session path functions |
| python/packages/kagent-adk/src/kagent/adk/_a2a.py | Added import for InMemoryArtifactService |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
python/packages/kagent-adk/src/kagent/adk/artifacts/return_artifacts_tool.py
Outdated
Show resolved
Hide resolved
44bd49c to
974b60d
Compare
Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
313fa27 to
928c3d2
Compare
| add_skills_tool_to_agent(skills_directory, root_agent) | ||
| plugins = [SkillsPlugin(skills_directory=skills_directory)] | ||
|
|
||
| kagent_app = KAgentApp(root_agent, agent_card, app_cfg.url, app_cfg.app_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to use plugin instead of directly adding tools because it handles creating temporary session paths as well
This PR expands features from #1062 and integrates with #1077.
skills/is symlinked to the/skillsloaded into the container or any other customised skills base path. This directory is where all commands are run, python imports from skills are handled by modifying thePYTHONPATHenv variableRunnerloop (run locally) due to frontend limitationsTesting
Features in this PR will work to the full capacity of the examples listed in #1062, this includes everything from accessing skills to writing code, managing dependencies, and creating files / images, subject to the limitations below.
Limitations
.srt-config.jsonproperly, for local testing just addingpypi.orgto allowed network