Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The linked issue is #37650, referenced with |
|
Bumping this. The |
|
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. |
|
Requesting a reopen. The bug is still live on This PR was never reviewed, so the reaction count says nothing about whether the fix is needed. One question: keep this fix, or port the approach from #37965 to |
Issue for this PR
Closes #37650
Type of change
What does this PR do?
Pending
globandgreppermissions store absent optional inputs asundefinedinside permission metadata (for examplemetadata: { path: input.path, limit: input.limit }). The metadata record isSchema.Record(Schema.String, Schema.Unknown)and the wire codec serializesUnknownas a JSON value, sosession.permission.listfails to encode its response withExpected JSON value, got undefined.This strips
undefinedvalues inrequest()inpackages/core/src/permission.ts, the one place every pending request is constructed for bothassertandask. That fixes both tools at once and protects the event publish path as well as the list and get endpoints. I audited everypermission.assertandpermission.askcall site: these two tools are the only ones producingundefinedvalues and all metadata is flat, so a shallow strip is sufficient. A deep JSON round trip was rejected because it would silently normalize values that should fail loudly.How did you verify your code works?
Added one regression test: ask for a permission whose metadata contains
undefinedvalues, then assert the pending request omits those keys. It fails without the fix and passes with it. I also reproduced the reported error (Expected JSON value, got undefined at ["path"]) against the JSON value codec using the old metadata shape and confirmed the stripped shape encodes cleanly. The permission and tool test suites inpackages/core(111 tests) andtsgo --noEmitall pass.Screenshots / recordings
Not a UI change.
Checklist