Inject task comments into agent context during work and review

t-184·WorkTask·
·
·
·Omni/Agent.hs
Created3 months ago·Updated3 months ago

Dependencies

Description

Edit

Comments on tasks/epics should be visible to the coder agent during implementation and to the reviewer during review.

Current State

Worker.hs formatTask includes: id, title, type, status, priority, parent, namespace, timestamps, description, dependencies.

Comments are NOT included.

Changes

1. Update formatTask in Omni/Agent/Worker.hs to include comments:

formatTask :: TaskCore.Task -> Text
formatTask t =
  "Task: " <> TaskCore.taskId t <> "\n"
    <> "Title:      " <> TaskCore.taskTitle t <> "\n"
    <> "Type:       " <> Text.pack (show (TaskCore.taskType t)) <> "\n"
    <> "Status:     " <> Text.pack (show (TaskCore.taskStatus t)) <> "\n"
    <> "Priority:   " <> Text.pack (show (TaskCore.taskPriority t)) <> "\n"
    <> maybe "" (\p -> "Parent:     " <> p <> "\n") (TaskCore.taskParent t)
    <> maybe "" (\ns -> "Namespace:  " <> ns <> "\n") (TaskCore.taskNamespace t)
    <> "Created:    " <> Text.pack (show (TaskCore.taskCreatedAt t)) <> "\n"
    <> "Updated:    " <> Text.pack (show (TaskCore.taskUpdatedAt t)) <> "\n"
    <> (if Text.null (TaskCore.taskDescription t) then "" else "\nDescription:\n" <> TaskCore.taskDescription t <> "\n")
    <> (if null (TaskCore.taskDependencies t) then "" else "\nDependencies:\n" <> Text.unlines (map formatDep (TaskCore.taskDependencies t)))
    <> formatComments (TaskCore.taskComments t)  -- NEW
  where
    formatDep dep = "  - " <> TaskCore.depId dep <> " [" <> Text.pack (show (TaskCore.depType dep)) <> "]"
    formatComments [] = ""
    formatComments cs = "\nComments/Notes:\n" <> Text.unlines (map formatComment cs)
    formatComment c = "  [" <> formatTime (TaskCore.commentCreatedAt c) <> "] " <> TaskCore.commentText c
    formatTime t = Text.pack (show t)  -- or use a shorter format

2. The review context already uses the full task, so comments will be included automatically after this change.

Files: Omni/Agent/Worker.hs

Testing: Create a task with comments, run jr work <id>, verify the amp prompt includes the comments.

Timeline (0)

No activity yet.