Skip to content

🔨 chore: return full brief data in task activities#13914

Merged
arvinxx merged 2 commits into
canaryfrom
feat/lobe-7266-activity-brief
Apr 17, 2026
Merged

🔨 chore: return full brief data in task activities#13914
arvinxx merged 2 commits into
canaryfrom
feat/lobe-7266-activity-brief

Conversation

@arvinxx

@arvinxx arvinxx commented Apr 17, 2026

Copy link
Copy Markdown
Member

💻 Change Type

  • ✨ feat

🔗 Related Issue

Fixes LOBE-7266

🔀 Description of Change

The activity feed returned by TaskService.getTaskDetail previously emitted a stripped brief row that:

  1. Concatenated resolvedAction and resolvedComment into a single string (e.g. "approve: 修改意见"), so the frontend could not render them separately.
  2. Omitted the rest of the columns the BriefCard UI needs: taskId, topicId, agentId, cronJobId, artifacts, actions, readAt, resolvedAt, userId, createdAt, and the enriched agents avatar list.

This PR maps the full BriefItem shape into each activity row and reuses BriefService.enrichBriefsWithAgents to populate the participant avatars. TaskDetailActivity is expanded with the new optional fields (plus a TaskDetailActivityAgent interface) so consumers can render a fully-featured BriefCard. The CLI and prompt formatter now compose the action: comment display 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 pass

  • bunx 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.

@vercel

vercel Bot commented Apr 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 17, 2026 8:45am

Request Review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/server/services/task/index.ts
@codecov

codecov Bot commented Apr 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.31034% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.92%. Comparing base (2824c82) to head (eacc1fa).
⚠️ Report is 5 commits behind head on canary.

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               
Flag Coverage Δ
app 59.31% <100.00%> (?)
database 92.42% <ø> (ø)
packages/agent-runtime 79.72% <ø> (ø)
packages/context-engine 83.22% <ø> (ø)
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 74.74% <ø> (ø)
packages/model-bank 99.86% <ø> (ø)
packages/model-runtime 84.21% <ø> (ø)
packages/prompts 69.08% <0.00%> (-0.16%) ⬇️
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.34% <ø> (ø)
packages/web-crawler 88.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 66.25% <ø> (∅)
Services 51.75% <ø> (∅)
Server 66.94% <100.00%> (∅)
Libs 51.35% <ø> (∅)
Utils 91.12% <ø> (-2.36%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

arvinxx added 2 commits April 17, 2026 16:20
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.
@arvinxx arvinxx force-pushed the feat/lobe-7266-activity-brief branch from 87d5317 to eacc1fa Compare April 17, 2026 08:20
@arvinxx arvinxx changed the title ✨ feat: return full brief data in task activities 🔨 chore: return full brief data in task activities Apr 17, 2026
@arvinxx arvinxx merged commit 34b60e1 into canary Apr 17, 2026
33 of 34 checks passed
@arvinxx arvinxx deleted the feat/lobe-7266-activity-brief branch April 17, 2026 11:10
@arvinxx arvinxx mentioned this pull request Apr 27, 2026
mrsimpson pushed a commit to mrsimpson/lobehub that referenced this pull request May 8, 2026
* ✨ 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant