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

Code execution never comes back #1525

Open
guiramos opened this issue Nov 7, 2024 · 0 comments
Open

Code execution never comes back #1525

guiramos opened this issue Nov 7, 2024 · 0 comments

Comments

@guiramos
Copy link

guiramos commented Nov 7, 2024

Describe the bug

I am trying to have my python project execute code dynamically via OI and every time it tries to run some shell script as described below, it never comes back. It gets stuck inside the method for line in interpreter.computer.run(language, code, stream=True):

This is the description generated.

  1. First, I'll use SSH to connect to the server and run the disk usage command:
    Code:
    ssh -i /root/blabla.pem [email protected] "df -h"

Filesystem Size Used Avail Use% Mounted on
tmpfs 778M 2.0M 776M 1% /run
/dev/sda2 440G 37G 380G 9% /
tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 778M 4.0K 778M 1% /run/user/1000

I think it gets stuck inside this loop because self.done never gets set.

        while True:
            if not self.output_queue.empty():
                yield self.output_queue.get()
            else:
                time.sleep(0.1)
            try:
                output = self.output_queue.get(timeout=0.3)  # Waits for 0.3 seconds
                yield output
            except queue.Empty:
                if self.done.is_set():
                    # Try to yank 3 more times from it... maybe there's something in there...
                    # (I don't know if this actually helps. Maybe we just need to yank 1 more time)
                    for _ in range(3):
                        if not self.output_queue.empty():
                            yield self.output_queue.get()
                        time.sleep(0.2)
                    break
                    

I am using version open-interpreter = "^0.4.3"

Can you please advise?

Reproduce

I am something like this:

for chunk in interpreter.chat(
f"{task_description}\n\n",
stream=True,
display=False
):

print out the chunks

Expected behavior

I would expect it to return, get out of the method.

Screenshots

No response

Open Interpreter version

0.4.3

Python version

3.11.5

Operating System name and version

mac 14

Additional context

No response

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

1 participant