Repository navigation
feat(em): add agy (Antigravity CLI) as em-ai backend - #491
Merged
Merged
Conversation
…legacy Adds agy ahead of gemini in the em-ai fallback chain (claude -> agy -> gemini -> none), since Google's gemini CLI is deprecated upstream in favor of Antigravity. gemini is retained, not removed, for existing FLOW_EMAIL_AI=gemini configs. agy requires a validation wrapper, not a drop-in swap: it has no clean-output flag (appends an unrequested markdown status block to every response) and has been observed to exit 0 with a canned "system operational" response on degenerate input rather than failing loudly. _em_ai_agy_clean_output/_em_ai_agy_looks_valid strip and sanity-check its output before use. Also fixes a more serious bug found during live verification: capturing agy's output via $(...) command substitution hangs or dies silently, independent of `timeout` -- agy leaves a descendant process attached to its stdout pipe, so $(...) blocks waiting for EOF that never comes. Fixed by routing output through a temp file instead. Updates doctor's health check and the full doc surface for the --backend/FLOW_EMAIL_AI option set (guide, cookbook, doctor reference, master dispatcher/API/architecture docs, refcard, quick reference, tutorial, man page, changelog) -- left docs/specs/* (historical) and himalaya.nvim's separate :HimalayaAi gemini setting untouched. Also registers tests/test-em-ai-switch.zsh in run-all.sh, which had never been wired into the suite. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Data-Wise
pushed a commit
that referenced
this pull request
Jul 7, 2026
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 tasks done
Data-Wise
added a commit
that referenced
this pull request
Jul 7, 2026
…492) PR #491 added agy as an em-ai backend but only updated commands/doctor.zsh (flow doctor). em() has its own separate, duplicate help text (_em_help) and inline dependency check (_em_doctor) that still showed --backend claude|gemini with no agy option. Fixes both, keeps gemini labeled as legacy consistent with the rest of that PR. Co-authored-by: Test User <test@example.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agy(Antigravity CLI) as the primary fallback AI backend inem's AI abstraction layer, ahead ofgeminiin the chain (claude → agy → gemini → none). Google'sgeminiCLI is deprecated upstream in favor of Antigravity;geminiis kept, not removed, for existingFLOW_EMAIL_AI=geminiconfigs.agyneeds a validation wrapper, not a drop-in swap: it has no clean-output flag (appends an unrequested markdown status block to every response) and has been observed to exit0with a canned "system operational" response on degenerate input rather than failing loudly. New_em_ai_agy_clean_output/_em_ai_agy_looks_validhelpers strip and sanity-check its output before use; a failed check falls through to the existing fallback chain.agy's output via$(...)command substitution hangs or dies silently, independent oftimeout—agyleaves a descendant process attached to its stdout pipe, so$(...)blocks waiting for an EOF that never comes. Fixed by routing output through a temp file instead of$(...).doctor's health check and the full doc surface documenting the--backend/FLOW_EMAIL_AIoption set:EMAIL-DISPATCHER-GUIDE.md,EMAIL-COOKBOOK.md,docs/commands/doctor.md,MASTER-DISPATCHER-GUIDE.md,MASTER-API-REFERENCE.md,MASTER-ARCHITECTURE.md,REFCARD-EMAIL-DISPATCHER.md,QUICK-REFERENCE.md,docs/tutorials/46-em-v2-features.md,man/man1/em.1, root + docsCHANGELOG.md. Leftdocs/specs/*(historical, point-in-time) anddocs/tutorials/33-himalaya-email.md's himalaya.nvim:HimalayaAisetting (a separate editor plugin, notem) untouched.tests/test-em-ai-switch.zshinrun-all.sh, which had never been wired into the suite.Test plan
tests/test-em-ai-switch.zsh— 24/24 pass (addedagyswitch/toggle/extra_args cases)tests/test-em-ai-agy.zsh(new) — 8/8 pass (clean-output stripping + canned-response validation)./tests/run-all.sh— 77 passed, 0 failed, 0 timeout, 1 skipped (expected —e2e-em-dispatcherskips when the external tool is absent, matches documented baseline). Ran twice for consistency.mkdocs build --strict— clean, run twice (before and after the second docs pass), 0 warnings both times._em_ai_execute agy "..." "..." 15 classifyverified against the realagybinary post-fix — returnshello/EXIT:0cleanly through the actual code path (pre-fix: hung/died silently, reproduced 3x).🤖 Generated with Claude Code