Feat: Add same-action deduplication to prevent repeated firing #228
Merged
yangbaofu007 merged 24 commits intomainfrom Feb 14, 2026
Merged
Feat: Add same-action deduplication to prevent repeated firing #228yangbaofu007 merged 24 commits intomainfrom
yangbaofu007 merged 24 commits intomainfrom
Conversation
update prompts and prompts create method update llm response and exclutable logic
yangbaofu007
reviewed
Feb 9, 2026
…che loading and enhancing logging for LLM output and condition results.
…erver configuration.
…djust timestamp type for scheduled tasks.
…g levels for improved observability.
…ptimize camera loading, and adjust logging levels.
…g state management to rule-level.
…simplify its cleanup logic in `remove_trigger_rule`.
…ing for LLM proxy status and task completion.
…enhance trigger condition results, including a fix for sending state deletion.
…lls, improve LLM output parsing, and safely remove trigger rule states.
…g parameter from trigger filter.
…s, and adjust trigger condition result and sending state updates.
…e processing and prompt building, and refine scheduled task execution flow.
…larity in trigger rule configuration and usage.
yangbaofu007
approved these changes
Feb 13, 2026
xiuxiuxiu94
approved these changes
Feb 14, 2026
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.
问题
状态判断僵化:用户反馈:例如"如果我坐着/如果我睡醒了,就...”出现重复触发
目标
能够区别状态和动作持续状态中只触发一次。
”小孩在读书的时候,给我发通知-->在看书的期间只发一次通知”每动作一次就触发一次。
“我比个耶就给我发送一次通知-->每比一次耶就发送一次通知”
解决方法
修改内容
config/prompt_config.yaml: 重写 trigger_rule_condition prompt(中英文),增加 is_same_action 判断流程和输出格式;新增
current_time_prefix、last_happened_frames_prefix、last_happened_time_prefix 等前缀配置
miloco_server/service/trigger_rule_runner.py:
miloco_server/utils/prompt_helper.py: build_trigger_rule_prompt() 新增 last_happened_img_seq 参数,构建包含历史帧和时间戳的完整 prompt
The trigger rule system monitors camera feeds and executes actions when conditions are met. The current implementation has a deduplication issue: rules fire repeatedly while conditions remain satisfied, causing the same action to execute multiple times for a single continuous event.
Summary
Changes
format; add current_time_prefix, last_happened_frames_prefix, last_happened_time_prefix prefix configs
historical frames and timestamps