ready for user test 1.01

This commit is contained in:
ValueOn AG 2025-09-02 01:07:11 +02:00
parent 237d9b5752
commit 0e034e253d
2 changed files with 8 additions and 19 deletions

View file

@ -1153,23 +1153,11 @@ Please provide a comprehensive summary of this conversation."""
return {'currentRound': 0, 'currentTask': 0, 'currentAction': 0} return {'currentRound': 0, 'currentTask': 0, 'currentAction': 0}
def incrementWorkflowContext(self, context_type: str): def incrementWorkflowContext(self, context_type: str):
"""Increment workflow context counters""" """Increment workflow context counters (task and action only - rounds handled in interface layer)"""
try: try:
update_data = {} update_data = {}
if context_type == 'round': if context_type == 'task':
current_round = self.workflow.currentRound if hasattr(self.workflow, 'currentRound') else 0
self.workflow.currentRound = current_round + 1
# Reset task and action when round changes
self.workflow.currentTask = 0
self.workflow.currentAction = 0
update_data = {
"currentRound": self.workflow.currentRound,
"currentTask": 0,
"currentAction": 0
}
logger.info(f"Incremented workflow round to {self.workflow.currentRound}")
elif context_type == 'task':
current_task = self.workflow.currentTask if hasattr(self.workflow, 'currentTask') else 0 current_task = self.workflow.currentTask if hasattr(self.workflow, 'currentTask') else 0
self.workflow.currentTask = current_task + 1 self.workflow.currentTask = current_task + 1
# Reset action when task changes # Reset action when task changes

View file

@ -872,7 +872,7 @@ class ChatObjects:
# Wait a moment for any running processes to detect the stop # Wait a moment for any running processes to detect the stop
await asyncio.sleep(0.1) await asyncio.sleep(0.1)
# Update workflow - set status back to running for resumed workflows # Update workflow - increment round for existing workflows
newRound = workflow.currentRound + 1 newRound = workflow.currentRound + 1
self.updateWorkflow(workflowId, { self.updateWorkflow(workflowId, {
"status": "running", # Set status back to running for resumed workflows "status": "running", # Set status back to running for resumed workflows
@ -880,14 +880,15 @@ class ChatObjects:
"currentRound": newRound "currentRound": newRound
}) })
# Update the workflow object status and round number as well # Reload workflow object to get updated currentRound from database
workflow.status = "running" workflow = self.loadWorkflowState(workflowId)
workflow.currentRound = newRound if not workflow:
raise ValueError(f"Failed to reload workflow {workflowId} after update")
# Add log entry for workflow resumption # Add log entry for workflow resumption
self.createWorkflowLog({ self.createWorkflowLog({
"workflowId": workflowId, "workflowId": workflowId,
"message": f"Workflow resumed (round {workflow.currentRound + 1})", "message": f"Workflow resumed (round {workflow.currentRound})",
"type": "info", "type": "info",
"status": "running", "status": "running",
"progress": 0 "progress": 0