refactor(autopilot): canonicalize notification routing and add status diagnostics#742
Open
ahmedhesham6 wants to merge 1 commit into
Open
refactor(autopilot): canonicalize notification routing and add status diagnostics#742ahmedhesham6 wants to merge 1 commit into
ahmedhesham6 wants to merge 1 commit into
Conversation
… status diagnostics - Rename chat_id → target as canonical notification destination field, with backward-compatible legacy aliases (notify_chat_id, channel) - Add per-schedule notify_channel and notify_target overrides replacing legacy schedule-level 'channel' key - Add max_turns per-schedule override (replaces max_steps) - Swap CheckTriggerOn default from Success to Failure - Rename DeliveryConfig → NotificationRoute with type alias for compat - Add notification route status to 'autopilot status' table output - Add notification readiness diagnostics to 'autopilot doctor' (route resolution, missing channel/target hints, gateway reachability) - Add live sandbox health check to doctor output - Add notification_route_config_warnings for legacy key conflict detection - Add apply_schedule_run_overrides to propagate schedule max_turns - Update docs: system prompt, channel setup, gateway README - Extensive tests for legacy compat, canonical priority, CRUD preservation, conflict validation, and doctor diagnostics
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.
Description
Modernizes the autopilot notification routing system with canonical field names, per-schedule overrides, and observability improvements.
Changes Made
targetfield — Renameschat_id→targetas the primary notification destination field throughout config and runtime, with backward-compatible legacy aliases (notify_chat_id, schedule-levelchannel) that resolve in priority ordernotify_channel/notify_target— Adds schedule-level notification overrides replacing the legacychannelkey, with conflict validation rejecting--target+--chat-idor--max-turns+--max-stepsflag combinationsmax_turnsper-schedule override — Replacesmax_steps, propagated throughapply_schedule_run_overridesintoRunOverridesCheckTriggerOndefault →Failure— Swaps fromSuccesstoFailureas the sensible default (trigger on check failures)NotificationRoutetype — RenamesDeliveryConfig→NotificationRoutewith type alias for backward compatautopilot status— New table column showing resolved route (e.g.,slack:#ops) and readiness stateautopilot doctor— Detects missing channel/target, legacy key conflicts ([notifications].targetvschat_id,notify_targetvs legacy aliases), and gateway reachability for deliverynotification_route_config_warnings()— Warns when canonical fields override legacy aliases in the same config sectionRelated Issues
Part of the autopilot notification routing modernization effort.
Testing
cargo fmt --checkcleancargo clippy --all-targets -- -D warningscleanBreaking Changes
CheckTriggerOndefault changed fromSuccesstoFailure— schedules without explicittrigger_onwill now trigger on non-zero exit codes instead of exit 0. This is a behavioral change but aligns with the more intuitive default.chat_idand schedule-levelchannelfields are still loaded butchannel addnow writes the canonicaltargetfield. Config files with both will receive warning diagnostics fromautopilot doctor.