Changeset 0.17.0 (#75)

This commit is contained in:
2026-02-27 16:25:39 +00:00
parent 8bb77710b9
commit c9141a6896
37 changed files with 2778 additions and 968 deletions

View File

@@ -69,8 +69,16 @@ func (t *kbSearchTool) Execute(ctx context.Context, execCtx ExecutionContext, ar
// Resolve user's team IDs for scoped access
teamIDs, _ := t.stores.Teams.GetUserTeamIDs(ctx, execCtx.UserID)
// Get active KB IDs for this channel (respects scope: global, team, personal)
kbIDs, err := t.stores.KnowledgeBases.GetActiveKBIDs(ctx, execCtx.ChannelID, execCtx.UserID, teamIDs)
// Get active KB IDs for this channel, including persona-bound KBs
var kbIDs []string
var err error
if execCtx.PersonaID != "" {
kbIDs, err = t.stores.KnowledgeBases.GetActiveKBIDsWithPersona(
ctx, execCtx.ChannelID, execCtx.UserID, teamIDs, execCtx.PersonaID)
} else {
kbIDs, err = t.stores.KnowledgeBases.GetActiveKBIDs(
ctx, execCtx.ChannelID, execCtx.UserID, teamIDs)
}
if err != nil {
return "", fmt.Errorf("failed to look up active knowledge bases: %w", err)
}

View File

@@ -43,6 +43,7 @@ type ToolResult struct {
type ExecutionContext struct {
UserID string
ChannelID string
PersonaID string // set when a persona is active — tools use for scoped KB access
}
// Tool is the interface every built-in tool implements.