File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/agentlab/agents/hilt_agent Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 77import bgym
88import numpy as np
99from PIL import Image
10+ import playwright
1011
1112from agentlab .agents .hilt_agent .hint_labelling import (
1213 HintLabeling ,
@@ -114,6 +115,14 @@ def get_action(self, obs):
114115 if self .ui :
115116 self .ui .close ()
116117 raise
118+ except playwright .sync_api .TimeoutError :
119+ # Handle timeout specifically: fall back to first candidate
120+ print ("UI timeout; falling back to first candidate." )
121+ selected_candidate = candidates [0 ]
122+ self .subagent .update_agent_state_from_selected_candidate (selected_candidate )
123+ action = selected_candidate ["action" ]
124+ agent_info = selected_candidate ["agent_info" ]
125+ return action , agent_info
117126 except Exception as e :
118127 print (f"Error in human intervention UI: { e } " )
119128 if self .ui :
You can’t perform that action at this time.
0 commit comments