Skip to content

fix(script): make watch-user-replies.sh actually fetch comments - #407

Merged
ycpss91255 merged 2 commits into
mainfrom
fix/watch-user-replies-gh-arg
Sep 29, 2026
Merged

ycpss91255 merged 2 commits into
mainfrom
fix/watch-user-replies-gh-arg

Conversation

@ycpss91255

Copy link
Copy Markdown
Owner

Closes #406

Summary

watch-user-replies.sh never fetched a single comment: gh api has no --arg flag, so every per-thread call failed with unknown flag: --arg, and the failure only reached stderr, where Monitor does not look. This PR fixes the fetch, makes fetch failures visible, and commits the script and its spec (both were previously untracked).

  • Splice the digits-only issue number into the --jq program (validated with ^[0-9]+$ before use).
  • --seed exits 1 without seeding when any thread cannot be read (a partial seed would re-announce history later).
  • A watch cycle with a failed thread prints WATCH FETCH FAILED: <failed> of <total> thread(s) unreadable this cycle on stdout.
  • Header docs updated for the new exit code and stdout event.

Test plan

  • RED: the four new specs fail against the original script (not ok 11-14), run in the test-tools image
  • GREEN: watch_user_replies_spec.bats 20/20 against the fix, in the test-tools image
  • ShellCheck clean on the script and the spec (test-tools image)
  • Live check: --seed against ycpss91255/worktool now marks 5 ids seen (was 0 with every fetch failing)
  • CI ci-passed green (full unit / integration / coverage)

Generated with Claude Code

gh api has no --arg flag, so every per-thread fetch failed with
"unknown flag: --arg" and the watcher silently reported nothing. Splice
the digits-only issue number into the --jq program instead.

A failed fetch is no longer silent: --seed exits 1 instead of seeding a
partial set, and a watch cycle with a failed thread prints a
WATCH FETCH FAILED line on stdout so Monitor surfaces it.

The spec now drives --once / --seed through a gh stub that rejects
flags the real CLI lacks; the four new cases fail on the old script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ycpss91255
ycpss91255 enabled auto-merge (squash) September 29, 2026 03:07
CI lint flags $stderr (set by bats run --separate-stderr) as SC2154.
Assert on the combined output instead, and also pin the abort message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ycpss91255
ycpss91255 merged commit 3aed0d3 into main Sep 29, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(script): watch-user-replies.sh never fetches (gh api has no --arg)

1 participant