-
Notifications
You must be signed in to change notification settings - Fork 7
Use importlib.resources to resolve tool name to a file location #37
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
Use importlib.resources to resolve tool name to a file location #37
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 tool resolution to use Python's importlib.resources module instead of filesystem-based path lookups. The main changes convert tool references from path-based keys like GitHubSecurityLab/seclab-taskflow-agent/personalities/assistant to module-style names like personalities.assistant, allowing the project to leverage Python's import system for resource management.
- Replaced custom YAML parsing logic with
importlib.resourcesfor resolving tools - Removed the
filekeyfield from all YAML files - Updated all tool references to use dot notation (e.g.,
personalities.assistantinstead of path-based keys)
Reviewed Changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| yaml_parser.py | Deleted entire file as it's replaced by importlib.resources |
| available_tools.py | Implemented new tool resolution using importlib.resources with lazy loading |
| main.py | Updated to use new AvailableTools API and removed YamlParser initialization |
| mcp_utils.py | Updated mcp_client_params to use AvailableTools methods |
| toolboxes/*.yaml | Removed filekey field from all toolbox configurations |
| taskflows/**/*.yaml | Removed filekey and updated tool references to dot notation |
| personalities/**/*.yaml | Removed filekey field from all personality configurations |
| prompts/examples/*.yaml | Removed filekey field |
| configs/model_config.yaml | Removed filekey field |
| taskflows/GRAMMAR.md | Updated documentation with new tool reference format |
| README.md | Updated documentation removing filekey references and updating examples |
| .github/workflows/smoketest.yaml | Updated test commands to use new dot notation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
smoke test |
|
a2ad7e4 to
7a84ab9
Compare
|
@kevinbackhouse Can you delete the |
7a84ab9 to
f890429
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
smoke test |
Deployment Triggered 🚀m-y-mo, started a branch deployment to production (branch: You can watch the progress here 🔗 Details{
"type": "branch",
"environment": {
"name": "production",
"url": null
},
"deployment": {
"timestamp": "2025-10-27T13:56:39.092Z",
"logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18843485658"
},
"git": {
"branch": "09e05de6b4e9761227419acf05ecff48c648bd76",
"commit": "09e05de6b4e9761227419acf05ecff48c648bd76",
"verified": true,
"committer": "kevinbackhouse",
"html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/09e05de6b4e9761227419acf05ecff48c648bd76"
},
"context": {
"actor": "m-y-mo",
"noop": false,
"fork": true,
"comment": {
"created_at": "2025-10-27T13:56:13Z",
"updated_at": "2025-10-27T13:56:13Z",
"body": "smoke test",
"html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/37#issuecomment-3451421238"
}
},
"parameters": {
"raw": null,
"parsed": null
}
} |
Deployment Results ✅m-y-mo successfully deployed branch Details{
"status": "success",
"environment": {
"name": "production",
"url": null
},
"deployment": {
"id": 3211438443,
"timestamp": "2025-10-27T14:03:46.392Z",
"logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18843485658",
"duration": 427
},
"git": {
"branch": "09e05de6b4e9761227419acf05ecff48c648bd76",
"commit": "09e05de6b4e9761227419acf05ecff48c648bd76",
"verified": true
},
"context": {
"actor": "m-y-mo",
"noop": false,
"fork": true
},
"reviews": {
"count": 1,
"decision": "APPROVED"
},
"parameters": {
"raw": null,
"parsed": null
}
} |
importlib.resourcesuses Python's import system to find a "resource" file. For example it converts a name like "personalities.examples" into the path "/home/kev/work/seclab-taskflow-agent/personalities/examples". I think it makes sense to use this for loading yaml files, because it will let us leverage Python's package system for bundling and sharing taskflows.The main implementation change is in
available_tools.pyand I deletedyaml_parser.pybecause it is no longer needed.