Skip to content

bug: pulse-wrapper silently fails to dispatch when gh CLI <2.51.0 — scripts use --slurp causing 'unknown flag' loop, framework lacks gh minimum version prerequisite check #23427

Description

@superdav42

Description

Pulse dispatch silently stalls when gh CLI is older than v2.51.0. Multiple aidevops scripts call gh api --paginate --slurp ..., but the --slurp flag was added in gh 2.51.0 (April 2024). On older gh versions, every such call emits unknown flag: --slurp and fails closed.

On Ubuntu 24.04 (Noble), apt install gh pins gh to 2.45.0 indefinitely (Ubuntu universe pin). Users following typical Linux install instructions land on a gh version that breaks pulse dispatch with no clear signal — the pulse keeps running, pulse-health.json keeps writing, but new issues never get dispatched. No aidevops status warning, no setup-time prerequisite check.

This is the same class of bug as #23103 (dashboard-freshness-check.sh using --paginate), but the fix in PR #23124 was a narrow point-fix on one file. The systemic gap — no minimum gh version check anywhere — is the real defect.

Expected Behavior

aidevops status (or aidevops doctor / setup) should report:

  • gh CLI version detected
  • Minimum required gh version (currently ≥2.51.0 for --slurp)
  • Apt-pin warning on Ubuntu/Debian with the canonical cli.github.com apt repo install snippet
  • Block or loudly warn if gh is below minimum

Alternatively (or additionally): pulse-wrapper should detect unknown flag errors from gh api and surface them as a fail-stop diagnostic rather than logging silently in pulse-wrapper.log.

Reproducer

Symptom command (from a host with gh 2.45.0 installed via Ubuntu apt):

~/.aidevops/agents/scripts/pulse-wrapper.sh

Actual output (excerpt from ~/.aidevops/logs/pulse-wrapper.log):

[pulse-wrapper] _gh_idempotent_comment: API error (exit=1) fetching comments for #1144 in Ultimate-Multisite/ultimate-multisite — skipping (fail closed)
...
unknown flag: --slurp

Usage:  gh api <endpoint> [flags]

Flags:
      --cache duration        Cache the response, e.g. "3600s", "60m", "1h"
  ...

Error: failed to fetch comments for #7 in Ultimate-Multisite/superdav-ai-newsletter

gh --versiongh version 2.45.0 (2025-07-18 Ubuntu 2.45.0-1ubuntu0.3)

apt-cache policy gh shows Ubuntu noble pinned at 2.45.0:

gh:
  Installed: 2.45.0-1ubuntu0.3
  Candidate: 2.45.0-1ubuntu0.3
  Version table:
 *** 2.45.0-1ubuntu0.3 500
        500 http://us.archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages

aidevops status reports:

Git CLI Tools
[OK] GitHub CLI (gh)

No warning about the broken --slurp flag despite pulse-wrapper actively failing.

Expected output: pulse-wrapper either succeeds, or aidevops status flags gh as too old before pulse silently breaks.

Causal code — call sites confirmed via rg:

.agents/scripts/dispatch-dedup-stale.sh:104       --paginate --slurp 2>/dev/null || true
.agents/scripts/dispatch-dedup-stale.sh:517       --paginate --slurp 2>/dev/null
.agents/scripts/pulse-triage-cache.sh:229         --paginate --slurp | jq -r '

Tests in .agents/scripts/tests/test-dispatch-dedup-stale-pagination.sh and test-worker-lifecycle-marker-pagination.sh explicitly assert --paginate --slurp is invoked, so this is a deliberate pattern — the gap is the lack of a corresponding prerequisite check.

Steps to Reproduce

  1. Install aidevops on Ubuntu 24.04 (or any host where gh is <2.51.0).
  2. Register a repo with open auto-dispatch + status:available issues.
  3. Wait for aidevops-supervisor-pulse.service to fire (every 10 min via systemd).
  4. Observe issues never get dispatched; ~/.aidevops/logs/pulse-wrapper.log contains repeated unknown flag: --slurp blocks with no other surfaced error.
  5. aidevops status continues to report gh as [OK].

Workarounds Applied

  1. Installed the official GitHub CLI apt repo manually and apt upgrade gh to 2.92.0:

    sudo mkdir -p -m 755 /etc/apt/keyrings
    wget -nv -O- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
    sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
    sudo apt update && sudo apt install -y gh

    After upgrade --slurp worked and pulse dispatch resumed within one cycle.

  2. Killed stuck pulse-wrapper.sh processes left from the 2.45-era cycle (also flagged separately — see Siblings).

  3. Removed redundant cron pulse-merge entry running in parallel with the systemd timer (see Siblings).

Environment

  • aidevops version: 3.15.31
  • Latest version: 3.15.31
  • Install method: unknown (/home/dave/.local/bin/aidevops)
  • AI Assistant: OpenCode
  • OS: Ubuntu 24.04.4 LTS
  • Shell: bash 5.2.21(1)-release
  • gh CLI (after manual upgrade): 2.92.0 (2026-04-28)
  • gh CLI (broken state): 2.45.0-1ubuntu0.3 (Ubuntu noble universe)

Additional Context

Five auto-dispatch + status:available issues sat undispatched for 4 days (May 7 → May 11) on Ultimate-Multisite/ultimate-multisite because of this. No telemetry surfaced the failure to the user — diagnosis required reading pulse-wrapper.log directly. After the gh upgrade, dispatch resumed within the next pulse cycle.

Related historical fix: #23103 / PR #23124 fixed --paginate on gh issue list in dashboard-freshness-check.sh for gh <2.55 compatibility. The same root cause (no gh minimum version gate) remains for --slurp on gh api in at least three other call sites.

Siblings

  • Subshell RATIONALE variable lost in pulse-fix-the-fixer-detector.sh line 352 — produces WARN: ... classification skipped — with empty rationale.
  • Stale cron pulse-merge entry left after migration to systemd timer — both fire in parallel until manually cleaned.
  • Repo-level priority: "high" value in ~/.config/aidevops/repos.json scores 0 in pulse-dispatch-engine.sh (only tooling/product are recognized) — silent enum mismatch.
  • aidevops-supervisor-pulse.service KillMode=process leaves child pulse-wrapper processes alive when the systemd unit is stopped.

aidevops.sh v3.15.31 plugin for OpenCode v1.14.48 with claude-opus-4-7 spent 55m and 48,357 tokens on this with the user in an interactive session.

Metadata

Metadata

Assignees

Labels

consolidatedIssue superseded by a consolidated childnot-plannedClosed without implementation — not planned

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions