🔨 chore: return full brief data in task activities#13914
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b14bf36bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## canary #13914 +/- ##
===========================================
- Coverage 86.06% 66.92% -19.15%
===========================================
Files 599 2059 +1460
Lines 49886 175223 +125337
Branches 8534 17305 +8771
===========================================
+ Hits 42934 117265 +74331
- Misses 6828 57834 +51006
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The activity feed for tasks previously emitted a stripped `brief` row that concatenated `resolvedAction` and `resolvedComment` and omitted everything BriefCard needs (taskId, topicId, agentId, cronJobId, agents, actions, artifacts, readAt, resolvedAt, etc.). Map the full `BriefItem` into each activity row and reuse `BriefService.enrichBriefsWithAgents` to populate the participant avatars. The CLI and prompt formatter now compose the action + comment display string themselves.
getTaskDetail was calling BriefService.enrichBriefsWithAgents inside Promise.all without a fallback, so a failure in the agent-tree lookup would reject the whole request — a regression vs. the existing .catch(() => []) pattern used by other activity reads in this method. Fall back to agentless briefs on error so the task detail keeps rendering.
87d5317 to
eacc1fa
Compare
* ✨ feat: return full brief data in task activities (LOBE-7266) The activity feed for tasks previously emitted a stripped `brief` row that concatenated `resolvedAction` and `resolvedComment` and omitted everything BriefCard needs (taskId, topicId, agentId, cronJobId, agents, actions, artifacts, readAt, resolvedAt, etc.). Map the full `BriefItem` into each activity row and reuse `BriefService.enrichBriefsWithAgents` to populate the participant avatars. The CLI and prompt formatter now compose the action + comment display string themselves. * 🐛 fix: degrade gracefully when brief agent enrichment fails getTaskDetail was calling BriefService.enrichBriefsWithAgents inside Promise.all without a fallback, so a failure in the agent-tree lookup would reject the whole request — a regression vs. the existing .catch(() => []) pattern used by other activity reads in this method. Fall back to agentless briefs on error so the task detail keeps rendering.
💻 Change Type
🔗 Related Issue
Fixes LOBE-7266
🔀 Description of Change
The activity feed returned by
TaskService.getTaskDetailpreviously emitted a strippedbriefrow that:resolvedActionandresolvedCommentinto a single string (e.g."approve: 修改意见"), so the frontend could not render them separately.taskId,topicId,agentId,cronJobId,artifacts,actions,readAt,resolvedAt,userId,createdAt, and the enrichedagentsavatar list.This PR maps the full
BriefItemshape into each activity row and reusesBriefService.enrichBriefsWithAgentsto populate the participant avatars.TaskDetailActivityis expanded with the new optional fields (plus aTaskDetailActivityAgentinterface) so consumers can render a fully-featured BriefCard. The CLI and prompt formatter now compose theaction: commentdisplay string themselves, so the console/LLM output is unchanged.🧪 How to Test
Tested locally
Added/updated tests
No tests needed
bunx vitest run src/server/services/task/index.test.ts— 20/20 pass (updated two cases + added a full-shape assertion with mocked agent enrichment)bunx vitest run src/store/task/selectors/activitySelectors.test.ts src/server/services/brief/index.test.ts— 16/16 passbunx vitest run src/prompts/task/index.test.ts(packages/prompts) — 14/14 pass📝 Additional Information
No DB schema changes; the briefs table already has every column — the service was just not projecting them. CLI/prompt output is preserved by composing
resolvedAction[: resolvedComment]at the display layer instead of at the service layer.