Skip to content

Add support for Debug Log Context #137

@Steve-Mcl

Description

@Steve-Mcl

Description

The frontend is ready to support inclusion of debug logs in context for enhanced contextual data for the AI to help users figure out why a flow is not doing what is expected.

This issue is to add a means of providing the debug log entries to FlowFuse.

The current implementation in FlowFuse/flowfuse#6631 accepts lots to be passed via the postParent message type debug-log-entry and expects the log entry to be shaped as follows...

            const normalisedLogEntry = {
                timestamp: entry.timestamp || Date.now(),
                source: {
                    id: sourceId,
                    type: sourceType,
                    name: entry._source?.name || entry.name,
                    z: entry._source?.z || entry.z
                },
                message: {
                    level,
                    property,
                    format: entry.format || '',
                    msg: entry.msg,
                    topic: entry.topic
                }
            }

            this.postParent({
                type: 'debug-log-entry',
                entry: normalisedLogEntry
            })

And the data can be picked up from Node-RED comms channel e.g:

RED.comms.subscribe('debug', sendDebugLogEntry)

NOTES

  • This works, but it is not ideal. Users can filter the debug panel (for a cleaner view) but the last logs sent may not be the one the user is interested in.
    • ideally, we would tap into the debug log panel and offer an 📎button (on hover) over the debug entries they want to include in context - thereby including exactly what they expect
  • We should provide a means clearing logs in the vuex store from within Node-RED (i.e. when the user clicks "clear" button
    • however node-red does not emit this event so we would have to attach to the dom element

Epic/Story

No response

Sub-issues

Metadata

Metadata

Labels

area:ff-expertFlowFuse AI AssistantdesignRequires Graphic/UI/UX Design worktaskA piece of work that isn't necessarily tied to a specific Epic or Story.time:TBD

Type

No type

Projects

Status

Todo

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions