mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-11-09 04:20:34 +00:00
* fix(agents): keep todo reminders in Goal turns after an earlier provider stop TodoMiddleware skipped completion reminders whenever runtime.context held safety_capped or model_length_capped. The worker keeps that key across the run's hidden Goal continuation turns so the run record reports the first cap, and an unmet Goal continues after these provider stops (it stands down only on loop and token caps). After one capped response, every continuation turn therefore lost its todo reminders and could stop with unfinished items. Loop and token stops stay run-level and are still read from the context. Provider safety and length stops now apply to the response they ended, identified by the safety_termination / model_length_termination marker that those guards stamp on it. The check still runs before the parent hook, so a capped response cannot be resumed by the parallel-write retry. * refactor(agents): import provider-stop markers from the guards that stamp them TodoMiddleware matched the safety and length markers by string literals that duplicated the guards' own. Each guard now exports its marker and stop reason as module constants, used at its stamp and check sites and imported by TodoMiddleware, so a rename in a guard cannot silently disable suppression. Comment that completion_reminder_hard_stop_reasons is the inventory surface and only its run-level entries are read from runtime.context, and run the worker-level Goal continuation test for the safety guard too, which overwrites stop_reason instead of keeping the first one. --------- Co-authored-by: Totoro <msy626836554@gmail.com>