Keep AI summaries off by default without the llm package - #408
Open
dbosk wants to merge 1 commit into
Open
Conversation
Both --ai and --no-ai write to args.ai, and argparse takes the default from the first action registered for that destination. Since --ai is only registered when the optional llm package imports, installations without llm got --no-ai's default=True: analyse ran with AI enabled exactly when the backend was missing, injecting error messages into every generated report. Both actions now declare default=False, so the default follows the capability instead of the flag registration. The flag pair moves into its own <<AI summary options>> chunk with prose explaining the asymmetry, plus a regression test that poisons sys.modules to force the no-llm path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pb27a9hf6eNoetEWryx2fj
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.
Both
--aiand--no-aiwrite todest="ai", and argparse fills thedefault from the first action registered for a destination. Since
--aiisonly registered when
import llmsucceeds, installations without llm fellthrough to
--no-ai'sdefault=True— AI summaries were enabled preciselywhen the backend was absent, injecting error text about the missing package
into every generated report.
Both actions now declare
default=False: the default follows the capability,not the flag registration, so AI summaries are strictly opt-in via
--ai(which only exists when the backend does). Behavior with llm installed is
unchanged, verified with a stubbed llm module: default False,
--ai→ True,--no-ai→ False.The AI-flag registration moved into its own
<<AI summary options>>chunkwith a subsection explaining the shared-destination pitfall. Regression test
poisons
sys.modules["llm"]to exercise the no-llm path deterministically;proven load-bearing against the pre-fix tangled code. Full suite: 470 passed
(baseline 469).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Pb27a9hf6eNoetEWryx2fj