Repository navigation
email.always and --no-email - #124
Merged
Merged
Conversation
email.always = true in the User config makes a Run without --email send a Run notification to email.to, through the same preflight as the flag. no-email / --no-email skips it for one Run, and contradicts --email. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NotificationAsk lives with RunNotification, so the User config no longer depends on argument parsing, and email.always gives a default ask as merge.always gives a default goal. The merge and email flags share one check for a flag repeated or contradicted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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
email.alwaysin the User config gives a Run its default Run notification ask, the same waymerge.alwaysgives it its default goal. The command'semail/no-emailwins over it.NotificationAsklives innotification.rsnext toRunNotification, so the User config doesn't depend on argument parsing. The help text and README documentemail.alwaysand--no-email.Evidence
[email] always = trueis an unknown key, so the Run stops withunknown key email.always, and--no-emailis an unexpected argument.After:
cargo testpasses in full, including these new tests:run_notification::email_always_makes_a_run_without_the_flag_send_one_notification_to_email_torun_notification::no_email_skips_the_notification_email_always_asks_for(bothno-emailand--no-email, stand-in gets nothing)run_notification::with_email_always_an_address_after_the_flag_still_winsrun_notification::email_always_without_an_address_or_a_key_stops_the_run_before_any_workrun_notification::without_email_always_a_run_without_the_flag_sends_nothing(unset andfalse)command_surface::email_with_no_email_prints_an_error_and_the_help_to_stderr(exit 2, help, no session started)command_surface::help_lists_the_email_settingsnow also checks foremail.alwaysand--no-emailconfig::tests::email_always_asks_for_a_notification_to_email_to, plus a type error for a non-booleanemail.alwaysMerge Danger
Door: two-way
The change adds a config key and a flag. Without
email.always, Runs behave exactly as before.Blast Radius: small
A machine that sets
email.alwaysbut has noemail.toorRESEND_API_KEYnow has every Run stop at preflight. That is the behaviour the issue asks for.Unaddressed findings
Standards
email.alwaysis nested inEmailSettingswhilemerge_alwayssits flat onUserConfig. Not changed: each follows its own TOML section's existing struct.config.email.default_ask()is a short message chain inmain. Not changed: it reads the same asconfig.default_goal()and hides nothing worth wrapping.Spec
no-emailgiven twice is a "repeated argument" error, which the spec doesn't mention. Kept: it matches how every other Run flag already works.email.alwaysgets its own "must be true or false" error. Kept: it follows the User config's existing type validation, the same asmerge.always.Closes #115
🤖 Generated with Claude Code