Skip to content

Conversation

@glin93
Copy link
Contributor

@glin93 glin93 commented Dec 9, 2025

This commit addresses the issue where 'source_doc_id' was not being propagated in task completion (success/failure) logs emitted by the scheduler dispatcher.

Changes made:

  • Added 'source_doc_id: str | None' field to the 'ScheduleLogForWebItem' schema in 'src/memos/mem_scheduler/schemas/message_schemas.py'.
  • Modified '_maybe_emit_task_completion' in 'src/memos/mem_scheduler/task_schedule_modules/dispatcher.py' to:
    • Extract 'source_doc_id' from 'ScheduleMessageItem.info'.
    • Pass 'source_doc_id' to the 'ScheduleLogForWebItem' constructor for both 'completed' and 'failed' task status events.

This ensures better traceability and debugging for task completion events related to specific source documents.

Description

Summary: (summary)

Fix: #(issue)

Docs Issue/PR: (docs-issue-or-pr-link)

Reviewer: @(reviewer)

Checklist:

  • I have performed a self-review of my own code | 我已自行检查了自己的代码
  • I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have created related documentation issue/PR in MemOS-Docs (if applicable) | 我已在 MemOS-Docs 中创建了相关的文档 issue/PR(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

[email protected] and others added 2 commits December 9, 2025 14:33
This commit addresses the issue where 'source_doc_id' was not being propagated
in task completion (success/failure) logs emitted by the scheduler dispatcher.

Changes made:
- Added 'source_doc_id: str | None' field to the 'ScheduleLogForWebItem' schema
  in 'src/memos/mem_scheduler/schemas/message_schemas.py'.
- Modified '_maybe_emit_task_completion' in
  'src/memos/mem_scheduler/task_schedule_modules/dispatcher.py' to:
  - Extract 'source_doc_id' from 'ScheduleMessageItem.info'.
  - Pass 'source_doc_id' to the 'ScheduleLogForWebItem' constructor for both
    'completed' and 'failed' task status events.

This ensures better traceability and debugging for task completion events
related to specific source documents.
@glin93 glin93 requested a review from tangg555 December 9, 2025 07:32
@glin93 glin93 merged commit 04b1007 into dev Dec 9, 2025
16 checks passed
@glin93 glin93 deleted the fix/pass-source-doc-id-in-completion-log branch December 9, 2025 07:35
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.

3 participants