Add observability for LLM topic context inclusion (#1038)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com> Co-authored-by: Thomas Nordquist <thomasnordquist@users.noreply.github.com>
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
// Auto-connect handler for browser mode
|
||||
// This file is loaded early in the app initialization to handle server-initiated auto-connect
|
||||
|
||||
import { store } from './store'
|
||||
import * as q from '../../backend/src/Model'
|
||||
import { DataSourceState } from 'mqtt-explorer-backend/src/DataSource/DataSource'
|
||||
import { store } from './store'
|
||||
import { TopicViewModel } from './model/TopicViewModel'
|
||||
import { showTree } from './actions/Tree'
|
||||
import { connecting, connected } from './actions/Connection'
|
||||
import { makeConnectionStateEvent, rendererEvents } from './eventBus'
|
||||
import { DataSourceState } from '../../backend/src/DataSource'
|
||||
|
||||
// Listen for auto-connect-initiated event from server
|
||||
if (typeof window !== 'undefined') {
|
||||
window.addEventListener('mqtt-auto-connect-initiated', ((event: CustomEvent) => {
|
||||
const { connectionId } = event.detail
|
||||
console.log('Auto-connect initiated from server, connectionId:', connectionId)
|
||||
|
||||
|
||||
// Dispatch connecting action
|
||||
store.dispatch(connecting(connectionId) as any)
|
||||
console.log('Dispatched connecting action')
|
||||
|
||||
|
||||
// Subscribe to connection state events
|
||||
const stateEvent = makeConnectionStateEvent(connectionId)
|
||||
console.log('Subscribing to connection state event:', stateEvent)
|
||||
|
||||
|
||||
rendererEvents.subscribe(stateEvent, (dataSourceState: DataSourceState) => {
|
||||
console.log('Auto-connect state update:', JSON.stringify(dataSourceState, null, 2))
|
||||
|
||||
|
||||
if (dataSourceState.connected) {
|
||||
console.log('Auto-connect: connection established!')
|
||||
const state = store.getState()
|
||||
|
||||
Reference in New Issue
Block a user