meshmonitor icon indicating copy to clipboard operation
meshmonitor copied to clipboard

[FEAT] Automation engine - RUNS - display actual captured messages

Open kokoshell opened this issue 3 months ago • 1 comments

Hi Yeraze,

There is a lot of info in these RUNS log but only date/time/node/channel + the trigger message itself would be enough for debug for humans :)

Best regards, Kokoshell

Image

kokoshell avatar Aug 14 '26 14:08 kokoshell

Triage

Not a duplicate. Classification: Feature Request.

Alignment: The Automation Engine's run-log exists specifically "for stateful debugging" (docs/internal/dev-notes/AUTOMATION_ENGINE_PLAN.md), so making that log actually human-readable is squarely in scope — thanks for the report, and the screenshot made the problem obvious.

Investigation: Good news — the data you're asking for is already captured, this is a display-only gap:

  • RunLog in src/components/automations/AutomationsPage.tsx (~line 415) currently renders only status, sourceId, startedAt, and dumps the full step-by-step engine trace (r.log) as raw <pre> text — which is what you're seeing as "a lot of info."
  • The backend already stores exactly what you asked for, per run, in automation_runs.triggerEvent (src/server/services/automation/automationEngineService.ts) — a JSON snapshot of the trigger context with text (the trigger message), fromName/from (node), channelName (channel), plus startedAt is already returned. GET /api/automations/:id/runs already returns this field; the frontend just isn't reading it yet.

Proposed plan:

  1. Frontend only — extend the local Run interface in AutomationsPage.tsx to include triggerEvent: string | null (already present in the API response, just not typed/consumed).
  2. In RunLog, parse triggerEvent and render a compact one-line summary per run: startedAt (already shown) + node (fromName ?? from) + channel (channelName, omitted for DMs) + trigger text (text, truncated for long messages).
  3. Not every trigger type is message-shaped (telemetry, geofence, becameMobile/leftHome triggers have a different fields shape with no text/fromName). The summary line degrades gracefully — falls back to whatever fields are present, or is simply omitted for non-message triggers rather than showing "undefined."
  4. Move the raw step-by-step log (and raw triggerEvent JSON) behind a collapsed "Details" expander, so the summary is the default view but the full trace is still one click away for power users.
  5. No schema, migration, or route changes required.

I'll hold here per process — let me know if this direction looks right (or if you'd rather see the trigger summary as separate columns instead of one line) and I'll pick up implementation.

-- Authored by Roger 🤓


Generated by Claude Code

Yeraze avatar Aug 14 '26 14:08 Yeraze