diff --git a/pentestagent/interface/tui.py b/pentestagent/interface/tui.py index 2840fea..7555a66 100644 --- a/pentestagent/interface/tui.py +++ b/pentestagent/interface/tui.py @@ -1794,7 +1794,12 @@ class PentestAgentTUI(App): first = scroll.children[0] if scroll.children else None msg = SystemMessage(f" Target: {target}") if first: - scroll.mount_before(msg, first) + # Textual's ScrollableContainer may not implement + # mount_before across versions; fall back to mount. + try: + scroll.mount_before(msg, first) + except Exception: + scroll.mount(msg) else: scroll.mount(msg) except Exception as e: @@ -2419,7 +2424,10 @@ Be concise. Use the actual data from notes.""" first = scroll.children[0] if scroll.children else None msg = SystemMessage(f" Target: {target}") if first: - scroll.mount_before(msg, first) + try: + scroll.mount_before(msg, first) + except Exception: + scroll.mount(msg) else: scroll.mount(msg) except Exception: