| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- Add visibility parameter to askCodebaseRequestSchema in MCP - Update blocking chat API to accept and use visibility parameter - Allow agents to override default visibility (PRIVATE/PUBLIC) - Useful for shared environments like Slack where links should be public Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
|
Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch. |
Sorry, something went wrong.
|
No actionable comments were generated in the recent review. 🎉 WalkthroughAdds an optional visibility parameter to the /api/chat/blocking endpoint and the MCP ask_codebase tool. Values: PRIVATE or PUBLIC. Defaults: PRIVATE for authenticated users, PUBLIC for anonymous users (anonymous requests cannot create PRIVATE chats). Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant MCP_Tool as MCP Tool
participant Server
participant DB
Client->>MCP_Tool: send ask_codebase request (optional visibility)
MCP_Tool->>Server: POST /api/chat/blocking (visibility param forwarded)
Server->>Server: determine chatVisibility (requested or default based on auth)
Server->>DB: create chat record with chatVisibility
DB-->>Server: chat created
Server-->>MCP_Tool: return chat link/metadata
MCP_Tool-->>Client: present chat link (visibility noted)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
|
@cursoragent add changelog entries to the main changelog and the packages/mcp changelog. The PR link is #903 |
Sorry, something went wrong.
|
Done! I've added changelog entries to both CHANGELOG.md files and pushed the changes. Changes MadeMain CHANGELOG.md (/workspace/CHANGELOG.md)
MCP CHANGELOG.md (/workspace/packages/mcp/CHANGELOG.md)
Both entries follow the repository's changelog conventions with the PR link included. The changes have been committed and pushed to the cursor/SOU-510-mcp-chat-visibility-d270 branch. |
Sorry, something went wrong.
- Add entry to main CHANGELOG.md - Add entry to packages/mcp/CHANGELOG.md Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
- Clarify that the change affects both the API endpoint and MCP tool Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify each finding against the current code and only fix it if needed. Inline comments: In `@packages/web/src/app/api/`(server)/chat/blocking/route.ts: - Around line 102-103: The code computes chatVisibility using requestedVisibility ?? (user ? ChatVisibility.PRIVATE : ChatVisibility.PUBLIC), which allows an anonymous caller to explicitly set PRIVATE; change the guard so PRIVATE is only allowed for authenticated users — e.g., if (!user && requestedVisibility === ChatVisibility.PRIVATE) set chatVisibility = ChatVisibility.PUBLIC, otherwise use requestedVisibility ?? (user ? ChatVisibility.PRIVATE : ChatVisibility.PUBLIC); update the logic around the chatVisibility variable (and any downstream use) to enforce that ChatVisibility.PRIVATE is only accepted when user is present.
Sorry, something went wrong.
- Update visibility logic to ignore PRIVATE requests from unauthenticated users - Add guard to ensure anonymous users can only create PUBLIC chats - Update tool description and schema to document this behavior - Prevents creation of inaccessible ownerless private chats Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
- Remove note from MCP tool descriptions (schemas.ts and index.ts) - Add note to blocking chat API route's visibility parameter description - Clarifies that the restriction is enforced at the API level Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
| Back | FazBrowse Home | New Git URL |
Add an optional visibility parameter to the ask_codebase tool to allow agents to control chat session visibility.
This enables agents to set chat sessions to public in shared environments like Slack, preventing 404 errors for users who did not create the API key used by the MCP server.
Linear Issue: SOU-510
Summary by CodeRabbit