feat: show queued prompt count badge in the task sidebar (#2354)

This commit is contained in:
Clément Fiere
2026-08-07 16:34:39 +02:00
committed by GitHub
parent 4d80edacf2
commit 084ecc8b54
51 changed files with 2262 additions and 64 deletions
@@ -960,6 +960,24 @@ func (s *Service) authorizeSession(ctx context.Context, sessionID string) error
return s.sessionAccessCheck(ctx, sessionID)
}
// SessionTaskID returns the task that owns a session, or "" when the session
// is unknown. Used to enrich message.queue.status_changed events with the
// task_id so task-scoped consumers (e.g. the status summary projector) can
// refresh per-task queued-prompt counts.
func (s *Service) SessionTaskID(ctx context.Context, sessionID string) (string, error) {
if sessionID == "" || s.repo == nil {
return "", nil
}
session, err := s.repo.GetTaskSession(ctx, sessionID)
if err != nil {
return "", err
}
if session == nil {
return "", nil
}
return session.TaskID, nil
}
// authorizeTask applies the configured per-user task check. No-op when unwired.
func (s *Service) authorizeTask(ctx context.Context, taskID string) error {
if s.taskAccessCheck == nil || taskID == "" {