Skip to content

fix(cron): stream cron reminders with stream_id and turn_end#3720

Draft
chengyongru wants to merge 1 commit into
mainfrom
fix/cron-stream-id
Draft

fix(cron): stream cron reminders with stream_id and turn_end#3720
chengyongru wants to merge 1 commit into
mainfrom
fix/cron-stream-id

Conversation

@chengyongru
Copy link
Copy Markdown
Collaborator

Fixes #3718

When cron jobs trigger agent responses, they bypass AgentLoop._dispatch which normally creates streaming callbacks (on_stream/on_stream_end) with _stream_id. As a result, WebSocket clients never receive stream_id in delta events and can't properly associate streaming fragments.

This change replicates the streaming logic in on_cron_job:

  • Detects if the target channel supports streaming
  • Generates _stream_id segments (base_id:segment)
  • Emits _stream_delta, _stream_end, _streamed, and _turn_end metadata
  • Prevents duplicate final delivery when streaming was used

Also adds a test verifying the full streaming lifecycle for cron-triggered messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

服务器流式输出cron提醒的消息没有streamid

1 participant