Repository navigation
Conversation
One person who belongs to two workspaces saw, opened and searched the chats of both: conversations were keyed by the participant alone. A conversation now records its workspace and every lookup of "the person's chats" filters by the current one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQ7RLkriGEGCWb5ydUfdzf
Member
|
Thank you, this is a great catch and a clean change. It's merged as #65 with your commit kept as it was, rebased onto 1.12.0. On top of it, the migration now fills in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, we run the agents plugin on a Filament panel with tenancy (one person often belongs to several businesses) and plan to keep using and contributing to it.
The problem
Conversations are keyed by the participant alone. A person who is a member of two workspaces sees, opens and searches the chats of both: a chat started in workspace A shows up in the sidebar and the chat list of workspace B, and the turn endpoint accepts it there — so B's tools run with A's history in the prompt.
By the threat model in
SECURITY.mdthis stays within what that same person could see by hand, so we are sending it as a regular pull request rather than by email. Please relabel the changelog line if you see it differently.The change
tenantcolumn (with an index) toagent_conversations.AgentConversationStore::conversationsOf($participant)is the one query for "this person's chats": participant, plus the current tenant when there is one (Agents::tenant()).storeConversation()records the current tenant;conversationBelongsTo()also checks it.AgentChat(list, search) andAgentTurns::owned()useconversationsOf().tenantstays null and no filter is added.Upgrading: run
php artisan migrate. In apps with tenancy, chats stored before the migration have notenantand stay hidden until it is filled in — we chose hiding over guessing which workspace they belong to; happy to change that if you prefer a different default.Tests
tests/Feature/TenantWallTest.php;PostedAndDeferredTestnow expects another workspace's conversation to be refused.composer test: 131 passed. Without thesrcchange the new test fails.A companion pull request in
packstub/filament-agentsmoves the Chats page and the sidebar ontoconversationsOf(); it needs this one released first.🤖 Generated with Claude Code