-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(webui-v2): remove duplicate chat logs header #5491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4526d99
fix(webui-v2): avoid duplicate logs header during chat runs
italic-jinxin 34d247c
fix(webui-v2): hide chat run logs shortcut
italic-jinxin adf256e
test(webui-v2): remove redundant chat logs assertion
italic-jinxin c0ba4ab
Merge branch 'main' into fix-chat-duplicate-logs-header
italic-jinxin c8101d7
fix(webui-v2): move chat logs link into message actions
italic-jinxin 3d9d9d1
fix(webui-v2): float chat logs shortcut
italic-jinxin 369f7f7
fix(webui-v2): use terminal icon for chat logs shortcut
italic-jinxin 080216b
fix(webui-v2): reserve chat logs space with spacer
italic-jinxin e98997d
style(webui-v2): soften floating logs shortcut
italic-jinxin e873abc
style(webui-v2): increase chat logs shortcut contrast
italic-jinxin 0951ada
Merge branch 'main' into fix-chat-duplicate-logs-header
italic-jinxin 40a2a25
Merge branch 'main' into fix-chat-duplicate-logs-header
italic-jinxin 6742cfc
fix(webui-v2): reuse scoped logs path builder
italic-jinxin ed044ce
test(e2e): handle busy reborn sends before settling
italic-jinxin b116168
fix(webui-v2): keep chat logs route construction in chat
italic-jinxin e2c65b6
Merge branch 'main' into fix-chat-duplicate-logs-header
italic-jinxin 0d27c42
Merge branch 'main' into fix-chat-duplicate-logs-header
italic-jinxin ddb407f
test(e2e): retry transient submit errors while settling
italic-jinxin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| YOLO_PROFILE = "local-dev-yolo" | ||
| DEFAULT_MODEL = "mock-model" | ||
| VISION_MODEL = "gpt-4o" | ||
| ACCEPTED_SEND_OUTCOMES = {"submitted", "already_submitted"} | ||
|
|
||
|
|
||
| def find_free_port() -> int: | ||
|
|
@@ -383,15 +384,27 @@ async def create_thread(client: httpx.AsyncClient, base_url: str) -> str: | |
| return response.json()["thread"]["thread_id"] | ||
|
|
||
|
|
||
| async def send_message( | ||
| async def _submit_message( | ||
| client: httpx.AsyncClient, base_url: str, thread_id: str, content: str | ||
| ) -> None: | ||
| ) -> dict: | ||
| response = await client.post( | ||
| f"{base_url}/api/webchat/v2/threads/{thread_id}/messages", | ||
| json={"client_action_id": client_action_id(), "content": content}, | ||
| timeout=30, | ||
| ) | ||
| assert response.status_code in (200, 202), response.text | ||
| return response.json() | ||
|
|
||
|
|
||
| async def send_message( | ||
| client: httpx.AsyncClient, base_url: str, thread_id: str, content: str | ||
| ) -> dict: | ||
| body = await _submit_message(client, base_url, thread_id, content) | ||
| outcome = body.get("outcome") | ||
| assert outcome in ACCEPTED_SEND_OUTCOMES, ( | ||
| f"Message was not accepted for a run; outcome={outcome!r}, body={body}" | ||
| ) | ||
| return body | ||
|
|
||
|
|
||
| async def fetch_timeline(client: httpx.AsyncClient, base_url: str, thread_id: str) -> dict: | ||
|
|
@@ -453,7 +466,31 @@ async def send_and_settle( | |
| expected: int, | ||
| ) -> None: | ||
| """Send a text turn and wait until ``expected`` assistant replies finalize.""" | ||
| await send_message(client, base_url, thread_id, content) | ||
| submit_body: dict = {} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to change this function?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| last_submit_error = None | ||
| for _ in range(12): | ||
| try: | ||
| submit_body = await _submit_message(client, base_url, thread_id, content) | ||
| last_submit_error = None | ||
| except httpx.HTTPError as error: | ||
| last_submit_error = error | ||
| await asyncio.sleep(0.5) | ||
| continue | ||
| outcome = submit_body.get("outcome") | ||
| if outcome in ACCEPTED_SEND_OUTCOMES: | ||
| break | ||
| if outcome == "rejected_busy": | ||
| await asyncio.sleep(0.5) | ||
| continue | ||
| raise AssertionError( | ||
| f"Message was not accepted for a run; outcome={outcome!r}, body={submit_body}" | ||
| ) | ||
| else: | ||
| raise AssertionError( | ||
| f"Thread {thread_id} remained busy before accepting a new turn; " | ||
| f"last submit response: {submit_body}; last submit error: {last_submit_error!r}" | ||
| ) | ||
|
|
||
|
italic-jinxin marked this conversation as resolved.
|
||
| for _ in range(90): | ||
| try: | ||
| timeline = await fetch_timeline(client, base_url, thread_id) | ||
|
|
@@ -464,5 +501,6 @@ async def send_and_settle( | |
| return | ||
| await asyncio.sleep(0.5) | ||
| raise AssertionError( | ||
| f"Thread {thread_id} did not reach {expected} finalized assistant replies" | ||
| f"Thread {thread_id} did not reach {expected} finalized assistant replies; " | ||
| f"submit response: {submit_body}" | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this floating logs button at right bottom corner?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there were duplicate logs at the top before. That was because the Logs button that only appears during chat was linking to the thread log. Moved it to the bottom and changed it into a floating button.
Another option is to show the Log button under each message, together with the Copy button.