Skip to content
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

Fix non-snappy execution update on UI #8392

Open
linear bot opened this issue Oct 22, 2024 · 5 comments
Open

Fix non-snappy execution update on UI #8392

linear bot opened this issue Oct 22, 2024 · 5 comments

Comments

@linear
Copy link

linear bot commented Oct 22, 2024

While transitioning from polling to web socket, the granularity of execution updates was significantly reduced from "updating on each produced output from node" to "updating on each node execution completion" (1 node execution can produce many outputs from different pins, through a long time).

This gives a really bad user experience on executing a long-running block, especially when running an agent/graph as a node will be introduced very soon.

@Abhi1992002
Copy link
Contributor

@aarushik93 @ntindle @majdyz

I’m not sure if I understood this issue correctly, If I am wrong please correct me:

Suppose we have 3 inputs connected to one output node. The output node will generate 3 responses, one for each input pin. Currently, the output node waits for all three inputs to finish executing, and only after all of them have completed, it shows the final output (UI).

However, what we need is for the output node to display each pin's output as soon as it is available (with the status marked as 'running'). Then, once all the outputs are completed, the status should change to 'completed'.

@majdyz
Copy link
Contributor

majdyz commented Oct 24, 2024

@Abhi1992002 That is correct. Currently we are only updating on status transition, Queued -> Running -> Completed/Failed. See the usage of db_client.send_execution_update in manager.py. That is the function used for publishing the whole node execution result as an event, where event_broadcaster in ws_api.py subscribe and propagate that information to the client through the websocket.

Some modification on data being published through a websocket, or the client code for handling its data, might also be needed to achieve this, so that we can avoid showing duplicated output data.

@Abhi1992002
Copy link
Contributor

@majdyz Just to clarify, should I make the changes to the backend so it broadcasts each pin’s execution update, or should I wait for the backend team to handle that functionality, and then I’ll update the UI accordingly?

@majdyz
Copy link
Contributor

majdyz commented Oct 24, 2024

I think the backend change will only be these two lines of code:
https://github.com/Significant-Gravitas/AutoGPT/pull/8421/files#diff-1b278ebf10a9da0fb5030010222b3a6df2b05a5463cad428cd6c38a1541b0f73R176-R177

But introducing this will make the UI duplicate output because the output entry, on each production we publish the whole data, not the incremental ones:

image

You can see for the same node execution the output will be duplicated, e.g:
[1]
[1,2]
[1,2,3]
[1,2,3,4]
[1,2,3,4,5]
Instead of entire replace the content for that execution.

You can fork the shared branch (#8421), and test the StepThroughItem block with a hard-coded list value to reproduce the issue:

image

@Torantulino
Copy link
Member

What's the status of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants