[PR #369] Standardize agent activity event payloads and Team Activity timeline UI #334

Open
opened 2026-03-02 23:35:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/369
Author: @AJaySi
Created: 3/2/2026
Status: 🔄 Open

Base: mainHead: codex/create-shared-event-payload-schema


📝 Commits (1)

  • a7bf355 Standardize agent event payloads and team activity timeline UI

📊 Changes

5 files changed (+258 additions, -194 deletions)

View changed files

📝 backend/services/agent_activity_service.py (+72 -3)
📝 backend/services/intelligence/agents/core_agent_framework.py (+11 -11)
📝 backend/services/intelligence/agents/specialized_agents.py (+36 -0)
📝 backend/services/today_workflow_service.py (+4 -4)
📝 frontend/src/components/MainDashboard/components/TeamHuddleWidget.tsx (+135 -176)

📄 Description

Motivation

  • Provide a single shared schema for agent activity events so all agent logging calls emit consistent, structured telemetry (phase, step, tool_name, progress_percent, input/output summaries, decision_reason, evidence_refs, safe_debug, metadata).
  • Make agent lifecycle and workflow events easier to query, render and interpret in the frontend by normalizing payload shape at the service layer.
  • Surface richer, structured agent activity in the Team Activity area so users can inspect run-level timelines and payload details.

Description

  • Added AgentEventPayload dataclass and build_agent_event_payload helper, plus _normalize_event_payload, to the agent activity service to define and normalize a shared event payload shape before persistence (backend/services/agent_activity_service.py).
  • Updated AgentActivityService.log_event to normalize incoming payloads through the shared schema prior to creating AgentEvent records (backend/services/agent_activity_service.py).
  • Replaced ad-hoc payload dicts in the core agent framework with structured calls to build_agent_event_payload for run start, progress, decision, checkpoint, completion and error events (backend/services/intelligence/agents/core_agent_framework.py).
  • Instrumented specialized agents to emit structured progress events via _log_agent_operation using the same payload builder and AgentActivityService (backend/services/intelligence/agents/specialized_agents.py).
  • Updated the Today workflow generation service to emit structured payloads (including evidence_refs) when building grounded plans and handling LLM fallbacks (backend/services/today_workflow_service.py).
  • Reworked the Team Activity frontend widget to load /api/agents/runs and /api/agents/runs/{run_id}/events, rendering runs and expandable timeline entries that expose the shared payload fields (frontend/src/components/MainDashboard/components/TeamHuddleWidget.tsx).

Testing

  • Ran Python compilation checks: python -m py_compile backend/services/agent_activity_service.py backend/services/intelligence/agents/core_agent_framework.py backend/services/intelligence/agents/specialized_agents.py backend/services/today_workflow_service.py which completed successfully.
  • Started the frontend build with npm --prefix frontend run build, which began but did not return a final completion line within this environment session (build process was initiated).
  • Started TypeScript checks with cd frontend && npx tsc --noEmit, which was invoked but did not produce a final completion line within the environment session.
  • Attempted a browser rendering snapshot via the Playwright helper to validate the new widget, but the browser tool timed out and did not produce an artifact.

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/369 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/create-shared-event-payload-schema` --- ### 📝 Commits (1) - [`a7bf355`](https://github.com/AJaySi/ALwrity/commit/a7bf355703ea6f2867fe36401f67e2119430ce37) Standardize agent event payloads and team activity timeline UI ### 📊 Changes **5 files changed** (+258 additions, -194 deletions) <details> <summary>View changed files</summary> 📝 `backend/services/agent_activity_service.py` (+72 -3) 📝 `backend/services/intelligence/agents/core_agent_framework.py` (+11 -11) 📝 `backend/services/intelligence/agents/specialized_agents.py` (+36 -0) 📝 `backend/services/today_workflow_service.py` (+4 -4) 📝 `frontend/src/components/MainDashboard/components/TeamHuddleWidget.tsx` (+135 -176) </details> ### 📄 Description ### Motivation - Provide a single shared schema for agent activity events so all agent logging calls emit consistent, structured telemetry (phase, step, tool_name, progress_percent, input/output summaries, decision_reason, evidence_refs, safe_debug, metadata). - Make agent lifecycle and workflow events easier to query, render and interpret in the frontend by normalizing payload shape at the service layer. - Surface richer, structured agent activity in the Team Activity area so users can inspect run-level timelines and payload details. ### Description - Added `AgentEventPayload` dataclass and `build_agent_event_payload` helper, plus `_normalize_event_payload`, to the agent activity service to define and normalize a shared event payload shape before persistence (`backend/services/agent_activity_service.py`). - Updated `AgentActivityService.log_event` to normalize incoming payloads through the shared schema prior to creating `AgentEvent` records (`backend/services/agent_activity_service.py`). - Replaced ad-hoc payload dicts in the core agent framework with structured calls to `build_agent_event_payload` for run start, progress, decision, checkpoint, completion and error events (`backend/services/intelligence/agents/core_agent_framework.py`). - Instrumented specialized agents to emit structured progress events via `_log_agent_operation` using the same payload builder and `AgentActivityService` (`backend/services/intelligence/agents/specialized_agents.py`). - Updated the Today workflow generation service to emit structured payloads (including `evidence_refs`) when building grounded plans and handling LLM fallbacks (`backend/services/today_workflow_service.py`). - Reworked the Team Activity frontend widget to load `/api/agents/runs` and `/api/agents/runs/{run_id}/events`, rendering runs and expandable timeline entries that expose the shared payload fields (`frontend/src/components/MainDashboard/components/TeamHuddleWidget.tsx`). ### Testing - Ran Python compilation checks: `python -m py_compile backend/services/agent_activity_service.py backend/services/intelligence/agents/core_agent_framework.py backend/services/intelligence/agents/specialized_agents.py backend/services/today_workflow_service.py` which completed successfully. - Started the frontend build with `npm --prefix frontend run build`, which began but did not return a final completion line within this environment session (build process was initiated). - Started TypeScript checks with `cd frontend && npx tsc --noEmit`, which was invoked but did not produce a final completion line within the environment session. - Attempted a browser rendering snapshot via the Playwright helper to validate the new widget, but the browser tool timed out and did not produce an artifact. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69a5b395e4888328b44adc4c26463911) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#334
No description provided.