Repository navigation
Conversation
|
Julio Carlos Menendez (@juliomenendez) Atif Aziz (@atifaziz) Dan Dascalescu (@dandv) Matt Kotsenas (@MattKotsenas) , can you approve this pull request and do a release ASAP? we are blocked from using download_file method from semantic kernel. |
|
Mark Wallace, can you help me with this? |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add a regression test covering kernel discovery of download_file.
Review effort: Lite
Findings: 1
What changed in this PR
Adds kernel-function metadata to make download_file discoverable and resolve lookup failures.
Changes:
- Registers
download_filewith@kernel_function. - Provides its public name and description.
| File | Description |
|---|---|
python/semantic_kernel/core_plugins/sessions_python_tool/sessions_python_plugin.py |
Exposes download_file to kernel plugin discovery. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| f"List files failed with status code {e.response.status_code} and error: {error_message}" | ||
| ) from e | ||
|
|
||
| @kernel_function(name="download_file", description="Downloads a file from the current Session ID") |
Eduard van Valkenburg (eavanvalkenburg)
left a comment
There was a problem hiding this comment.
Review finding (blocking): Do not expose unrestricted local file writes as a kernel function
Adding @kernel_function makes download_file model-callable, including its local_file_path argument. _validate_local_path_for_download currently allows every destination when allowed_download_directories is None, which is the default, so an auto-invoked tool call can overwrite any local file writable by the process. Please make local downloads deny-by-default when a path is supplied, or expose only a safe buffer-returning function.

Motivation and Context
Description
Contribution Checklist