Skip to content

greploop: unbounded while true polling loops can hang indefinitely #14

@hbridge

Description

@hbridge

Hi! Flagging a real correctness issue in greploop/SKILL.md.

The issue

The skill's inner polling loops (around line 120 for GitHub check-runs and line 169 for GitLab pipeline detection) are while true with no timeout or max-attempts guard. If Greptile is disabled, the webhook never fires, or the check run never appears on the commit, the agent will spin indefinitely. The outer 5-iteration cap only guards the fix-review cycle, not these inner waits.

How we found it

We were vendoring greptileai/skills into our repo as a thirdparty-greptile plugin. The Greptile bot reviewed our PR and flagged this in its own vendored SKILL.md as a P1 — pretty fun ouroboros moment, and the catch looks legitimate. Original comment for reference

Suggested fix

A simple counter inside each loop would prevent the hang, e.g.:

ATTEMPTS=0
MAX_ATTEMPTS=60   # ~10 min at 10s sleeps
while true; do
  ATTEMPTS=$((ATTEMPTS + 1))
  if [ $ATTEMPTS -gt $MAX_ATTEMPTS ]; then
    echo "Timed out waiting for Greptile check run"
    break
  fi
  # ...existing poll body...
done

Happy to send a PR if helpful — let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions