Skip to content
This repository was archived by the owner on Mar 30, 2026. It is now read-only.
This repository was archived by the owner on Mar 30, 2026. It is now read-only.

Bug: iTerm AppleScript TUI scan times out and crashes watcher loop with many sessions #547

@Delqhi

Description

@Delqhi

Symptom

Watcher log repeatedly showed:

Loop error: Command ['osascript', ...] timed out after 10 seconds

When many iTerm windows/tabs were open, the TUI scan path kept failing every poll cycle.

Root Cause

watcher_tui_scan.py used subprocess.run(..., timeout=10) without handling subprocess.TimeoutExpired. AppleScript enumeration of many iTerm sessions regularly took more than 10s, so the exception propagated into the watcher loop.

Fix

  • Increased AppleScript timeout from 10s to 25s
  • Wrapped the call in try/except subprocess.TimeoutExpired
  • On timeout, return an empty session list instead of crashing the loop

Commit: 04b77cc
File: antigravity/core/watcher_tui_scan.py

Verification

After restarting the watcher with the patched code:

  • no more repeated Loop error ... timed out after 10 seconds
  • watcher continued normal 8s polling cycles
  • later the same TUI scanner successfully detected a live quota message and triggered rotation at 07:27:41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions