Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pyob/autoreviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ def get_valid_edit(

if response_text.startswith("ERROR_CODE_429"):
if key:
logger.warning("⚠️ Key hit a 429 rate limit. Timeout 20m.")
self.key_cooldowns[key] = time.time() + 1200
logger.warning("⚠️ Key hit a 429 rate limit. Timeout 2m.")
self.key_cooldowns[key] = time.time() + 120
time.sleep(60)
attempts += 1
continue
Expand Down
4 changes: 3 additions & 1 deletion src/pyob/entrance.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,10 @@ def update_ledger_for_file(self, rel_path: str, code: str):
except Exception as e:
logger.warning(f"Failed to parse Python AST for {rel_path}: {e}")
elif ext in [".js", ".ts"]:
# Improved regex to capture more JS/TS definition patterns, including export/async modifiers
defs = re.findall(
r"(?:function|class|const|var|let)\s+([a-zA-Z0-9_$]+)", code
r"(?:export\s+|async\s+)?(?:function\*?|class|const|var|let)\s+([a-zA-Z0-9_$]+)",
code,
)
for d in defs:
if len(d) > 3:
Expand Down
Loading