fix(tools): filter undefined values from permission metadata - #46273
optamus-ai wants to merge 1 commit into
Conversation
The glob and grep tools store optional fields (path, include) in permission metadata even when they are undefined. This causes schema encoding failures in session.permission.list because the ACP SDK cannot serialize undefined values. Filter out undefined entries from metadata before sending permission requests using Object.fromEntries + filter. Fixes anomalyco#37650
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Found a related PR: PR #40852: This PR appears to be addressing the same issue—filtering out undefined/absent optional fields from permission metadata in the glob and grep tools. The current PR (46273) seems to be a continuation or extension of this fix to handle undefined values more broadly across tools. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Summary
The and tools store optional fields (, ) in permission metadata even when they are . This causes schema encoding failures in because the ACP SDK cannot serialize values.
Reproduction
The endpoint fails with:
Fix
Filter out entries from metadata before sending permission requests using + .
Testing
Fixes #37650