Skip to content

fix(tools): filter undefined values from permission metadata - #46273

Closed
optamus-ai wants to merge 1 commit into
anomalyco:devfrom
optamus-ai:fix/permission-metadata-undefined
Closed

optamus-ai wants to merge 1 commit into
anomalyco:devfrom
optamus-ai:fix/permission-metadata-undefined

Conversation

@optamus-ai

Copy link
Copy Markdown

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

  1. Configure permissions to ask by default
  2. Emit a tool call without the optional field
  3. While the permission is pending, request

The endpoint fails with:

Fix

Filter out entries from metadata before sending permission requests using + .

Testing

  • Verified that metadata only contains defined values
  • Existing glob/grep tests pass

Fixes #37650

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
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found a related PR:

PR #40852: fix(core): omit absent optional fields from glob and grep permission metadata
#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.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 30, 2026
@github-actions github-actions Bot closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools: optional search metadata breaks pending permission listing

2 participants