Skip to content

fix(ask_sb): Allow unauthed generation of titles for a chat #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2025

Conversation

brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Aug 8, 2025

Noticed that in the demo instance, this error was appearing:

image

This was introduced in #447. I forgot to set the minimum rom for the generateAndUpdateChatNameFromMessage action to GUEST. This PR fixes that.

Summary by CodeRabbit

  • Chores
    • Improved internal handling of organization membership checks for chat-related actions. No visible changes to user experience.

@brendan-kellam brendan-kellam requested a review from msukkari August 8, 2025 05:47
Copy link

coderabbitai bot commented Aug 8, 2025

Walkthrough

Explicit parameters were added to all withOrgMembership function calls within several exported async functions in the chat actions module. These parameters set the minimum required organization role to GUEST and enable unauthenticated access in single-tenant mode. No changes were made to the exported function signatures or their control flow.

Changes

Cohort / File(s) Change Summary
Chat Action Auth Parameters
packages/web/src/features/chat/actions.ts
Added explicit parameters (OrgRole.GUEST, true) to all withOrgMembership calls in exported async functions. No changes to function signatures or logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hopped through code so neat,
Adding roles and flags with nimble feet.
Now guests may chat, unauth access too—
All with a single, simple view.
🐇✨ The code is clear, the task complete!

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f2644d and 68006aa.

📒 Files selected for processing (1)
  • packages/web/src/features/chat/actions.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*

📄 CodeRabbit Inference Engine (.cursor/rules/style.mdc)

Filenames should always be camelCase. Exception: if there are filenames in the same directory with a format other than camelCase, use that format to keep things consistent.

Files:

  • packages/web/src/features/chat/actions.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (7)
packages/web/src/features/chat/actions.ts (7)

50-50: LGTM! Appropriate guest access for chat creation.

The explicit parameters correctly allow guest users to create chats, with the existing logic ensuring guest chats are set to PUBLIC visibility for security.


77-77: LGTM! Guest access appropriately restricted by existing privacy controls.

Allowing guest access to getChatInfo is secure since the existing logic (lines 67-69) ensures private chats can only be accessed by their creators.


124-124: LGTM! Message updates properly secured with existing checks.

Guest access is appropriate here since the existing privacy checks ensure only chat creators can update private chats, and guests can only create/access public chats.


185-185: LGTM! Consistent guest access with proper authorization checks.

The modification maintains the same security pattern as other update functions, ensuring only chat creators can modify private chats.


236-237: LGTM! This directly addresses the reported issue.

This change allows unauthenticated users to generate chat titles, which was the core issue described in the PR. The security is maintained through the internal call to updateChatName which has proper authorization checks.


338-338: LGTM! Enables community feedback on public chats.

Allowing guest users to submit feedback is appropriate, with existing security ensuring only chat creators can provide feedback on private chats.


127-148: Good consistency in applying guest access selectively.

The functions getUserChatHistory and deleteChat appropriately remain restricted to authenticated users, as they involve user-specific operations and destructive actions respectively.

Also applies to: 240-280

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bkellam/fix_unauthed_title_generation

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Aug 8, 2025

@brendan-kellam your pull request is missing a changelog!

@brendan-kellam brendan-kellam merged commit a9a61e7 into main Aug 8, 2025
6 checks passed
@brendan-kellam brendan-kellam deleted the bkellam/fix_unauthed_title_generation branch August 8, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant