Skip to content

Commit f268ba2

Browse files
authored
Merge pull request #71 from UiPath/fix/textual-chat-mode-debug-bridge
fix: auto-resume debug bridge for chat mode in Textual TUI
2 parents 93774b9 + d455020 commit f268ba2

4 files changed

Lines changed: 35 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-dev"
3-
version = "0.0.49"
3+
version = "0.0.50"
44
description = "UiPath Developer Console"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/dev/services/debug_bridge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class TextualDebugBridge:
2020
def __init__(self, mode: ExecutionMode = ExecutionMode.DEBUG):
2121
"""Initialize the debug bridge."""
2222
self._mode = mode
23-
self._auto_resume = mode == ExecutionMode.RUN
23+
self._auto_resume = mode != ExecutionMode.DEBUG
2424
self._connected = False
2525
self._resume_event = asyncio.Event()
2626
self._resume_data: dict[str, Any] | None = None
2727
self._terminate_event = asyncio.Event()
2828
self._breakpoints: list[str] | Literal["*"] = (
29-
[] if mode == ExecutionMode.RUN else "*"
29+
"*" if mode == ExecutionMode.DEBUG else []
3030
)
3131

3232
# Callbacks to UI

tests/e2e/test_textual_run.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import asyncio
77
import json
88

9-
from textual.widgets import Footer, Select
9+
from textual.widgets import Footer, Input, Select
1010

1111
from tests.conftest import ENTRYPOINT_NUMBERS
1212
from uipath.dev.ui.panels import NewRunPanel, RunDetailsPanel, RunHistoryPanel
@@ -171,3 +171,33 @@ async def test_new_run_button(app):
171171

172172
assert "hidden" not in new_panel.classes
173173
assert "hidden" in details.classes
174+
175+
176+
async def test_chat_mode_greeting(app):
177+
"""Start a chat run, send a message, verify it completes without timeout."""
178+
async with app.run_test() as pilot:
179+
await _wait_for_entrypoint(app)
180+
await pilot.pause()
181+
182+
# Set valid JSON input (required for run creation)
183+
json_input = app.query_one("#json-input", JsonInput)
184+
json_input.text = json.dumps({"name": "Tester"})
185+
await pilot.pause()
186+
187+
# Click the Chat button to start a chat-mode run
188+
await pilot.click("#chat-btn")
189+
await pilot.pause()
190+
191+
# Details panel should be visible with chat input focused
192+
details_panel = app.query_one("#details-panel", RunDetailsPanel)
193+
chat_input = details_panel.query_one("#chat-input", Input)
194+
195+
# Type a message and submit
196+
chat_input.value = "Hello there"
197+
await pilot.press("enter")
198+
199+
# Wait for the run to complete (would timeout at 60s if auto-resume is broken)
200+
run = await _wait_for_status(app, "completed")
201+
202+
assert run.output_data is not None
203+
assert "greeting" in run.output_data

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)