Almenon / Almenon/AREPL-vscode

AREPL completely freezes when evaluating a while loop in Antigravity

未关闭
#550 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
301
派生
46
PR 合并指标
30 天内没有已合并 PR

描述

Describe the bug

AREPL completely freezes when it tries to run Python code containing a while loop.

I use AREPL because I rely on its live execution while learning Python and DSA. Normally, I can write code and immediately see the result or catch an error. However, when I use a while loop, AREPL sometimes stops responding completely.

For example, I was working with this binary tree code. The code works when I use a for loop, but when I replace that loop with a while loop, AREPL freezes and does not show any output or error.

The problem is not limited to the while loop itself. Once AREPL freezes, closing and reopening AREPL does not fix it. It remains stuck and does nothing. I have to completely close Antigravity and open it again before AREPL starts working normally.

This makes it very difficult to use AREPL for learning because I have to restart my entire editor whenever this happens.

To Reproduce
Open a Python file in Antigravity with AREPL enabled.
Add the following code:
value = [4, 2, 7, 1, 3, 6, 9]

from collections import deque

class Node:
def __init__(self, value):
self.val = value
self.left = None
self.right = None

root = Node(value[0])
queue = deque([root])
i = 1

while i < len(value):
current = queue.popleft()

current.left = Node(value[i])
queue.append(current.left)
i += 1

if i < len(value):
current.right = Node(value[i])
queue.append(current.right)
i += 1

def printTree(root):
if not root:
return 0

q = deque([root])

while q:
node = q.popleft()
print(node.val, end=" ")

if node.left:
q.append(node.left)

if node.right:
q.append(node.right)

print(printTree(root))
Let AREPL evaluate the code.
AREPL freezes and does not produce an output or error.
Close AREPL and open it again.
AREPL is still stuck and does not start working.
Close Antigravity completely and open it again.
AREPL starts working again.

If the while loop in the tree construction is replaced with a for loop, the code runs normally.

Expected behavior

AREPL should either run the code normally or show an error if something is wrong.

If the code takes too long to execute or appears to be stuck in a loop, AREPL should stop the execution or show that the evaluation is still running instead of freezing the entire AREPL session.

Restarting AREPL should also restore it without requiring the entire Antigravity editor to be restarted.

Screenshots

I can provide screenshots or a screen recording showing AREPL becoming unresponsive if needed.

Other Information

OS: Windows 11

Python Version: Python 3.x

Editor: Antigravity

Extension: AREPL

Additional context

I am using AREPL specifically because the live feedback is very useful while learning Python and DSA. It lets me see mistakes immediately while I am writing code and helps me understand what went wrong.

The problem is especially noticeable with while loops. A while loop that is still being written can cause AREPL to freeze, but in some cases even a complete piece of code can cause the same problem.

The biggest issue is that after AREPL freezes, reopening the AREPL window does not fix it. I have to completely restart Antigravity before I can use AREPL again.

This makes the issue much more disruptive than a normal execution error.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。