mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-16 12:27:53 +08:00
fix(cron): self-heal missing tasks_<wsId> conversation row before saving messages
This commit is contained in:
parent
74edc09b2b
commit
a5e7f82a69
@ -70,6 +70,15 @@ public class CronJobLifecycleService {
|
|||||||
run.setDeliveryStatus("NONE");
|
run.setDeliveryStatus("NONE");
|
||||||
runMapper.insert(run);
|
runMapper.insert(run);
|
||||||
|
|
||||||
|
// Self-heal the parent conversation row before saving messages.
|
||||||
|
// saveMessage only inserts message rows; if the conversation row is
|
||||||
|
// missing (e.g. tasks_<wsId> seed never ran on this DB, or was
|
||||||
|
// deleted manually) the messages become orphans the sidebar cannot
|
||||||
|
// surface. getOrCreateSharedConversation makes the row land with
|
||||||
|
// username=system so every workspace member sees it.
|
||||||
|
conversationService.getOrCreateSharedConversation(
|
||||||
|
conversationId, job.getAgentId(), job.getWorkspaceId());
|
||||||
|
|
||||||
// Cron-run header (system role) so users browsing the unified
|
// Cron-run header (system role) so users browsing the unified
|
||||||
// tasks_<wsId> conversation can tell which job's run starts here.
|
// tasks_<wsId> conversation can tell which job's run starts here.
|
||||||
// Renderable as a divider card on the frontend; LLM history reads
|
// Renderable as a divider card on the frontend; LLM history reads
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user