AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(platform): group Home's Recent work by expert, workflow, or Autopilot (#14342)
Ubbed4a8fe494cc8
diff --git a/autogpt_platform/backend/backend/api/features/home/briefing.py b/autogpt_platform/backend/backend/api/features/home/briefing.pyindex 898f6a76a1..666b982384 100644--- a/autogpt_platform/backend/backend/api/features/home/briefing.py+++ b/autogpt_platform/backend/backend/api/features/home/briefing.py@@ -46,7 +46,7 @@ def compose_briefing()generated_at = as_utc(persisted.generated_at)- anchored = [_outcome(item, expert_by_id) for item in persisted.run_items]+ anchored = [to_outcome(item, expert_by_id) for item in persisted.run_items]anchored_ids = {outcome.id for outcome in anchored}fresh = [outcome@@ -143,6 +143,21 @@ def _live_outcomes(expert_by_id: dict[str, Expert],agent_by_graph: dict[str, AgentRef],) -> list[HomeBriefingOutcome]:+ return [+ to_outcome(item, expert_by_id)+ for item in live_run_items(executions, since, now, expert_by_id, agent_by_graph)+ ]+++def live_run_items(+ executions: list[GraphExecutionMeta],+ since: datetime,+ now: datetime,+ expert_by_id: dict[str, Expert],+ agent_by_graph: dict[str, AgentRef],+) -> list[BriefingRunItem]:+ """Every run that reached a terminal state inside the window, failures+ first and most recent first within each status."""terminal = [executionfor execution in executions@@ -157,8 +172,7 @@ def _live_outcomes())return [- _outcome(_run_item(execution, expert_by_id, agent_by_graph), expert_by_id)- for execution in terminal+ _run_item(execution, expert_by_id, agent_by_graph) for execution in terminal]@@ -176,7 +190,7 @@ def _run_item()-def _outcome(+def to_outcome(item: BriefingRunItem, expert_by_id: dict[str, Expert]) -> HomeBriefingOutcome:failed = item.status == "FAILED"diff --git a/autogpt_platform/backend/backend/api/features/home/compose.py b/autogpt_platform/backend/backend/api/features/home/compose.pyindex c27f8fb938..fcd431c70b 100644--- a/autogpt_platform/backend/backend/api/features/home/compose.py+++ b/autogpt_platform/backend/backend/api/features/home/compose.py@@ -87,6 +87,11 @@ def compose_home_dashboard(agents=agents,week=compose_week_summary(cost_summary, credits_balance),recent_work=compose_recent_work(- work_events or [], expert_by_id, session_titles or {}+ now=now,+ executions=executions,+ events=work_events or [],+ expert_by_id=expert_by_id,+ agent_by_graph=agent_by_graph,+ session_titles=session_titles or {},),)diff --git a/autogpt_platform/backend/backend/api/features/home/models.py b/autogpt_platform/backend/backend/api/features/home/models.pyindex b1d524847a..fcecba8720 100644--- a/autogpt_platform/backend/backend/api/features/home/models.py+++ b/autogpt_platform/backend/backend/api/features/home/models.py@@ -123,11 +123,12 @@ class HomeWeekSummary(BaseModel):class HomeWorkActor(BaseModel):- # "expert" = a hired expert did it, "autopilot" = the default copilot- # assistant, "agent" = a graph run with no expert attribution.- kind: Literal["expert", "autopilot", "agent"]+ # "expert" = a hired expert did it, "workflow" = a library workflow ran on+ # its own, "autopilot" = the default copilot assistant.+ kind: Literal["expert", "workflow", "autopilot"]name: strexpert: HomeExpert | None = None+ link: str | None = Noneclass HomeRecentWorkItem(BaseModel):@@ -139,19 +140,28 @@ class HomeRecentWorkItem(BaseModel):provider: str | None = Nonefile_id: str | None = Nonemime_type: str | None = None+ # The copilot thread the item came out of, when there was one.+ session_title: str | None = None+ link: str | None = Noneclass HomeRecentWorkGroup(BaseModel):+ """Everything one actor did this week: the runs it finished and the+ durable things it produced."""+actor: HomeWorkActor- session_id: str | None = None- session_title: str | None = None- link: str | None = Nonelatest_at: datetime- items: list[HomeRecentWorkItem]+ runs: list[HomeBriefingOutcome] = Field(default_factory=list)+ items: list[HomeRecentWorkItem] = Field(default_factory=list)+ # Runs and items past the per-group caps, so the group can say how much+ # more there was without listing it.more_count: int = 0class HomeRecentWork(BaseModel):+ window_started_at: datetime | None = None+ completed_count: int = 0+ failed_count: int = 0groups: list[HomeRecentWorkGroup] = Field(default_factory=list)total_count: int = 0diff --git a/autogpt_platform/backend/backend/api/features/home/recent_work.py b/autogpt_platform/backend/backend/api/features/home/recent_work.pyindex c3bb4969f6..85ff5973a6 100644--- a/autogpt_platform/backend/backend/api/features/home/recent_work.py+++ b/autogpt_platform/backend/backend/api/features/home/recent_work.py@@ -1,25 +1,35 @@-"""Compose the Home "Recent work" feed from activity events.+"""Compose the Home "Recent work" feed: one group per actor.-Runs are deliberately excluded here: completed runs are the briefing's-job. This card shows the durable things agents produced — files written,-integration actions taken, schedules set up — grouped by who did the-work and in which thread.+The card answers "who did what this week". Every run that finished and+every durable thing produced — files written, integration actions taken,+schedules set up — is attributed to the expert, workflow, or Autopilot+that did it, so the two feeds land in the same block instead of describing+the same day from different angles."""+from datetime import datetime, timedelta, timezonefrom typing import Literalfrom backend.api.features.experts.models import Expert+from backend.blocks.llm import LLM_PROVIDER_NAMES+from backend.copilot.briefing.models import BriefingRunItem+from backend.copilot.briefing.outcome import as_utcfrom backend.data.activity_event import ActivityEvent+from backend.data.execution import GraphExecutionMeta-from .helpers import to_home_expert+from .briefing import live_run_items, to_outcome+from .helpers import UNKNOWN_AGENT, AgentRef, to_home_expertfrom .models import (+ HomeBriefingOutcome,HomeRecentWork,HomeRecentWorkGroup,HomeRecentWorkItem,HomeWorkActor,)+_WINDOW = timedelta(days=7)_MAX_GROUPS = 6+_MAX_RUNS_PER_GROUP = 3_MAX_ITEMS_PER_GROUP = 4_ITEM_CATEGORIES: dict[str, Literal["file", "integration", "schedule"]] = {@@ -28,69 +38,151 @@ _ITEM_CATEGORIES: dict[str, Literal["file", "integration", "schedule"]] = {"SCHEDULE": "schedule",}+ActorKey = tuple[Literal["expert", "workflow", "autopilot"], str]+++class _Bucket:+ def __init__(self, actor: HomeWorkActor) -> None:+ self.actor = actor+ self.runs: list[HomeBriefingOutcome] = []+ self.items: list[HomeRecentWorkItem] = []+ self.latest_at: datetime | None = None++ def touch(self, at: datetime | None) -> None:+ if at is None:+ return+ at = as_utc(at)+ if self.latest_at is None or at > self.latest_at:+ self.latest_at = at+def compose_recent_work(+ *,+ now: datetime,+ executions: list[GraphExecutionMeta],events: list[ActivityEvent],expert_by_id: dict[str, Expert],+ agent_by_graph: dict[str, AgentRef],session_titles: dict[str, str | None],) -> HomeRecentWork:- """Group displayable events by (actor, thread), newest group first.-- *events* arrive newest-first, so first-seen insertion order already- ranks groups by their latest event.- """- grouped: dict[tuple[str, str], list[ActivityEvent]] = {}- for event in events:- if event.category not in _ITEM_CATEGORIES:- continue- key = (event.expert_id or "", event.session_id or "")- grouped.setdefault(key, []).append(event)-- groups = [- _compose_group(group_events, expert_by_id, session_titles)- for group_events in grouped.values()+ since = now - _WINDOW+ exec_by_id = {execution.id: execution for execution in executions}+ buckets: dict[ActorKey, _Bucket] = {}++ def bucket(key: ActorKey) -> _Bucket:+ found = buckets.get(key)+ if found is None:+ found = buckets[key] = _Bucket(_actor(key, expert_by_id, agent_by_graph))+ return found++ run_items = live_run_items(executions, since, now, expert_by_id, agent_by_graph)+ for item in run_items:+ target = bucket(_run_key(item))+ target.runs.append(to_outcome(item, expert_by_id))+ target.touch(item.occurred_at)++ displayable = [+ event+ for event in events+ if event.category in _ITEM_CATEGORIES+ and not _is_model_call(event)+ and as_utc(event.created_at) >= since]- total_count = sum(len(group_events) for group_events in grouped.values())- return HomeRecentWork(groups=groups[:_MAX_GROUPS], total_count=total_count)+ for event in displayable:+ target = bucket(_event_key(event, exec_by_id))+ target.items.append(_compose_item(event, session_titles))+ target.touch(event.created_at)++ groups = sorted(+ (_compose_group(found) for found in buckets.values()),+ key=lambda group: group.latest_at,+ reverse=True,+ )+ return HomeRecentWork(+ window_started_at=since,+ completed_count=sum(item.status == "COMPLETED" for item in run_items),+ failed_count=sum(item.status == "FAILED" for item in run_items),+ groups=groups[:_MAX_GROUPS],+ total_count=len(displayable),+ )-def _compose_group(- events: list[ActivityEvent],- expert_by_id: dict[str, Expert],- session_titles: dict[str, str | None],-) -> HomeRecentWorkGroup:- newest = events[0]- session_id = newest.session_id+def _compose_group(found: _Bucket) -> HomeRecentWorkGroup:+ # Runs arrive failures-first then newest-first; events arrive newest-first.+ # Both orders are worth keeping, so the caps slice rather than re-sort.return HomeRecentWorkGroup(- actor=_compose_actor(newest, expert_by_id),- session_id=session_id,- session_title=session_titles.get(session_id) if session_id else None,- link=f"/copilot?sessionId={session_id}" if session_id else None,- latest_at=newest.created_at,- items=[_compose_item(event) for event in events[:_MAX_ITEMS_PER_GROUP]],- more_count=max(0, len(events) - _MAX_ITEMS_PER_GROUP),+ actor=found.actor,+ latest_at=found.latest_at or datetime.min.replace(tzinfo=timezone.utc),+ runs=found.runs[:_MAX_RUNS_PER_GROUP],+ items=found.items[:_MAX_ITEMS_PER_GROUP],+ more_count=max(0, len(found.runs) - _MAX_RUNS_PER_GROUP)+ + max(0, len(found.items) - _MAX_ITEMS_PER_GROUP),)-def _compose_actor(- event: ActivityEvent, expert_by_id: dict[str, Expert]-) -> HomeWorkActor:+def _run_key(item: BriefingRunItem) -> ActorKey:+ if item.expert_id:+ return ("expert", item.expert_id)+ return ("workflow", item.graph_id)+++def _event_key(+ event: ActivityEvent, exec_by_id: dict[str, GraphExecutionMeta]+) -> ActorKey:if event.expert_id:- expert = expert_by_id.get(event.expert_id)- if expert:- return HomeWorkActor(- kind="expert", name=expert.name, expert=to_home_expert(expert)- )- # The expert was archived or removed after the fact; the event and- # its attribution kind survive, only the profile is gone.- return HomeWorkActor(kind="expert", name="Expert")- if event.session_id:- return HomeWorkActor(kind="autopilot", name="Autopilot")- return HomeWorkActor(kind="agent", name="Agent run")---def _compose_item(event: ActivityEvent) -> HomeRecentWorkItem:+ return ("expert", event.expert_id)+ if event.graph_exec_id:+ # The executor stamps the run, not the expert, so an expert's+ # scheduled workflow lands with the expert only via its execution.+ execution = exec_by_id.get(event.graph_exec_id)+ if execution and execution.expert_id:+ return ("expert", execution.expert_id)+ # A run past the fetch limit still keys by its own execution, so two+ # unknown runs never collapse into one unnamed workflow.+ return ("workflow", execution.graph_id if execution else event.graph_exec_id)+ return ("autopilot", "")+++def _actor(+ key: ActorKey, expert_by_id: dict[str, Expert], agent_by_graph: dict[str, AgentRef]+) -> HomeWorkActor:+ kind, ref = key+ if kind == "expert":+ expert = expert_by_id.get(ref)+ if expert is None:+ # The expert was archived or removed after the fact; the work+ # and its attribution kind survive, only the profile is gone.+ return HomeWorkActor(kind="expert", name="Expert")+ return HomeWorkActor(+ kind="expert",+ name=expert.name,+ expert=to_home_expert(expert),+ link=f"/copilot?expertId={expert.id}",+ )+ if kind == "workflow":+ agent = agent_by_graph.get(ref, UNKNOWN_AGENT)+ return HomeWorkActor(+ kind="workflow",+ name=agent.name,+ link=(+ f"/library/agents/{agent.library_agent_id}"+ if agent.library_agent_id+ else None+ ),+ )+ return HomeWorkActor(kind="autopilot", name="Autopilot", link="/copilot")+++def _is_model_call(event: ActivityEvent) -> bool:+ """Rows written before LLM credential use stopped being recorded."""+ return event.category == "INTEGRATION" and event.provider in LLM_PROVIDER_NAMES+++def _compose_item(+ event: ActivityEvent, session_titles: dict[str, str | None]+) -> HomeRecentWorkItem:mime_type = event.data.get("mime_type")+ session_id = event.session_idreturn HomeRecentWorkItem(id=event.id,category=_ITEM_CATEGORIES[event.category],@@ -100,4 +192,6 @@ def _compose_item(event: ActivityEvent) -> HomeRecentWorkItem:provider=event.provider,file_id=event.object_id if event.category == "FILE" else None,mime_type=mime_type if isinstance(mime_type, str) else None,+ session_title=session_titles.get(session_id) if session_id else None,+ link=f"/copilot?sessionId={session_id}" if session_id else None,)diff --git a/autogpt_platform/backend/backend/api/features/home/recent_work_test.py b/autogpt_platform/backend/backend/api/features/home/recent_work_test.pyindex 47ec6a087d..98515ca8f5 100644--- a/autogpt_platform/backend/backend/api/features/home/recent_work_test.py+++ b/autogpt_platform/backend/backend/api/features/home/recent_work_test.py@@ -2,10 +2,15 @@ from datetime import datetime, timedelta, timezonefrom backend.api.features.experts.models import Expertfrom backend.data.activity_event import ActivityEvent, ActivityEventCategory+from backend.data.execution import ExecutionStatus, GraphExecutionMeta-from .recent_work import _MAX_ITEMS_PER_GROUP, compose_recent_work+from .helpers import AgentRef+from .recent_work import _MAX_ITEMS_PER_GROUP, _MAX_RUNS_PER_GROUP, compose_recent_workNOW = datetime(2026, 8, 28, 9, 0, tzinfo=timezone.utc)+AGENTS = {+ "graph-notes": AgentRef(name="Release Note Generator", library_agent_id="lib-1")+}def _expert(expert_id: str, name: str) -> Expert:@@ -30,6 +35,35 @@ def _expert(expert_id: str, name: str) -> Expert:)+def _execution(+ *,+ exec_id: str,+ graph_id: str = "graph-notes",+ status: ExecutionStatus = ExecutionStatus.COMPLETED,+ minutes_ago: int = 0,+ expert_id: str | None = None,+ activity_status: str | None = "I generated release notes.",+) -> GraphExecutionMeta:+ ended_at = NOW - timedelta(minutes=minutes_ago)+ return GraphExecutionMeta(+ id=exec_id,+ user_id="user-1",+ graph_id=graph_id,+ graph_version=1,+ inputs=None,+ credential_inputs=None,+ nodes_input_masks=None,+ preset_id=None,+ status=status,+ started_at=ended_at - timedelta(minutes=1),+ ended_at=ended_at,+ expert_id=expert_id,+ stats=GraphExecutionMeta.Stats(+ activity_status=activity_status, error=None, duration=60.0, cost=7+ ),+ )++def _event(*,event_id: str,@@ -37,6 +71,7 @@ def _event(minutes_ago: int = 0,expert_id: str | None = None,session_id: str | None = None,+ graph_exec_id: str | None = None,title: str = "draft.md",provider: str | None = None,object_id: str | None = None,@@ -50,79 +85,214 @@ def _event(title=title,expert_id=expert_id,session_id=session_id,+ graph_exec_id=graph_exec_id,provider=provider,object_id=object_id,)-def test_groups_by_actor_and_thread_newest_first() -> None:+def _compose(+ executions: list[GraphExecutionMeta] | None = None,+ events: list[ActivityEvent] | None = None,+ experts: dict[str, Expert] | None = None,+ session_titles: dict[str, str | None] | None = None,+):+ return compose_recent_work(+ now=NOW,+ executions=executions or [],+ events=events or [],+ expert_by_id=experts or {},+ agent_by_graph=AGENTS,+ session_titles=session_titles or {},+ )+++def test_groups_runs_and_deliverables_under_the_actor_that_did_them() -> None:maria = _expert("maria", "Maria")+ executions = [+ _execution(exec_id="run-maria", expert_id="maria", minutes_ago=30),+ _execution(exec_id="run-notes", minutes_ago=5),+ ]events = [_event(event_id="e1", expert_id="maria", session_id="s1", minutes_ago=1),- _event(event_id="e2", session_id="s2", minutes_ago=5),- _event(event_id="e3", expert_id="maria", session_id="s1", minutes_ago=10),+ _event(+ event_id="e2",+ category="INTEGRATION",+ title="Send Email",+ provider="google",+ graph_exec_id="run-notes",+ minutes_ago=6,+ ),]- work = compose_recent_work(events, {"maria": maria}, {"s1": "Blog pipeline"})+ work = _compose(executions, events, {"maria": maria}, {"s1": "Blog pipeline"})- assert work.total_count == 3- assert [group.actor.name for group in work.groups] == ["Maria", "Autopilot"]- maria_group = work.groups[0]+ assert [group.actor.name for group in work.groups] == [+ "Maria",+ "Release Note Generator",+ ]+ maria_group, notes_group = work.groupsassert maria_group.actor.kind == "expert"assert maria_group.actor.expert is not None- assert maria_group.session_title == "Blog pipeline"- assert maria_group.link == "/copilot?sessionId=s1"- assert [item.id for item in maria_group.items] == ["e1", "e3"]- assert work.groups[1].actor.kind == "autopilot"+ assert maria_group.actor.link == "/copilot?expertId=maria"+ assert [run.id for run in maria_group.runs] == ["run-maria"]+ assert [item.id for item in maria_group.items] == ["e1"]+ assert maria_group.items[0].session_title == "Blog pipeline"+ assert maria_group.items[0].link == "/copilot?sessionId=s1"+ assert notes_group.actor.kind == "workflow"+ assert notes_group.actor.link == "/library/agents/lib-1"+ assert [run.id for run in notes_group.runs] == ["run-notes"]+ assert [item.id for item in notes_group.items] == ["e2"]+ assert notes_group.items[0].link is None-def test_runs_are_excluded_and_items_capped() -> None:++def test_an_executor_event_follows_its_run_to_the_expert() -> None:+ maria = _expert("maria", "Maria")+ executions = [_execution(exec_id="run-1", expert_id="maria")]events = [_event(- event_id=f"e{index}",- expert_id="maria",- session_id="s1",- minutes_ago=index,+ event_id="e1",+ category="INTEGRATION",+ title="Post Message",+ provider="slack",+ graph_exec_id="run-1",)- for index in range(_MAX_ITEMS_PER_GROUP + 3)- ] + [_event(event_id="run-1", category="RUN", session_id="s1")]+ ]- work = compose_recent_work(events, {}, {})+ work = _compose(executions, events, {"maria": maria})++ assert len(work.groups) == 1+ assert work.groups[0].actor.kind == "expert"+ assert [item.id for item in work.groups[0].items] == ["e1"]+++def test_events_from_unfetched_runs_stay_apart() -> None:+ events = [+ _event(+ event_id="e1",+ category="INTEGRATION",+ provider="google",+ graph_exec_id="run-a",+ ),+ _event(+ event_id="e2",+ category="INTEGRATION",+ provider="slack",+ graph_exec_id="run-b",+ ),+ ]++ work = _compose(events=events)++ assert len(work.groups) == 2+ assert all(group.actor.kind == "workflow" for group in work.groups)+ assert [group.actor.name for group in work.groups] == ["Agent task", "Agent task"]+++def test_thread_work_without_an_expert_is_autopilots() -> None:+ work = _compose(events=[_event(event_id="e1", session_id="s2")])- assert work.total_count == _MAX_ITEMS_PER_GROUP + 3group = work.groups[0]- assert len(group.items) == _MAX_ITEMS_PER_GROUP- assert group.more_count == 3- # The expert profile is gone but the attribution kind survives.- assert group.actor.kind == "expert"- assert group.actor.name == "Expert"+ assert group.actor.kind == "autopilot"+ assert group.actor.name == "Autopilot"+ assert group.actor.link == "/copilot"+ assert group.items[0].link == "/copilot?sessionId=s2"-def test_graph_run_integration_event_without_session() -> None:+def test_llm_credential_use_is_not_delivered_work() -> None:events = [_event(event_id="e1",category="INTEGRATION",+ title="AITextGeneratorBlock",+ provider="openai",+ graph_exec_id="run-1",+ ),+ _event(+ event_id="e2",+ category="INTEGRATION",title="Send Email",provider="google",- object_id="block-1",- )+ graph_exec_id="run-1",+ ),+ _event(event_id="run-event", category="RUN", session_id="s1"),]- work = compose_recent_work(events, {}, {})+ work = _compose(events=events)++ assert work.total_count == 1+ assert [item.id for group in work.groups for item in group.items] == ["e2"]+++def test_groups_are_capped_and_report_the_overflow() -> None:+ executions = [+ _execution(exec_id=f"run-{index}", minutes_ago=index)+ for index in range(_MAX_RUNS_PER_GROUP + 2)+ ]+ events = [+ _event(event_id=f"e{index}", graph_exec_id="run-0", minutes_ago=index)+ for index in range(_MAX_ITEMS_PER_GROUP + 3)+ ]++ work = _compose(executions, events)group = work.groups[0]- assert group.actor.kind == "agent"- assert group.link is None- assert group.items[0].provider == "google"- assert group.items[0].file_id is None+ assert len(group.runs) == _MAX_RUNS_PER_GROUP+ assert len(group.items) == _MAX_ITEMS_PER_GROUP+ assert group.more_count == 5+ assert work.total_count == _MAX_ITEMS_PER_GROUP + 3+++def test_counts_the_weeks_runs_and_orders_groups_by_latest_activity() -> None:+ maria = _expert("maria", "Maria")+ executions = [+ _execution(exec_id="old", minutes_ago=8 * 24 * 60),+ _execution(exec_id="failed", status=ExecutionStatus.FAILED, minutes_ago=50),+ _execution(exec_id="fresh", expert_id="maria", minutes_ago=10),+ _execution(exec_id="done", minutes_ago=120),+ ]++ work = _compose(executions, experts={"maria": maria})++ assert work.window_started_at == NOW - timedelta(days=7)+ assert work.completed_count == 2+ assert work.failed_count == 1+ assert [group.actor.name for group in work.groups] == [+ "Maria",+ "Release Note Generator",+ ]+ # Failures lead within a group so they get looked at first.+ assert [run.id for run in work.groups[1].runs] == ["failed", "done"]+++def test_deliverables_older_than_the_window_are_left_out() -> None:+ events = [+ _event(event_id="fresh", session_id="s1", minutes_ago=60),+ _event(event_id="stale", session_id="s1", minutes_ago=8 * 24 * 60),+ ]++ work = _compose(events=events)++ assert work.total_count == 1+ assert [item.id for item in work.groups[0].items] == ["fresh"]+ assert work.groups[0].latest_at == NOW - timedelta(minutes=60)+++def test_a_removed_expert_keeps_its_attribution_kind() -> None:+ work = _compose(events=[_event(event_id="e1", expert_id="gone", session_id="s1")])++ group = work.groups[0]+ assert group.actor.kind == "expert"+ assert group.actor.name == "Expert"+ assert group.actor.link is Nonedef test_file_items_carry_file_id_and_mime_type() -> None:event = _event(event_id="e1", session_id="s1", object_id="file-9")event.data = {"mime_type": "text/markdown", "size_bytes": 10}- work = compose_recent_work([event], {}, {})+ work = _compose(events=[event])item = work.groups[0].items[0]assert item.file_id == "file-9"diff --git a/autogpt_platform/backend/backend/blocks/llm.py b/autogpt_platform/backend/backend/blocks/llm.pyindex 04fab34438..7a73a2cc51 100644--- a/autogpt_platform/backend/backend/blocks/llm.py+++ b/autogpt_platform/backend/backend/blocks/llm.py@@ -7,9 +7,10 @@ import reimport secretsimport timefrom abc import ABC+from collections.abc import Iterablefrom enum import Enumfrom json import JSONDecodeError-from typing import TYPE_CHECKING, Any, Iterable, List, Literal, Optional, cast+from typing import TYPE_CHECKING, Any, Literal, Optional, cast, get_argsimport anthropicimport openai@@ -89,6 +90,11 @@ LLMProviderName = Literal[ProviderName.V0,]AICredentials = CredentialsMetaInput[LLMProviderName, Literal["api_key"]]+# Providers whose credential use is a model call rather than an action taken+# on the user's behalf; activity feeds leave these out.+LLM_PROVIDER_NAMES: frozenset[str] = frozenset(+ provider.value for provider in get_args(LLMProviderName)+)TEST_CREDENTIALS = APIKeyCredentials(id="769f6af7-820b-4d5d-9b7a-ab82bbc165f",@@ -117,9 +123,9 @@ def AICredentialsField() -> AICredentials:class LLMResponse(BaseModel):raw_response: Any- prompt: List[Any]+ prompt: list[Any]response: str- tool_calls: Optional[List[ToolContentBlock]] | None+ tool_calls: list[ToolContentBlock] | Noneprompt_tokens: intcompletion_tokens: intcache_read_tokens: int = 0@@ -1325,7 +1331,7 @@ class AIConversationBlock(AIBlockBase):default="",advanced=False,)- messages: List[Any] = SchemaField(+ messages: list[Any] = SchemaField(description="List of messages in the conversation.",)model: LLMModel = SchemaField(diff --git a/autogpt_platform/backend/backend/copilot/tools/activity_event_hooks_test.py b/autogpt_platform/backend/backend/copilot/tools/activity_event_hooks_test.pyindex d26da94ee3..652e1e54ca 100644--- a/autogpt_platform/backend/backend/copilot/tools/activity_event_hooks_test.py+++ b/autogpt_platform/backend/backend/copilot/tools/activity_event_hooks_test.py@@ -101,6 +101,21 @@ def test_run_block_reports_integration_action_only_with_provider() -> None:assert tool.activity_event(session=session, result=dry_run) is None+def test_run_block_does_not_report_llm_credential_use() -> None:+ tool = RunBlockTool()+ session = _make_session()+ model_call = BlockOutputResponse(+ message="Block executed",+ block_id="block-1",+ block_name="AITextGeneratorBlock",+ outputs={},+ provider="openai",+ session_id="test-session",+ )++ assert tool.activity_event(session=session, result=model_call) is None++def test_schedule_followup_reports_schedule_event() -> None:result = ScheduleCreatedResponse(message="Follow-up scheduled",diff --git a/autogpt_platform/backend/backend/copilot/tools/run_block.py b/autogpt_platform/backend/backend/copilot/tools/run_block.pyindex bf3535db59..fee9813221 100644--- a/autogpt_platform/backend/backend/copilot/tools/run_block.py+++ b/autogpt_platform/backend/backend/copilot/tools/run_block.py@@ -4,6 +4,7 @@ import loggingimport uuidfrom typing import Any+from backend.blocks.llm import LLM_PROVIDER_NAMESfrom backend.copilot.constants import COPILOT_NODE_EXEC_ID_SEPARATORfrom backend.copilot.context import get_current_permissionsfrom backend.copilot.model import ChatSession@@ -91,6 +92,7 @@ class RunBlockTool(BaseTool):or not result.successor result.is_dry_runor not result.provider+ or result.provider in LLM_PROVIDER_NAMES):return Nonereturn ActivityEventDraft(diff --git a/autogpt_platform/backend/backend/executor/activity_events.py b/autogpt_platform/backend/backend/executor/activity_events.pyindex 257fe18bbb..01b2760d91 100644--- a/autogpt_platform/backend/backend/executor/activity_events.py+++ b/autogpt_platform/backend/backend/executor/activity_events.py@@ -10,6 +10,7 @@ import loggingfrom typing import TYPE_CHECKING, castfrom backend.blocks._base import Block, BlockSchema+from backend.blocks.llm import LLM_PROVIDER_NAMESfrom backend.data.activity_event import ActivityEventDraftfrom backend.data.execution import (ExecutionStatus,@@ -45,6 +46,10 @@ async def log_node_integration_activity(provider = cred_data.get("provider")if not cred_data.get("id") or not provider:continue+ # An LLM key being used is the block thinking, not an action the+ # user would recognise as work delivered.+ if provider in LLM_PROVIDER_NAMES:+ continueawait db_client.create_activity_event(user_id=node_exec.user_id,draft=ActivityEventDraft(diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsxindex 546151df79..3de3f2fd73 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx@@ -76,6 +76,32 @@ const approvalItem: HomeAttentionItem = {},};+const cameraResearch: HomeBriefingOutcome = {+ id: "outcome-1",+ status: "completed",+ title: "Your camera research is ready",+ summary: "Compared 18 cameras and shortlisted the best three.",+ expert: maria,+ agent_name: "Product Researcher",+ occurred_at: NOW,+ duration_seconds: 812,+ cost_cents: 42,+ link: "/library",+};++const schedulingFailure: HomeBriefingOutcome = {+ id: "outcome-2",+ status: "failed",+ title: "Learning sessions could not be scheduled",+ summary: "Nova needs Calendar access before the plan can continue.",+ expert: maria,+ agent_name: "Weekly Learning Coach",+ occurred_at: NOW,+ duration_seconds: 44,+ cost_cents: 3,+ link: "/team/maria",+};+const dashboard: HomeDashboardResponse = {generated_at: NOW,timezone: "UTC",@@ -98,32 +124,7 @@ const dashboard: HomeDashboardResponse = {completed_count: 14,failed_count: 1,routine_count: 13,- outcomes: [- {- id: "outcome-1",- status: "completed",- title: "Your camera research is ready",- summary: "Compared 18 cameras and shortlisted the best three.",- expert: maria,- agent_name: "Product Researcher",- occurred_at: NOW,- duration_seconds: 812,- cost_cents: 42,- link: "/library",- },- {- id: "outcome-2",- status: "failed",- title: "Learning sessions could not be scheduled",- summary: "Nova needs Calendar access before the plan can continue.",- expert: maria,- agent_name: "Weekly Learning Coach",- occurred_at: NOW,- duration_seconds: 44,- cost_cents: 3,- link: "/team/maria",- },- ],+ outcomes: [cameraResearch, schedulingFailure],},active_tasks: [{@@ -170,6 +171,26 @@ const dashboard: HomeDashboardResponse = {},],},+ recent_work: {+ window_started_at: new Date("2026-08-02T12:00:00Z"),+ completed_count: 14,+ failed_count: 1,+ total_count: 0,+ groups: [+ {+ actor: {+ kind: "expert",+ name: "Maria",+ expert: maria,+ link: "/copilot?expertId=maria",+ },+ latest_at: NOW,+ runs: [cameraResearch, schedulingFailure],+ items: [],+ more_count: 13,+ },+ ],+ },};afterEach(() => {@@ -195,7 +216,7 @@ test("renders every Home tile from the aggregate API", async () => {expect(screen.getByText("Connect your calendar for Maria")).toBeDefined();expect(screen.getByRole("heading", { name: "Recent work" })).toBeDefined();expect(screen.getByText("Your camera research is ready")).toBeDefined();- expect(screen.getByText(/13 routine tasks completed quietly/)).toBeDefined();+ expect(screen.getByText("Plus 13 more")).toBeDefined();expect(screen.getByRole("heading", { name: "Your team" })).toBeDefined();expect(screen.getByRole("link", { name: /View all 10 experts/ }),@@ -311,6 +332,7 @@ test("shows calm, useful empty states and drops the empty inbox", async () => {upcoming_tasks: [],team: { total: 0, ready: 0, working: 0, needs_attention: 0 },agents: [],+ recent_work: { groups: [], total_count: 0 },});render(<HomePage />);@@ -324,54 +346,6 @@ test("shows calm, useful empty states and drops the empty inbox", async () => {expect(screen.getByRole("link", { name: "Browse experts" })).toBeDefined();});-test("filters briefing outcomes by their real status", async () => {- const user = userEvent.setup();- mockDashboard(dashboard);-- render(<HomePage />);-- await user.click(- await screen.findByRole("button", {- name: "Filter briefing outcomes: All",- }),- );- await user.click(screen.getByRole("menuitemradio", { name: "Failed" }));-- expect(- screen.getByText("Learning sessions could not be scheduled"),- ).toBeDefined();- expect(screen.queryByText("Your camera research is ready")).toBeNull();-});--test("labels a filter option for an unrecognised briefing status", async () => {- const user = userEvent.setup();- mockDashboard({- ...dashboard,- briefing: {- ...dashboard.briefing,- outcomes: [- dashboard.briefing.outcomes[0],- {- ...dashboard.briefing.outcomes[1],- status: "cancelled" as HomeBriefingOutcome["status"],- },- ],- },- });-- render(<HomePage />);-- await user.click(- await screen.findByRole("button", {- name: "Filter briefing outcomes: All",- }),- );-- expect(- screen.getByRole("menuitemradio", { name: "cancelled" }),- ).toBeDefined();-});-test("shows a retryable page error when the aggregate cannot load", async () => {let attempts = 0;server.use(diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsxindex cb67888750..c6adec6ead 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx@@ -3,7 +3,7 @@ import { expect, test, vi } from "vitest";import type { HomeDashboardResponse } from "@/app/api/__generated__/models/homeDashboardResponse";import type { HomeRecentWork } from "@/app/api/__generated__/models/homeRecentWork";import { server } from "@/mocks/mock-server";-import { render, screen } from "@/tests/integrations/test-utils";+import { render, screen, within } from "@/tests/integrations/test-utils";import HomePage from "../page";vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {@@ -46,14 +46,33 @@ const maria = {};const recentWork: HomeRecentWork = {+ window_started_at: new Date("2026-08-21T09:00:00Z"),+ completed_count: 3,+ failed_count: 1,total_count: 10,groups: [{- actor: { kind: "expert", name: "Maria", expert: maria },- session_id: "session-1",- session_title: "Blog pipeline",- link: "/copilot?sessionId=session-1",+ actor: {+ kind: "expert",+ name: "Maria",+ expert: maria,+ link: "/copilot?expertId=maria",+ },latest_at: NOW,+ runs: [+ {+ id: "run-1",+ status: "completed",+ title: "Your camera research is ready",+ summary: "Compared 18 cameras and shortlisted the best three.",+ expert: maria,+ agent_name: "Product Researcher",+ occurred_at: NOW,+ duration_seconds: 812,+ cost_cents: 42,+ link: "/library/agents/lib-2?activeTab=runs&activeItem=run-1",+ },+ ],items: [{id: "event-1",@@ -63,6 +82,8 @@ const recentWork: HomeRecentWork = {occurred_at: NOW,file_id: "file-1",mime_type: "text/markdown",+ session_title: "Blog pipeline",+ link: "/copilot?sessionId=session-1",},{id: "event-2",@@ -75,9 +96,25 @@ const recentWork: HomeRecentWork = {more_count: 6,},{- actor: { kind: "autopilot", name: "Autopilot" },- session_id: "session-2",+ actor: {+ kind: "workflow",+ name: "Release Note Generator",+ link: "/library/agents/lib-1",+ },latest_at: NOW,+ runs: [+ {+ id: "run-2",+ status: "failed",+ title: "Release notes could not be generated",+ summary: "GitHub returned 401 while listing merged pull requests.",+ agent_name: "Release Note Generator",+ occurred_at: NOW,+ duration_seconds: 44,+ cost_cents: 3,+ link: "/library/agents/lib-1?activeTab=runs&activeItem=run-2",+ },+ ],items: [{id: "event-3",@@ -90,6 +127,22 @@ const recentWork: HomeRecentWork = {],more_count: 0,},+ {+ actor: { kind: "autopilot", name: "Autopilot", link: "/copilot" },+ latest_at: NOW,+ runs: [],+ items: [+ {+ id: "event-4",+ category: "file",+ event_type: "file.created",+ title: "competitor-pricing.csv",+ occurred_at: NOW,+ link: "/copilot?sessionId=session-2",+ },+ ],+ more_count: 0,+ },],};@@ -131,7 +184,7 @@ function mockDashboard(response: HomeDashboardResponse) {);}-test("shows agent work grouped by actor and thread", async () => {+test("groups the week's runs and deliverables by who did them", async () => {mockDashboard(dashboard);render(<HomePage />);@@ -139,17 +192,40 @@ test("shows agent work grouped by actor and thread", async () => {expect(await screen.findByRole("heading", { name: "Recent work" }),).toBeDefined();- expect(screen.getByText("Maria")).toBeDefined();- expect(screen.getByText("Blog pipeline")).toBeDefined();- expect(screen.getByText("2026-08-28-code-review-metrics.md")).toBeDefined();- expect(screen.getByText("persian.sh blog draft")).toBeDefined();- expect(screen.getByText("Plus 6 more")).toBeDefined();- expect(screen.getByText("Autopilot")).toBeDefined();- expect(screen.getByText("Send Email")).toBeDefined();- expect(screen.getByText(/google/)).toBeDefined();+ expect(screen.getByText("3 completed")).toBeDefined();+ expect(screen.getByText("1 failed")).toBeDefined();++ const mariaGroup = screen.getByRole("article", { name: "Maria" });+ expect(within(mariaGroup).getByText("Expert")).toBeDefined();+ expect(+ within(mariaGroup).getByText("Your camera research is ready"),+ ).toBeDefined();+ // An expert runs workflows, so the run says which one.+ expect(within(mariaGroup).getByText("Product Researcher")).toBeDefined();+ expect(+ within(mariaGroup).getByText("2026-08-28-code-review-metrics.md"),+ ).toBeDefined();+ expect(within(mariaGroup).getByText("persian.sh blog draft")).toBeDefined();+ expect(within(mariaGroup).getByText("Plus 6 more")).toBeDefined();++ const workflowGroup = screen.getByRole("article", {+ name: "Release Note Generator",+ });+ expect(within(workflowGroup).getByText("Workflow")).toBeDefined();+ expect(within(workflowGroup).getByText("Failed")).toBeDefined();+ expect(+ within(workflowGroup).getByText("Release notes could not be generated"),+ ).toBeDefined();+ expect(within(workflowGroup).getByText("Send Email")).toBeDefined();+ expect(within(workflowGroup).getByText(/google/)).toBeDefined();++ const autopilotGroup = screen.getByRole("article", { name: "Autopilot" });+ expect(+ within(autopilotGroup).getByText("competitor-pricing.csv"),+ ).toBeDefined();});-test("links a thread-backed group to its copilot session", async () => {+test("links each actor to its home and thread work to its session", async () => {mockDashboard(dashboard);render(<HomePage />);@@ -158,7 +234,16 @@ test("links a thread-backed group to its copilot session", async () => {const links = screen.getAllByRole("link").map((link) => link.getAttribute("href"));+ expect(links).toContain("/copilot?expertId=maria");+ expect(links).toContain("/library/agents/lib-1");+ expect(links).toContain("/copilot");expect(links).toContain("/copilot?sessionId=session-1");+ expect(links).toContain("/copilot?sessionId=session-2");+ expect(+ screen+ .getByRole("link", { name: /code-review-metrics/ })+ .getAttribute("title"),+ ).toBe("Blog pipeline");});test("shows a calm empty state when agents produced nothing yet", async () => {@@ -170,6 +255,7 @@ test("shows a calm empty state when agents produced nothing yet", async () => {render(<HomePage />);expect(await screen.findByText("Nothing to show yet")).toBeDefined();+ expect(screen.getByText("0 completed")).toBeDefined();});test("renders the rest of the page when recent_work is absent", async () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/workflow-runs.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/workflow-runs.test.tsxdeleted file mode 100644index 92a9fcf072..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/workflow-runs.test.tsx+++ /dev/null@@ -1,158 +0,0 @@-import { http, HttpResponse } from "msw";-import { expect, test, vi } from "vitest";-import type { HomeDashboardResponse } from "@/app/api/__generated__/models/homeDashboardResponse";-import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";-import { getGetV1ListAllExecutionsMockHandler } from "@/app/api/__generated__/endpoints/graphs/graphs.msw";-import {- getGetV2ListLibraryAgentsMockHandler,- getGetV2ListLibraryAgentsResponseMock,-} from "@/app/api/__generated__/endpoints/library/library.msw";-import { server } from "@/mocks/mock-server";-import { render, screen, within } from "@/tests/integrations/test-utils";-import HomePage from "../page";--vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {- const actual =- await importActual<- typeof import("@/services/feature-flags/use-get-flag")- >();- return {- ...actual,- useFlagStatus: (flag: string) =>- flag === "hire-experts"- ? { enabled: true, ready: true }- : actual.useFlagStatus(flag as never),- useGetFlag: (flag: string) => flag === actual.Flag.HIRE_EXPERTS,- };-});--vi.mock("@/lib/auth/hooks/useAuth", () => ({- useAuth: () => ({- user: { user_metadata: { preferred_name: "Ubbe" } },- }),-}));--vi.mock("next/navigation", () => ({- useRouter: () => ({ push: vi.fn() }),- usePathname: () => "/home",- useSearchParams: () => new URLSearchParams(),- useParams: () => ({}),- notFound: () => {- throw new Error("NEXT_NOT_FOUND");- },-}));--const NOW = new Date("2026-08-28T09:00:00Z");--const dashboard: HomeDashboardResponse = {- generated_at: NOW,- timezone: "UTC",- attention: [],- briefing: {- generated_at: NOW,- window_started_at: NOW,- completed_count: 0,- failed_count: 0,- routine_count: 0,- outcomes: [],- },- active_tasks: [],- upcoming_tasks: [],- team: { total: 1, ready: 1, working: 0, needs_attention: 0 },- agents: [],- week: {- run_count: 0,- completed_count: 0,- review_count: 0,- failed_count: 0,- total_runtime_seconds: 0,- timed_run_count: 0,- total_cost_cents: 0,- credits_balance: 0,- daily: [],- },- recent_work: { groups: [], total_count: 0 },-};--function mockDashboard(response: HomeDashboardResponse) {- server.use(- http.get(/\/api\/proxy\/api\/home(?:\?.*)?$/, () =>- HttpResponse.json(response),- ),- );-}--// The workflow rows read the library's own agent and execution feeds, not-// the home aggregate, so those are what decide whether they show.-function mockLibraryAgents(agents: Array<Partial<LibraryAgent>>) {- const base = getGetV2ListLibraryAgentsResponseMock();- server.use(- getGetV2ListLibraryAgentsMockHandler({- ...base,- agents: agents.map((agent, index) => ({- ...base.agents[0],- id: `agent-${index}`,- graph_id: `graph-${index}`,- has_external_trigger: false,- is_scheduled: false,- next_scheduled_run: null,- ...agent,- })),- pagination: {- total_items: agents.length,- total_pages: 1,- current_page: 1,- page_size: 100,- },- }),- getGetV1ListAllExecutionsMockHandler([]),- );-}--test("lists each workflow's latest state under Recent work", async () => {- mockDashboard(dashboard);- const inTwoDays = new Date(Date.now() + 2 * 24 * 60 * 60 * 1000);- mockLibraryAgents([- { name: "Inbox Watcher", has_external_trigger: true },- {- name: "Daily Blog Draft",- is_scheduled: true,- next_scheduled_run: inTwoDays.toISOString(),- },- ]);-- render(<HomePage />);-- const workflows = await screen.findByRole("region", { name: "Workflows" });- const card = screen- .getByRole("heading", { name: "Recent work" })- .closest("section");- expect(card?.contains(workflows)).toBe(true);- expect(within(workflows).getByText("Inbox Watcher")).toBeDefined();- expect(- within(workflows).getByText("Waiting for trigger event"),- ).toBeDefined();- expect(- within(workflows).getByRole("link", { name: /See/ }).getAttribute("href"),- ).toBe("/library/agents/agent-0");- // Scheduled runs belong to Now & next's Coming up, so they do not repeat.- expect(within(workflows).queryByText("Daily Blog Draft")).toBeNull();- // Rows are content, so the card's empty state stands down.- expect(screen.queryByText("Nothing to show yet")).toBeNull();-});--test("keeps the empty state when only scheduled workflows exist", async () => {- mockDashboard(dashboard);- mockLibraryAgents([- {- name: "Daily Blog Draft",- is_scheduled: true,- next_scheduled_run: new Date(Date.now() + 60 * 60 * 1000).toISOString(),- },- ]);-- render(<HomePage />);-- expect(await screen.findByText("Nothing to show yet")).toBeDefined();- expect(screen.queryByRole("region", { name: "Workflows" })).toBeNull();-});diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/RecentWork.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/RecentWork.tsxindex 5ab8c89765..76f5392484 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/RecentWork.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/RecentWork.tsx@@ -1,53 +1,26 @@"use client";-import {- CheckmarkCircle02Icon,- WorkHistoryIcon,-} from "@hugeicons/core-free-icons";+import { WorkHistoryIcon } from "@hugeicons/core-free-icons";import type { HomeDashboardResponse } from "@/app/api/__generated__/models/homeDashboardResponse";-import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";-import { formatBriefingWindowStart } from "../../helpers";-import { HomeSectionLabel } from "../HomeSectionLabel/HomeSectionLabel";import { HomeTile } from "../HomeTile/HomeTile";import { HomeTileEmpty } from "../HomeTileEmpty/HomeTileEmpty";-import { HomeTileFilter } from "../HomeTileFilter/HomeTileFilter";-import { OutcomeRow } from "./components/OutcomeRow";-import { RunRow } from "./components/RunRow";import { WorkGroup } from "./components/WorkGroup";-import { type OutcomeFilter, useOutcomeFilter } from "./useOutcomeFilter";-import { useWorkflowRuns } from "./useWorkflowRuns";interface Props {dashboard: HomeDashboardResponse;className?: string;}-/** One card for what the agents did: the briefing's run outcomes, the- * durable things those runs produced, and each workflow's latest state- * from the library feed. The feeds describe the same day from different- * angles, so they share a header and one empty state. */+/** One card for what the agents did this week, grouped by who did it: each+ * expert, workflow, or Autopilot with the runs it finished and the files,+ * integration actions and schedules it produced. */export function RecentWork({ dashboard, className }: Props) {const { briefing } = dashboard;const groups = dashboard.recent_work?.groups ?? [];- const {- filterOptions,- hasFilters,- selectedFilter,- selectFilter,- visibleOutcomes,- } = useOutcomeFilter({ outcomes: briefing.outcomes });- const runs = useWorkflowRuns();- const hasOutcomes = briefing.outcomes.length > 0;- const hasRoutine = briefing.routine_count > 0;- const hasGroups = groups.length > 0;- const hasRuns = runs.length > 0;- const isEmpty =- !hasOutcomes &&- !hasRoutine &&- !hasGroups &&- !hasRuns &&- !briefing.narrative;+ const completed = dashboard.recent_work?.completed_count ?? 0;+ const failed = dashboard.recent_work?.failed_count ?? 0;+ const isEmpty = groups.length === 0 && !briefing.narrative;return (<HomeTile@@ -56,31 +29,13 @@ export function RecentWork({ dashboard, className }: Props) {title="Recent work"meta={<>- <span className="hidden sm:inline">- Since{" "}- {formatBriefingWindowStart(- briefing.window_started_at,- dashboard.timezone,- )}- </span>+ <span className="hidden sm:inline">This week</span><span aria-hidden="true" className="hidden text-zinc-300 sm:inline">·</span>- <span className="tabular-nums">- {briefing.completed_count} completed- </span>- {briefing.failed_count > 0 ? (- <span className="tabular-nums text-rose-600">- {briefing.failed_count} failed- </span>- ) : null}- {hasFilters ? (- <HomeTileFilter- ariaLabelPrefix="Filter briefing outcomes"- value={selectedFilter}- options={filterOptions}- onChange={(value) => selectFilter(value as OutcomeFilter)}- />+ <span className="tabular-nums">{completed} completed</span>+ {failed > 0 ? (+ <span className="tabular-nums text-rose-600">{failed} failed</span>) : null}</>}@@ -88,7 +43,7 @@ export function RecentWork({ dashboard, className }: Props) {{isEmpty ? (<HomeTileEmptytitle="Nothing to show yet"- description="Completed runs, files, integrations and schedules will appear here."+ description="Runs, files, integrations and schedules from your experts and workflows will appear here."/>) : (<div className="divide-y divide-zinc-100">@@ -100,57 +55,15 @@ export function RecentWork({ dashboard, className }: Props) {{briefing.narrative}</Text>) : null}-- {/* A day of only routine work still has a count to report, so the- section stands even when no outcome earned a row. */}- {hasOutcomes || hasRoutine ? (- <section aria-label="Outcomes" className="pb-1">- <HomeSectionLabel>Outcomes</HomeSectionLabel>- <div className="divide-y divide-zinc-100">- {visibleOutcomes.map((outcome) => (- <OutcomeRow key={outcome.id} outcome={outcome} />- ))}- </div>- {hasRoutine ? (- <div className="flex items-center gap-1.5 px-4 py-2 text-xs text-zinc-500">- <Icon- icon={CheckmarkCircle02Icon}- size={13}- className="text-zinc-400"- aria-hidden="true"- />- Plus {briefing.routine_count} routine task- {briefing.routine_count === 1 ? "" : "s"} completed quietly.- </div>- ) : null}- </section>- ) : null}-- {hasGroups ? (- <section aria-label="Delivered">- <HomeSectionLabel>Delivered this week</HomeSectionLabel>- <div className="divide-y divide-zinc-100">- {groups.map((group) => (- <WorkGroup- key={group.items[0]?.id ?? group.actor.name}- group={group}- timezone={dashboard.timezone}- />- ))}- </div>- </section>- ) : null}-- {hasRuns ? (- <section aria-label="Workflows" className="pb-1">- <HomeSectionLabel>Workflows</HomeSectionLabel>- <div>- {runs.map((run) => (- <RunRow key={run.id} run={run} />- ))}- </div>- </section>- ) : null}+ {groups.map((group) => (+ <WorkGroup+ key={+ group.runs?.[0]?.id ?? group.items?.[0]?.id ?? group.actor.name+ }+ group={group}+ timezone={dashboard.timezone}+ />+ ))}</div>)}</HomeTile>diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/ActorMark.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/ActorMark.tsxnew file mode 100644index 0000000000..6d1e57195a--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/ActorMark.tsx@@ -0,0 +1,25 @@+import type { HomeWorkActor } from "@/app/api/__generated__/models/homeWorkActor";+import { Icon } from "@/components/atoms/Icon/Icon";+import { ExpertAvatar } from "@/components/molecules/ExpertAvatar/ExpertAvatar";+import { getActorIcon } from "../helpers";++interface Props {+ actor: HomeWorkActor;+}++export function ActorMark({ actor }: Props) {+ if (actor.kind === "expert" && actor.expert) {+ return (+ <ExpertAvatar+ name={actor.expert.name}+ avatarUrl={actor.expert.avatar_url}+ size={18}+ />+ );+ }+ return (+ <span className="flex size-[18px] shrink-0 items-center justify-center rounded-full bg-zinc-100 text-zinc-500">+ <Icon icon={getActorIcon(actor.kind)} size={11} aria-hidden="true" />+ </span>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/OutcomeRow.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/OutcomeRow.tsxindex 95aec776a3..b4789cf20f 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/OutcomeRow.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/OutcomeRow.tsx@@ -7,29 +7,59 @@ import Link from "next/link";import type { HomeBriefingOutcome } from "@/app/api/__generated__/models/homeBriefingOutcome";import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";-import { ExpertAvatar } from "@/components/molecules/ExpertAvatar/ExpertAvatar";import { cn } from "@/lib/utils";import { formatCurrency, formatDuration } from "../../../helpers";+import { formatWorkTime } from "../helpers";interface Props {outcome: HomeBriefingOutcome;+ timezone: string;+ /** An expert runs workflows, so the run names which one; a workflow+ * group already carries the name in its header. */+ showAgentName: boolean;}-const ROW_CLASS = "flex gap-3 px-4 py-3";+const ROW_CLASS = "flex gap-2 py-2";-export function OutcomeRow({ outcome }: Props) {+export function OutcomeRow({ outcome, timezone, showAgentName }: Props) {const failed = outcome.status === "failed";+ const meta = [+ failed ? (+ <span key="status" className="font-medium text-rose-600">+ Failed+ </span>+ ) : null,+ showAgentName ? (+ <span key="agent" className="font-medium text-zinc-500">+ {outcome.agent_name}+ </span>+ ) : null,+ <span key="time" className="tabular-nums">+ {formatWorkTime(outcome.occurred_at, timezone)}+ </span>,+ outcome.duration_seconds ? (+ <span key="duration" className="tabular-nums">+ {formatDuration(outcome.duration_seconds)}+ </span>+ ) : null,+ outcome.cost_cents ? (+ <span key="cost" className="tabular-nums">+ {formatCurrency(outcome.cost_cents)}+ </span>+ ) : null,+ ].filter(Boolean);+const content = (<><spanclassName={cn(- "mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-md",+ "mt-0.5 flex size-[18px] shrink-0 items-center justify-center rounded-md",failed ? "bg-rose-50 text-rose-600" : "bg-zinc-100 text-zinc-500",)}><Iconicon={failed ? AlertDiamondIcon : CheckListIcon}- size={13}+ size={11}aria-hidden="true"/></span>@@ -47,36 +77,12 @@ export function OutcomeRow({ outcome }: Props) {{outcome.summary}</Text><div className="mt-1 flex flex-wrap items-center gap-x-1.5 gap-y-1 text-[11px] text-zinc-400">- {outcome.expert ? (- <ExpertAvatar- name={outcome.expert.name}- avatarUrl={outcome.expert.avatar_url}- size={16}- />- ) : null}- <span className="font-medium text-zinc-500">- {outcome.expert?.name ?? outcome.agent_name}- </span>- <span aria-hidden="true">·</span>- <span className="tabular-nums">- {formatOccurredAt(outcome.occurred_at)}- </span>- {outcome.duration_seconds ? (- <>- <span aria-hidden="true">·</span>- <span className="tabular-nums">- {formatDuration(outcome.duration_seconds)}- </span>- </>- ) : null}- {outcome.cost_cents ? (- <>- <span aria-hidden="true">·</span>- <span className="tabular-nums">- {formatCurrency(outcome.cost_cents)}- </span>- </>- ) : null}+ {meta.map((part, index) => (+ <span key={index} className="flex items-center gap-x-1.5">+ {index > 0 ? <span aria-hidden="true">·</span> : null}+ {part}+ </span>+ ))}</div></div>{outcome.link ? (@@ -91,25 +97,17 @@ export function OutcomeRow({ outcome }: Props) {);if (!outcome.link) {- return <article className={ROW_CLASS}>{content}</article>;+ return <div className={ROW_CLASS}>{content}</div>;}return (<Linkhref={outcome.link}className={cn(ROW_CLASS,- "group outline-none transition-colors hover:bg-zinc-50 focus-visible:bg-zinc-50",+ "group -mx-1 rounded px-1 outline-none transition-colors hover:bg-zinc-50 focus-visible:bg-zinc-50",)}>{content}</Link>);}--function formatOccurredAt(value: Date | null | undefined) {- if (!value) return "Recently";- return new Intl.DateTimeFormat(undefined, {- hour: "numeric",- minute: "2-digit",- }).format(new Date(value));-}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/RunRow.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/RunRow.tsxdeleted file mode 100644index 836ba38c79..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/RunRow.tsx+++ /dev/null@@ -1,52 +0,0 @@-import NextLink from "next/link";-import type { SitrepItemData } from "@/app/(platform)/library/types";-import { Text } from "@/components/atoms/Text/Text";-import { cn } from "@/lib/utils";-import { buildAskHref, getRunStatus } from "../runHelpers";--interface Props {- run: SitrepItemData;-}--const ACTION_CLASS =- "rounded px-1.5 py-0.5 text-[11px] font-medium text-zinc-500 outline-none transition-colors hover:bg-zinc-100 hover:text-zinc-900 focus-visible:bg-zinc-100";--export function RunRow({ run }: Props) {- const status = getRunStatus(run);- return (- <div className="group flex items-center gap-3 px-4 py-2 transition-colors hover:bg-zinc-50">- <span className="flex w-24 shrink-0 items-center gap-1.5 text-sm font-medium text-zinc-500">- <span- className={cn(- "size-1.5 rounded-full",- status.dot,- status.pulse && "animate-pulse",- )}- aria-hidden="true"- />- {status.label}- </span>- <div className="flex min-w-0 flex-1 items-baseline gap-2">- <Text variant="body-medium" className="shrink-0 truncate text-zinc-900">- {run.agentName}- </Text>- <Text variant="body" className="min-w-0 truncate text-zinc-500">- {run.message}- </Text>- </div>- {/* The actions ride on hover and focus so the rows stay quiet; they- remain in the accessibility tree either way. */}- <div className="flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100">- <NextLink- href={`/library/agents/${run.agentID}`}- className={ACTION_CLASS}- >- See- </NextLink>- <NextLink href={buildAskHref(run)} className={ACTION_CLASS}>- Ask- </NextLink>- </div>- </div>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkGroup.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkGroup.tsxindex 02add8dab9..b085cb5bb4 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkGroup.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkGroup.tsx@@ -1,10 +1,12 @@-import { ArrowUpRight01Icon, Robot01Icon } from "@hugeicons/core-free-icons";+import { ArrowUpRight01Icon } from "@hugeicons/core-free-icons";import Link from "next/link";import type { HomeRecentWorkGroup } from "@/app/api/__generated__/models/homeRecentWorkGroup";import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";-import { ExpertAvatar } from "@/components/molecules/ExpertAvatar/ExpertAvatar";-import { formatWorkTime, getWorkItemIcon } from "../helpers";+import { getActorKindLabel } from "../helpers";+import { ActorMark } from "./ActorMark";+import { OutcomeRow } from "./OutcomeRow";+import { WorkItemRow } from "./WorkItemRow";interface Props {group: HomeRecentWorkGroup;@@ -12,39 +14,22 @@ interface Props {}export function WorkGroup({ group, timezone }: Props) {+ const { actor } = group;+ const runs = group.runs ?? [];+ const items = group.items ?? [];const header = (<div className="flex min-w-0 items-center gap-2">- {group.actor.expert ? (- <ExpertAvatar- name={group.actor.expert.name}- avatarUrl={group.actor.expert.avatar_url}- size={18}- />- ) : (- <span className="flex size-[18px] shrink-0 items-center justify-center rounded-full bg-zinc-100 text-zinc-500">- <Icon icon={Robot01Icon} size={11} aria-hidden="true" />- </span>- )}+ <ActorMark actor={actor} /><Textvariant="body-medium"className="truncate text-[13px] leading-5 text-zinc-900">- {group.actor.name}+ {actor.name}</Text>- {group.session_title ? (- <>- <span className="text-zinc-300" aria-hidden="true">- ·- </span>- <Text- variant="body"- className="truncate text-[13px] leading-5 text-zinc-500"- >- {group.session_title}- </Text>- </>- ) : null}- {group.link ? (+ <span className="shrink-0 rounded-full border border-zinc-200 px-1.5 text-[10px] font-medium uppercase leading-4 tracking-[0.04em] text-zinc-500">+ {getActorKindLabel(actor.kind)}+ </span>+ {actor.link ? (<Iconicon={ArrowUpRight01Icon}size={14}@@ -56,10 +41,10 @@ export function WorkGroup({ group, timezone }: Props) {);return (- <article className="px-4 py-3">- {group.link ? (+ <article className="px-4 py-3" aria-label={actor.name}>+ {actor.link ? (<Link- href={group.link}+ href={actor.link}className="group -mx-1 block rounded px-1 outline-none focus-visible:bg-zinc-50">{header}@@ -67,34 +52,33 @@ export function WorkGroup({ group, timezone }: Props) {) : (header)}- <div className="mt-1.5 flex flex-col gap-1">- {group.items.map((item) => (- <div key={item.id} className="flex items-center gap-2">- <span className="flex size-[18px] shrink-0 items-center justify-center text-zinc-400">- <Icon- icon={getWorkItemIcon(item.category)}- size={13}- aria-hidden="true"- />- </span>- <Text- variant="small"- className="min-w-0 flex-1 truncate text-[13px] leading-5 text-zinc-700"- >- {item.title}- </Text>- <span className="shrink-0 text-[11px] tabular-nums text-zinc-400">- {item.provider ? `${item.provider} · ` : ""}- {formatWorkTime(item.occurred_at, timezone)}- </span>- </div>- ))}- {group.more_count ? (- <Text variant="small" className="pl-[26px] text-[11px] text-zinc-400">- Plus {group.more_count} more- </Text>- ) : null}- </div>+ {runs.length > 0 ? (+ <div className="mt-1 divide-y divide-zinc-100">+ {runs.map((run) => (+ <OutcomeRow+ key={run.id}+ outcome={run}+ timezone={timezone}+ showAgentName={actor.kind === "expert"}+ />+ ))}+ </div>+ ) : null}+ {items.length > 0 ? (+ <div className="mt-1.5 flex flex-col gap-1">+ {items.map((item) => (+ <WorkItemRow key={item.id} item={item} timezone={timezone} />+ ))}+ </div>+ ) : null}+ {group.more_count ? (+ <Text+ variant="small"+ className="mt-1.5 pl-[26px] text-[11px] text-zinc-400"+ >+ Plus {group.more_count} more+ </Text>+ ) : null}</article>);}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkItemRow.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkItemRow.tsxnew file mode 100644index 0000000000..b7a1eee6a5--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkItemRow.tsx@@ -0,0 +1,53 @@+import Link from "next/link";+import type { HomeRecentWorkItem } from "@/app/api/__generated__/models/homeRecentWorkItem";+import { Icon } from "@/components/atoms/Icon/Icon";+import { Text } from "@/components/atoms/Text/Text";+import { cn } from "@/lib/utils";+import { formatWorkTime, getWorkItemIcon } from "../helpers";++interface Props {+ item: HomeRecentWorkItem;+ timezone: string;+}++const ROW_CLASS = "flex items-center gap-2";++export function WorkItemRow({ item, timezone }: Props) {+ const content = (+ <>+ <span className="flex size-[18px] shrink-0 items-center justify-center text-zinc-400">+ <Icon+ icon={getWorkItemIcon(item.category)}+ size={13}+ aria-hidden="true"+ />+ </span>+ <Text+ variant="small"+ className="min-w-0 flex-1 truncate text-[13px] leading-5 text-zinc-700"+ >+ {item.title}+ </Text>+ <span className="shrink-0 text-[11px] tabular-nums text-zinc-400">+ {item.provider ? `${item.provider} · ` : ""}+ {formatWorkTime(item.occurred_at, timezone)}+ </span>+ </>+ );++ if (!item.link) {+ return <div className={ROW_CLASS}>{content}</div>;+ }+ return (+ <Link+ href={item.link}+ title={item.session_title ?? undefined}+ className={cn(+ ROW_CLASS,+ "-mx-1 rounded px-1 outline-none transition-colors hover:bg-zinc-50 focus-visible:bg-zinc-50",+ )}+ >+ {content}+ </Link>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/helpers.tsindex 712e7ed9bf..e1032690bf 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/helpers.ts+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/helpers.ts@@ -1,6 +1,14 @@-import { File01Icon, PlugIcon, RepeatIcon } from "@hugeicons/core-free-icons";+import {+ File01Icon,+ FlowIcon,+ PlugIcon,+ RepeatIcon,+ Robot01Icon,+ SparklesIcon,+} from "@hugeicons/core-free-icons";import type { IconSvgElement } from "@hugeicons/react";import type { HomeRecentWorkItemCategory } from "@/app/api/__generated__/models/homeRecentWorkItemCategory";+import type { HomeWorkActorKind } from "@/app/api/__generated__/models/homeWorkActorKind";export function getWorkItemIcon(category: HomeRecentWorkItemCategory,@@ -10,13 +18,26 @@ export function getWorkItemIcon(return File01Icon;}-// The feed spans up to a week, so unlike the briefing's time-only stamps the-// weekday is load-bearing: "Mon 10:45" vs three files all labelled "10:45".+export function getActorIcon(kind: HomeWorkActorKind): IconSvgElement {+ if (kind === "workflow") return FlowIcon;+ if (kind === "autopilot") return SparklesIcon;+ return Robot01Icon;+}++export function getActorKindLabel(kind: HomeWorkActorKind): string {+ if (kind === "workflow") return "Workflow";+ if (kind === "autopilot") return "Autopilot";+ return "Expert";+}++// The feed spans a week, so the weekday is load-bearing: "Mon 10:45" vs+// three files all labelled "10:45".export function formatWorkTime(- value: Date,+ value: Date | null | undefined,timeZone: string,locale?: string,): string {+ if (!value) return "Recently";return new Intl.DateTimeFormat(locale, {timeZone,weekday: "short",diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/runHelpers.ts b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/runHelpers.tsdeleted file mode 100644index 97a4d7c1a1..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/runHelpers.ts+++ /dev/null@@ -1,49 +0,0 @@-import type { SitrepItemData } from "@/app/(platform)/library/types";--export function buildRunPrompt(run: SitrepItemData): string {- if (run.priority === "success") {- return `${run.agentName} just finished a run — can you summarize what it did?`;- }- switch (run.status) {- case "error":- return `What happened with ${run.agentName}? It has an error — can you check?`;- case "running":- return `Give me a status update on ${run.agentName} — what has it done so far?`;- case "idle":- return `${run.agentName} hasn't run recently. Should I keep it or update and re-run it?`;- default:- return `Tell me about ${run.agentName} — what's its current status?`;- }-}--export function buildAskHref(run: SitrepItemData): string {- return `/copilot?autosubmit=true#prompt=${encodeURIComponent(buildRunPrompt(run))}`;-}--interface RunStatus {- label: string;- dot: string;- pulse: boolean;-}--export function getRunStatus(run: SitrepItemData): RunStatus {- if (run.priority === "success") {- return { label: "Completed", dot: "bg-emerald-500", pulse: false };- }- switch (run.status) {- case "running":- return { label: "Running", dot: "bg-blue-500", pulse: true };- case "error":- return { label: "Error", dot: "bg-red-500", pulse: false };- case "listening":- return { label: "Listening", dot: "bg-purple-500", pulse: true };- case "scheduled":- return { label: "Scheduled", dot: "bg-amber-500", pulse: false };- case "idle":- return { label: "Idle", dot: "bg-zinc-400", pulse: false };- default:- // The union is exhaustive today; a status the feed adds later reads as- // idle rather than crashing the row.- return { label: "Idle", dot: "bg-zinc-400", pulse: false };- }-}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/useOutcomeFilter.ts b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/useOutcomeFilter.tsdeleted file mode 100644index bd5cdbfe42..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/useOutcomeFilter.ts+++ /dev/null@@ -1,41 +0,0 @@-"use client";--import { useState } from "react";-import type { HomeBriefingOutcome } from "@/app/api/__generated__/models/homeBriefingOutcome";--export type OutcomeFilter = "all" | HomeBriefingOutcome["status"];--const FILTER_LABELS: Partial<Record<OutcomeFilter, string>> = {- all: "All",- completed: "Completed",- failed: "Failed",-};--export function useOutcomeFilter({- outcomes,-}: {- outcomes: HomeBriefingOutcome[];-}) {- const [activeFilter, setActiveFilter] = useState<OutcomeFilter>("all");- const filterStatuses = Array.from(- new Set(outcomes.map((outcome) => outcome.status)),- );- const selectedFilter: OutcomeFilter =- activeFilter !== "all" && filterStatuses.includes(activeFilter)- ? activeFilter- : "all";- const visibleOutcomes =- selectedFilter === "all"- ? outcomes- : outcomes.filter((outcome) => outcome.status === selectedFilter);-- return {- filterOptions: (["all", ...filterStatuses] as OutcomeFilter[]).map(- (value) => ({ value, label: FILTER_LABELS[value] ?? value }),- ),- hasFilters: filterStatuses.length > 1,- selectedFilter,- selectFilter: setActiveFilter,- visibleOutcomes,- };-}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/useWorkflowRuns.ts b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/useWorkflowRuns.tsdeleted file mode 100644index 7ac8347573..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/useWorkflowRuns.ts+++ /dev/null@@ -1,19 +0,0 @@-"use client";--import { useSitrepItems } from "@/app/(platform)/library/components/SitrepItem/useSitrepItems";-import { useLibraryAgents } from "@/hooks/useLibraryAgents/useLibraryAgents";--const MAX_RUNS = 5;--/** Each workflow's latest state from the library feed: a recent result, a- * live run, or a trigger it waits on. Scheduled runs are left out because- * Now & next already lists them under Coming up. */-export function useWorkflowRuns() {- const { agents } = useLibraryAgents();- // The feed yields at most one item per agent, so asking for that many- // makes its own cap a no-op: scheduled rows are dropped before the real- // limit applies, and a run of scheduled agents cannot crowd out the rest.- return useSitrepItems(agents, Math.max(agents.length, 1))- .filter((run) => run.status !== "scheduled")- .slice(0, MAX_RUNS);-}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/helpers.test.ts b/autogpt_platform/frontend/src/app/(platform)/home/helpers.test.tsindex a63156616f..e58b4eedbe 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/helpers.test.ts+++ b/autogpt_platform/frontend/src/app/(platform)/home/helpers.test.ts@@ -1,7 +1,6 @@import { describe, expect, it } from "vitest";import type { HomeDashboardResponse } from "@/app/api/__generated__/models/homeDashboardResponse";import {- formatBriefingWindowStart,formatCurrency,formatDuration,formatHeaderDate,@@ -52,16 +51,6 @@ describe("formatters", () => {).toEqual({ weekday: "Monday", calendarDate: "August 10" });});- it("names the start of the briefing window", () => {- expect(- formatBriefingWindowStart(- new Date("2026-08-09T03:30:00Z"),- "Asia/Kolkata",- "en-US",- ),- ).toBe("Sunday 9:00 AM");- });-it("formats measured runtime and cost", () => {expect(formatDuration(18_120)).toBe("5h 2m");expect(formatDuration(120)).toBe("2m");diff --git a/autogpt_platform/frontend/src/app/(platform)/home/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/home/helpers.tsindex bf8f1f31fc..475a49aa71 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/helpers.ts+++ b/autogpt_platform/frontend/src/app/(platform)/home/helpers.ts@@ -42,22 +42,6 @@ export function formatHeaderDate(};}-// The briefing card anchors on the persisted 9am briefing and keeps appending-// runs that finish through the day, so its span is only "the last 24 hours"-// first thing in the morning. Name the actual start instead of a fixed window.-export function formatBriefingWindowStart(- value: Date,- timeZone: string,- locale?: string,-): string {- return new Intl.DateTimeFormat(locale, {- timeZone,- weekday: "long",- hour: "numeric",- minute: "2-digit",- }).format(new Date(value));-}-export function formatDuration(totalSeconds: number): string {const totalMinutes = Math.round(totalSeconds / 60);const hours = Math.floor(totalMinutes / 60);diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.jsonindex 8223ec59a2..effc51e365 100644--- a/autogpt_platform/frontend/src/app/api/openapi.json+++ b/autogpt_platform/frontend/src/app/api/openapi.json@@ -21589,6 +21589,23 @@},"HomeRecentWork": {"properties": {+ "window_started_at": {+ "anyOf": [+ { "type": "string", "format": "date-time" },+ { "type": "null" }+ ],+ "title": "Window Started At"+ },+ "completed_count": {+ "type": "integer",+ "title": "Completed Count",+ "default": 0+ },+ "failed_count": {+ "type": "integer",+ "title": "Failed Count",+ "default": 0+ },"groups": {"items": { "$ref": "#/components/schemas/HomeRecentWorkGroup" },"type": "array",@@ -21606,23 +21623,16 @@"HomeRecentWorkGroup": {"properties": {"actor": { "$ref": "#/components/schemas/HomeWorkActor" },- "session_id": {- "anyOf": [{ "type": "string" }, { "type": "null" }],- "title": "Session Id"- },- "session_title": {- "anyOf": [{ "type": "string" }, { "type": "null" }],- "title": "Session Title"- },- "link": {- "anyOf": [{ "type": "string" }, { "type": "null" }],- "title": "Link"- },"latest_at": {"type": "string","format": "date-time","title": "Latest At"},+ "runs": {+ "items": { "$ref": "#/components/schemas/HomeBriefingOutcome" },+ "type": "array",+ "title": "Runs"+ },"items": {"items": { "$ref": "#/components/schemas/HomeRecentWorkItem" },"type": "array",@@ -21635,8 +21645,9 @@}},"type": "object",- "required": ["actor", "latest_at", "items"],- "title": "HomeRecentWorkGroup"+ "required": ["actor", "latest_at"],+ "title": "HomeRecentWorkGroup",+ "description": "Everything one actor did this week: the runs it finished and the\ndurable things it produced."},"HomeRecentWorkItem": {"properties": {@@ -21664,6 +21675,14 @@"mime_type": {"anyOf": [{ "type": "string" }, { "type": "null" }],"title": "Mime Type"+ },+ "session_title": {+ "anyOf": [{ "type": "string" }, { "type": "null" }],+ "title": "Session Title"+ },+ "link": {+ "anyOf": [{ "type": "string" }, { "type": "null" }],+ "title": "Link"}},"type": "object",@@ -21754,7 +21773,7 @@"properties": {"kind": {"type": "string",- "enum": ["expert", "autopilot", "agent"],+ "enum": ["expert", "workflow", "autopilot"],"title": "Kind"},"name": { "type": "string", "title": "Name" },@@ -21763,6 +21782,10 @@{ "$ref": "#/components/schemas/HomeExpert" },{ "type": "null" }]+ },+ "link": {+ "anyOf": [{ "type": "string" }, { "type": "null" }],+ "title": "Link"}},"type": "object",