fix(core): omit absent optional fields from glob and grep permission metadata - #40852
fix(core): omit absent optional fields from glob and grep permission metadata#40852vextalor-dev wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate PRs Found:
Recommendation: PRs #37965 and #37679 appear to be very closely related or potentially duplicate efforts addressing the same issue (#37650). You should review #37965 in particular, as it has the nearly identical title and scope to PR #40852. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes #37650
Type of change
What does this PR do?
Pending
globandgreppermission requests could carry explicitundefinedvalues in their metadata when the model omitted optional inputs (path,include,limit). JSON encoding of that metadata fails ("Expected JSON value, got undefined"), which madesession.permission.listreject its response body and hide pending permission prompts.The metadata is now built with only the keys that have a defined value.
rootstays constant (.or the provided path), and absent optional fields are omitted entirely. Verified with a new regression test that executes both tools with and without the optional fields, and asserts the recorded permission metadata contains noundefinedvalues and survives a JSON round-trip.How did you verify your code works?
bun test test/tool-glob-grep.test.tsinpackages/core: 2 pass (test fails when the fix is reverted)bun test test/permission.test.ts test/ripgrep.test.ts: 15 passbun typecheckinpackages/core: cleanoxlinton the touched files: 0 warnings, 0 errorsScreenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist