Skip to content

Sandbox run: drop the undefined log_line_buffer - #109

Open
kayaal34 wants to merge 1 commit into
ComputerUseAgent:mainfrom
kayaal34:fix-run-output-drain
Open

kayaal34 wants to merge 1 commit into
ComputerUseAgent:mainfrom
kayaal34:fix-run-output-drain

Conversation

@kayaal34

@kayaal34 kayaal34 commented Nov 9, 2026

Copy link
Copy Markdown

In Sandbox.run (AutoCua/windows/sandbox/service.py), when the process has exited, the loop that collects the remaining stdout also does log_line_buffer += char. log_line_buffer is never defined, so whenever output was still queued at exit, the NameError was caught by the outer except and a finished command came back as {"success": False, "error": "name 'log_line_buffer' is not defined"}, losing its output and return code. The variable is not used anywhere else, so this removes the line.

How I tested it

ruff check --select F821 is clean on the file. I did not run the Windows sandbox.

I used Claude (an AI assistant) to help with this change; I reviewed it and ran the check above.

Draining stdout after the process exits appended to log_line_buffer, which is never defined, so any leftover output turned a finished command into {'success': False, 'error': "name 'log_line_buffer' is not defined"}.
@FunctionFreak

Copy link
Copy Markdown
Contributor

Hi @kayaal34
Thanks for contribution, means alot!!!
i will quickly check the files as soon as i get the time!!

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

Successfully merging this pull request may close these issues.

2 participants