fix(vwb): Supprimer debug /tmp et corriger import UIElement

- Supprimer le bloc debug qui écrivait dans /tmp/vwb_debug.log
- Corriger l'import UIElement (core.models.ui_element au lieu de
  screen_state) — supprime le warning au démarrage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dom
2026-02-17 10:58:14 +01:00
parent 75260e3254
commit 2cb53901a1
2 changed files with 2 additions and 15 deletions

View File

@@ -238,20 +238,6 @@ def execute_workflow_step():
step_type = data.get('stepType', 'click_anchor') step_type = data.get('stepType', 'click_anchor')
parameters = data.get('parameters', {}) parameters = data.get('parameters', {})
# DEBUG: Écrire les données reçues dans un fichier
import json as json_module
with open('/tmp/vwb_debug.log', 'a') as debug_file:
debug_file.write(f"\n{'='*60}\n")
debug_file.write(f"[execute-step] stepType={step_type}, stepId={step_id}\n")
debug_file.write(f"[execute-step] parameters keys: {list(parameters.keys())}\n")
if 'visual_anchor' in parameters:
va = parameters['visual_anchor']
debug_file.write(f"[execute-step] visual_anchor keys: {list(va.keys()) if va else 'None'}\n")
debug_file.write(f"[execute-step] visual_anchor.id: {va.get('id')}\n")
debug_file.write(f"[execute-step] visual_anchor.thumbnail_url: {va.get('thumbnail_url') or (va.get('metadata', {}) or {}).get('thumbnail_url')}\n")
debug_file.write(f"[execute-step] FULL visual_anchor: {json_module.dumps(va, default=str)[:500]}\n")
debug_file.flush()
# Convert to catalog execute format # Convert to catalog execute format
catalog_request = { catalog_request = {
'type': step_type, 'type': step_type,

View File

@@ -36,7 +36,8 @@ except ImportError as e:
UIDetector = None UIDetector = None
try: try:
from core.models.screen_state import ScreenState, UIElement from core.models.screen_state import ScreenState
from core.models.ui_element import UIElement
SCREEN_STATE_AVAILABLE = True SCREEN_STATE_AVAILABLE = True
except ImportError as e: except ImportError as e:
print(f"Warning: ScreenState non disponible: {e}") print(f"Warning: ScreenState non disponible: {e}")