fix(test): Final synchronization and stability fixes for RAG stress test
- Improved AppController.ai_status to prevent overwriting 'sending...' with 'models loaded'. - Enhanced est_rag_phase4_stress.py with robust polling and increased timeout. - Synchronized App and AppController history objects to ensure consistent view.
This commit is contained in:
+8
-32
@@ -380,35 +380,11 @@ class App:
|
||||
def __getattr__(self, name: str) -> Any:
|
||||
if name == 'controller':
|
||||
raise AttributeError(name)
|
||||
try:
|
||||
ctrl = object.__getattribute__(self, 'controller')
|
||||
except AttributeError:
|
||||
raise AttributeError(name)
|
||||
|
||||
if ctrl is not None:
|
||||
try:
|
||||
val = getattr(ctrl, name)
|
||||
sys.stderr.write(f"[DEBUG __getattr__] name={name}, val_type={type(val).__name__}\n")
|
||||
sys.stderr.flush()
|
||||
return val
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
|
||||
return getattr(self.controller, name)
|
||||
|
||||
def __setattr__(self, name: str, value: Any) -> None:
|
||||
if name == 'controller':
|
||||
object.__setattr__(self, name, value)
|
||||
return
|
||||
|
||||
try:
|
||||
# Use object.__getattribute__ to avoid recursion
|
||||
ctrl = object.__getattribute__(self, 'controller')
|
||||
except AttributeError:
|
||||
ctrl = None
|
||||
|
||||
if ctrl is not None and hasattr(ctrl, name):
|
||||
setattr(ctrl, name, value)
|
||||
if name != 'controller' and hasattr(self, 'controller') and hasattr(self.controller, name):
|
||||
setattr(self.controller, name, value)
|
||||
else:
|
||||
object.__setattr__(self, name, value)
|
||||
|
||||
@@ -696,7 +672,7 @@ class App:
|
||||
|
||||
if show_content:
|
||||
h = 150 if is_standalone else 100
|
||||
with imscope.child(f"thinking_content_{entry_index}", imgui.ImVec2(0, h), True):
|
||||
with imscope.child(f"thinking_content_{entry_index}", 0, h, True):
|
||||
for idx, seg in enumerate(segments):
|
||||
content = seg.get("content", "")
|
||||
marker = seg.get("marker", "thinking")
|
||||
@@ -1014,7 +990,7 @@ class App:
|
||||
imgui.same_line()
|
||||
if imgui.button("Redo") and self.history.can_redo: self._handle_redo()
|
||||
imgui.separator()
|
||||
with imscope.child("history_list", imgui.ImVec2(0, 0), True):
|
||||
with imscope.child("history_list", 0, 0, True):
|
||||
history = self.history.get_history()
|
||||
if not history: imgui.text("No history available.")
|
||||
else: iterate_history()
|
||||
@@ -2558,7 +2534,7 @@ class App:
|
||||
if not hasattr(self, 'files_screenshots_split'): self.files_screenshots_split = 0.65
|
||||
split_y = int(avail * self.files_screenshots_split)
|
||||
if imgui.collapsing_header("Files", imgui.TreeNodeFlags_.default_open):
|
||||
with imscope.child("Files_child", imgui.ImVec2(-1, split_y), True):
|
||||
with imscope.child("Files_child", -1, split_y, True):
|
||||
if not hasattr(self, 'files_last_selected'): self.files_last_selected = -1
|
||||
|
||||
with imscope.table("files_table", 5, imgui.TableFlags_.resizable | imgui.TableFlags_.borders):
|
||||
@@ -2647,7 +2623,7 @@ class App:
|
||||
imgui.separator()
|
||||
|
||||
if imgui.collapsing_header("Screenshots", imgui.TreeNodeFlags_.default_open):
|
||||
with imscope.child("Shots_child", imgui.ImVec2(-1, -1), True):
|
||||
with imscope.child("Shots_child", -1, -1, True):
|
||||
for i, s in enumerate(self.screenshots):
|
||||
if imgui.button(f"x##s{i}"):
|
||||
self.screenshots.pop(i)
|
||||
@@ -3751,7 +3727,7 @@ class App:
|
||||
|
||||
with imscope.style_color(imgui.Col_.frame_bg, blink_color) if is_blinking else nullcontext():
|
||||
with imscope.style_color(imgui.Col_.child_bg, blink_color) if is_blinking else nullcontext():
|
||||
with imscope.child("response_scroll_area", imgui.ImVec2(0, -40), True):
|
||||
with imscope.child("response_scroll_area", 0, -40, True):
|
||||
with theme.ai_text_style():
|
||||
segments, parsed_response = thinking_parser.parse_thinking_trace(self.ai_response)
|
||||
if segments:
|
||||
|
||||
Reference in New Issue
Block a user