mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
fix: improve Matrix session detection to prevent API calls in DMs
- Fixed hasMatrixMapping logic to properly detect Matrix-backed sessions - Matrix room IDs check for direct mappings - Regular session IDs check if they're mapped FROM Matrix rooms - This prevents DM sessions from making OpenAI API calls - Only @goose mentions should trigger AI responses in DMs
This commit is contained in:
@@ -88,7 +88,11 @@ export const useChatEngine = ({
|
||||
const matrixRoomId = sessionMappingService.getMatrixRoomId(chat.sessionId);
|
||||
|
||||
// Check if this session has a Matrix mapping (indicating it's a Matrix-backed session)
|
||||
const hasMatrixMapping = sessionMappingService.getMapping(chat.sessionId) !== null;
|
||||
// For Matrix room IDs, check if a mapping exists
|
||||
// For regular session IDs, check if they're mapped FROM a Matrix room
|
||||
const hasMatrixMapping = isMatrixRoom
|
||||
? sessionMappingService.getMapping(chat.sessionId) !== null
|
||||
: matrixRoomId !== null;
|
||||
|
||||
// A session is collaborative if:
|
||||
// 1. It's a Matrix room ID (starts with !)
|
||||
|
||||
Reference in New Issue
Block a user