[codex] 修复 Schedule Aggregator 空窗口刷新收敛#152
Merged
utopiafar merged 1 commit intoMay 18, 2026
Merged
Conversation
PR Preflight Summary / PR 预检汇总中文
English
PR Policy Preflight / PR 规则预检PR Policy Preflight / PR 规则预检中文
未发现确定性规则问题。 English
No deterministic policy findings. PR Flutter Quality / Flutter 质量预检PR Flutter Quality / Flutter 质量预检中文
English
Flutter Analyzer Baseline
No new analyzer issues introduced by this PR. Flutter Test Baseline
No new Flutter test failures introduced by this PR. |
374a96b to
0e20b7e
Compare
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.
背景
Closes #147。
真实 replay 中,Schedule Aggregator 遇到「当前刷新窗口没有 temporal cards,但 dirty state 指向历史卡片」时,会继续回读历史 Cards 并尝试推理,最终触发 max-turn loop detection。根因是刷新窗口只跟随真实 wall clock,而 dirty card 的历史日期没有参与窗口选择;同时空窗口没有一个结构性的 no-op completion path,清 dirty 只能依赖 agent 成功保存 aggregation。
改动
ScheduleAggregationRunPlan,在 agent 启动前统一解析目标窗口、刷新状态、当前 schedule cards 和最新 aggregation。get_schedule_cards的默认窗口改为读取本次 run metadata,确保 agent 工具默认使用同一个目标窗口。验证
flutter pub get --offlineflutter test --no-pub --concurrency=1 test/agent/schedule_aggregation_run_context_test.dart test/data/services/task_handlers/schedule_aggregator_handler_test.dartflutter test --no-pub --concurrency=1 test/agent/schedule_aggregation_run_lifecycle_test.dart test/data/repositories/get_schedule_briefing_timeline_card_test.dart test/domain/models/schedule_aggregation_model_test.dart test/ui/schedule/models/schedule_item_test.dartflutter analyze --no-pub lib/agent/schedule_aggregator_agent/schedule_aggregation_run_context.dart lib/agent/schedule_aggregator_agent/schedule_aggregator_agent.dart lib/agent/skills/schedule_aggregation/schedule_aggregation_skill.dart lib/data/services/task_handlers/schedule_aggregator_handler.dart lib/domain/models/task_exceptions.dart test/agent/schedule_aggregation_run_context_test.dart test/data/services/task_handlers/schedule_aggregator_handler_test.dartgit diff --check发布前检查
upstream/main创建分支。git fetch upstream main,确认upstream/main...HEAD为0 1,当前分支只领先目标分支一个提交且没有落后。