fix(#5154): add tool permission support for playground - #5181
fix(#5154): add tool permission support for playground#5181pranjali2076 wants to merge 1 commit into
Conversation
- Preserve permission field in stripAgentaMetadataDeep - Add permission prop to ToolObj type and TOOL_SCHEMA - Add PermissionSelector UI component to ToolItemControl - Ensure permission is serialized in tool metadata
|
@pranjali2076 is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @pranjali2076, thanks for opening a pull request. 🙏 This PR was automatically closed because it does not yet meet our contribution requirements:
We ask for this so every change is documented and demonstrably tested before review. How to get it reopened See the Contributing guide and Creating your first PR. If you think this was closed in error, leave a comment and a maintainer will take a look. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds an optional ChangesTool Permission Support and Control Refactor
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ToolItemControl
participant PermissionSelector
participant SharedEditor
participant valueExtraction
User->>PermissionSelector: change permission (always/ask)
PermissionSelector->>ToolItemControl: onPermissionChange(permission)
ToolItemControl->>ToolItemControl: merge permission into toolObj
ToolItemControl->>SharedEditor: update editorText
User->>SharedEditor: edit JSON tool definition
SharedEditor->>ToolItemControl: onEditorChange(newText)
ToolItemControl->>valueExtraction: stripAgentaMetadataDeep(toolObj)
valueExtraction-->>ToolItemControl: cleaned object with permission preserved
ToolItemControl->>ToolItemControl: handleChange(mergedToolObj)
Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi team! 👋 This PR fixes #5154 — tool permissions set to "Ask" in the playground weren't gating runs because the Changes made:
Current status: The PR is passing all checks except Vercel deployment (awaiting authorization) and needs a maintainer review. Could someone please approve the Vercel deployment and review when convenient? Thanks! |
|
Thanks for the contribution. Please see comment in the issue why we cannot accept this |
Summary
What changed?
permissionfield support to tool metadata schemaPermissionSelectorUI component for setting tool permission (Always/Ask)stripAgentaMetadataDeepto preservepermissionfield when sending to APIWhy was this change needed?
permissionfield was being stripped bystripAgentaMetadataDeepbefore reaching the backendWhat problem does it solve?
Testing
Verified locally
pnpm installcompleted successfullyAdded or updated tests
N/A — No tests added yet. The fix is straightforward schema/UI changes.
QA follow-up
Demo
Screenshot of the PermissionSelector component added to ToolItemControl.tsx:
Checklist