greatmengqi 57d36a0977 test(thread_data_middleware): cover run_id stamping on HumanMessage
Two new cases in test_thread_data_middleware.py pin the merge contract
between PR (frozen DeerFlowContext) and release/2.0-rc (HumanMessage
stamping logic):

- test_before_agent_stamps_run_id_and_timestamp_on_last_human_message:
  given DeerFlowContext(run_id="r-stamp"), the trailing HumanMessage
  in state gets additional_kwargs["run_id"] == "r-stamp" and a
  timestamp; id and name are preserved/normalized.

- test_before_agent_stamps_none_run_id_when_context_omits_it:
  run_id is optional on DeerFlowContext, so middleware must stamp
  None gracefully rather than raise.

These were the smoke target for the merge: prior to this commit
the only signal that runtime.context.run_id worked end-to-end was
a manual gateway run.
2026-04-26 12:42:17 +08:00
..