Changeset 0.29.0 (#195)
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"git.gobha.me/xcaliber/chat-switchboard/database"
|
||||
"git.gobha.me/xcaliber/chat-switchboard/models"
|
||||
"git.gobha.me/xcaliber/chat-switchboard/store"
|
||||
"git.gobha.me/xcaliber/chat-switchboard/taskutil"
|
||||
@@ -112,10 +111,7 @@ func (t *taskCreateTool) Execute(ctx context.Context, execCtx ExecutionContext,
|
||||
|
||||
// Depth guard: verify we're not inside a service channel (task output)
|
||||
if execCtx.ChannelID != "" {
|
||||
var channelType string
|
||||
_ = database.DB.QueryRowContext(ctx, database.Q(
|
||||
`SELECT type FROM channels WHERE id = $1`,
|
||||
), execCtx.ChannelID).Scan(&channelType)
|
||||
channelType, _, _ := t.stores.Channels.GetTypeAndTeamID(ctx, execCtx.ChannelID)
|
||||
if channelType == "service" {
|
||||
return "", fmt.Errorf("tasks cannot create tasks (depth limit)")
|
||||
}
|
||||
@@ -124,10 +120,7 @@ func (t *taskCreateTool) Execute(ctx context.Context, execCtx ExecutionContext,
|
||||
// Resolve persona ID from handle
|
||||
var personaID *string
|
||||
if args.Persona != "" {
|
||||
var pID string
|
||||
err := database.DB.QueryRowContext(ctx, database.Q(
|
||||
`SELECT id FROM personas WHERE LOWER(handle) = LOWER($1) AND is_active = true`,
|
||||
), args.Persona).Scan(&pID)
|
||||
pID, err := t.stores.Personas.FindActiveByHandle(ctx, args.Persona)
|
||||
if err == nil && pID != "" {
|
||||
personaID = &pID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user