Conversation
…clTag 导致 AI 编造默认值 (issue_mojw1xd2_gaiuiu)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edbc24540d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!resourceType) { | ||
| throw new Error("action=getResourcePermission 时必须提供 resourceType"); | ||
| } |
There was a problem hiding this comment.
Restore non-storage resourceId validation
This change removed the resourceId presence check for getResourcePermission in all non-storage cases, so calls like resourceType="function" without resourceId now proceed to describeResourcePermission with resources: [undefined] instead of returning the previous clear validation error. That is a regression introduced by this commit and can surface as opaque downstream API failures for callers that omit resourceId on non-storage types.
Useful? React with 👍 / 👎.
Attribution issue
Automation summary
queryPermissionstool withaction="listResourcePermissions"andresourceType="storage"returnsresources.emptywhenresourceIdsis not provided. The underlying APIdescribeResourcePermissionrequires explicit resource identifiers for storage type, but the agent doesn't know which buckets exist. This forces the AI to fall back to forbidden APIs (DescribeStorageACL) or fabricate default aclTag values like"undefined".mcp/src/tools/permissions.tswith two fixes: (1)listResourcePermissions: whenresourceType="storage"and noresourceIdsprovided, auto-discover storage bucket names fromenv.getEnvInfo()and use them as the resources parameter. (2)getResourcePermission: whenresourceType="storage"and noresourceIdprovided, auto-discover the default bucket name. Also updated tool description and parameter descriptions to inform the AI thatresourceId/resourceIdsare optional for storage type and will be auto-discovered.Changed files
mcp/src/tools/permissions.ts