Skip to content

fix(install): guard strip_legacy_hooks against non-string command; add agy probe glob#70

Merged
pbean merged 2 commits into
mainfrom
fix/hook-null-command-guard-and-agy-probe-glob
Jul 6, 2026
Merged

fix(install): guard strip_legacy_hooks against non-string command; add agy probe glob#70
pbean merged 2 commits into
mainfrom
fix/hook-null-command-guard-and-agy-probe-glob

Conversation

@pbean

@pbean pbean commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What

Two small follow-ups to #67 (Antigravity agy adapter), both flagged during its validation.

1. Harden strip_legacy_hooks against a non-string command (install.py)

#67 hardened the idempotency dedupe in merge_hooks so a present-but-null command can't crash it, but strip_legacy_hooks had the same latent TypeError at both its dedupe walks — the flat copilot entry (entry.get("command", "")) and the nested claude/codex/gemini handler (h.get("command", "")). A malformed hand-edited hook config would blow up bmad-loop init with TypeError: argument of type 'NoneType' is not iterable instead of skipping the entry.

Applies the identical isinstance(cmd := ..., str) guard #67 landed in merge_hooks. A non-string command simply isn't a bmad_auto hook, so it's preserved. Pre-existing across all dialects; not introduced by #67 (and unreachable via the antigravity path, whose hooks live under the bmad-loop group that strip_legacy_hooks never walks). New regression test covers both walks.

2. Add an agy transcript family glob (probe.py)

The antigravity profile ships usage_parser = "none", so probe-adapter antigravity had no transcript-location convention and couldn't auto-discover a transcript — the exact artifact needed to capture the schema and write the deferred token parser. Adds a FAMILY_GLOBS entry so probe can find agy's per-conversation transcript.jsonl.

The path is community-doc-sourced (agy 1.0.x); it degrades safely to the existing "no convention — pass --transcript/--session-dir" note if wrong, and the inline comment says to confirm it against a live build with probe-adapter antigravity --probe — the same posture #67's flags were landed with.

Sequencing

Fix 1 is independent and lands regardless. Fix 2 activates once #67's antigravity profile is on main (the glob is inert until then, keyed by the antigravity CLI name) — merge this after #67.

Tests

New test_strip_legacy_hooks_tolerates_non_string_command (flat + nested null-command shapes). Full suite green locally (1412 passed, 1 skipped); ruff check, ruff format, and trunk check clean.

🤖 Generated with Claude Code

pbean and others added 2 commits July 5, 2026 23:43
A pre-existing hook handler whose `command` is present-but-null crashed
strip_legacy_hooks with `TypeError: argument of type 'NoneType' is not
iterable` at both dedupe walks (the flat copilot entry and the nested
claude/codex/gemini handler). Mirror the isinstance-str guard PR #67 landed
in merge_hooks so a malformed hand-edited config is tolerated (a non-string
command simply isn't a bmad_auto hook, so it's kept). Regression test covers
both walks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Give `probe-adapter antigravity` a fallback transcript location so it can
auto-discover an agy conversation transcript.jsonl — the step that unblocks
writing the deferred token parser (the antigravity profile ships
usage_parser = "none"). The path is community-doc-sourced (agy 1.0.x) and
degrades safely to the existing "no convention" note if wrong; confirm
against a live build with `probe-adapter antigravity --probe`.

Companion to #67 — the glob activates once the antigravity profile lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@pbean, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bef461f8-09de-4d2b-8b2b-78afb95a0900

📥 Commits

Reviewing files that changed from the base of the PR and between 8663374 and 02013a4.

📒 Files selected for processing (3)
  • src/bmad_loop/install.py
  • src/bmad_loop/probe.py
  • tests/test_install.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hook-null-command-guard-and-agy-probe-glob

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@augmentcode

augmentcode Bot commented Jul 6, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR hardens hook-migration and improves transcript auto-discovery for the Antigravity (agy) adapter.

Changes:

  • Guards strip_legacy_hooks against non-string (e.g., null) command values so malformed hand-edited hook configs don’t raise TypeError.
  • Applies the guard in both the “flat” (Copilot) handler shape and the nested Claude/Codex/Gemini handler shape.
  • Adds a regression test covering both shapes to ensure legacy pruning remains safe and correct.
  • Adds a FAMILY_GLOBS entry for antigravity so probe-adapter can discover agy transcripts when usage_parser is still none.

Technical Notes: The new Antigravity transcript path is documented as community-sourced and safely falls back to manual --transcript/--session-dir when the convention doesn’t match.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@pbean pbean merged commit b0cce05 into main Jul 6, 2026
9 checks passed
@pbean pbean deleted the fix/hook-null-command-guard-and-agy-probe-glob branch July 6, 2026 07:03
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.

1 participant