mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-18 02:11:59 -05:00
fix(telemetry): updated telemetry, added nested sanitization, added granular trace spans for logs and updated UI (#1627)
* feat(logs): updated telemetry, added nested sanitization, added granular trace spans for logs and updated UI * refactor trace spans into separate components * remove any's from tool defs * updated UI and overlayed spans * cleanup * ack PR comments * stricter type safety * clean
This commit is contained in:
@@ -242,6 +242,7 @@ export class Executor {
|
||||
): Promise<ExecutionResult | StreamingExecution> {
|
||||
const { setIsExecuting, setIsDebugging, setPendingBlocks, reset } = useExecutionStore.getState()
|
||||
const startTime = new Date()
|
||||
const executorStartMs = startTime.getTime()
|
||||
let finalOutput: NormalizedBlockOutput = {}
|
||||
|
||||
// Track workflow execution start
|
||||
@@ -252,7 +253,9 @@ export class Executor {
|
||||
startTime: startTime.toISOString(),
|
||||
})
|
||||
|
||||
const beforeValidation = Date.now()
|
||||
this.validateWorkflow(startBlockId)
|
||||
const validationTime = Date.now() - beforeValidation
|
||||
|
||||
const context = this.createExecutionContext(workflowId, startTime, startBlockId)
|
||||
|
||||
@@ -268,10 +271,13 @@ export class Executor {
|
||||
|
||||
let hasMoreLayers = true
|
||||
let iteration = 0
|
||||
const firstBlockExecutionTime: number | null = null
|
||||
const maxIterations = 500 // Safety limit for infinite loops
|
||||
|
||||
while (hasMoreLayers && iteration < maxIterations && !this.isCancelled) {
|
||||
const iterationStart = Date.now()
|
||||
const nextLayer = this.getNextExecutionLayer(context)
|
||||
const getNextLayerTime = Date.now() - iterationStart
|
||||
|
||||
if (this.isDebugging) {
|
||||
// In debug mode, update the pending blocks and wait for user interaction
|
||||
@@ -405,6 +411,7 @@ export class Executor {
|
||||
if (normalizedOutputs.length > 0) {
|
||||
finalOutput = normalizedOutputs[normalizedOutputs.length - 1]
|
||||
}
|
||||
|
||||
// Process loop iterations - this will activate external paths when loops complete
|
||||
await this.loopManager.processLoopIterations(context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user