MCPcopy Create free account
hub / github.com/compozy/agh / ListTaskBlocks

Method ListTaskBlocks

internal/task/manager_test.go:686–710  ·  view source on GitHub ↗
(
	_ context.Context,
	taskID string,
	includeCleared bool,
)

Source from the content-addressed store, hash-verified

684}
685
686func (s *inMemoryManagerStore) ListTaskBlocks(
687 _ context.Context,
688 taskID string,
689 includeCleared bool,
690) ([]TaskBlock, error) {
691 trimmedTaskID := strings.TrimSpace(taskID)
692 if _, ok := s.tasks[trimmedTaskID]; !ok {
693 return nil, ErrTaskNotFound
694 }
695 now := time.Date(2026, 4, 14, 15, 0, 0, 0, time.UTC)
696 blocks := make([]TaskBlock, 0, len(s.blocks[trimmedTaskID]))
697 for _, block := range s.blocks[trimmedTaskID] {
698 if !includeCleared && !taskBlockOpenAt(block, now) {
699 continue
700 }
701 blocks = append(blocks, cloneTaskBlock(block))
702 }
703 sort.Slice(blocks, func(i int, j int) bool {
704 if !blocks[i].CreatedAt.Equal(blocks[j].CreatedAt) {
705 return blocks[i].CreatedAt.Before(blocks[j].CreatedAt)
706 }
707 return blocks[i].ID < blocks[j].ID
708 })
709 return blocks, nil
710}
711
712func (s *inMemoryManagerStore) HasOpenTaskBlocks(_ context.Context, taskID string) (bool, error) {
713 trimmedTaskID := strings.TrimSpace(taskID)

Callers

nothing calls this directly

Calls 3

taskBlockOpenAtFunction · 0.85
appendFunction · 0.85
cloneTaskBlockFunction · 0.85

Tested by

no test coverage detected