Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2785,6 +2785,21 @@ const memoryLanceDBProPlugin = {
return;
}

// Skip self-improvement note on Discord channel (non-thread) resets
// to avoid contributing to the post-reset startup race on Discord channels.
// Discord thread resets are handled separately by the OpenClaw core's
// postRotationStartupUntilMs mechanism (PR #49001).
// Note: Provider lives in sessionEntry.Provider; MessageThreadId lives in
// sessionEntry.threadId (populated from ctx.MessageThreadId at session creation).
const provider = contextForLog.sessionEntry?.Provider ?? "";
const threadId = contextForLog.sessionEntry?.threadId;
if (provider === "discord" && (threadId == null || threadId === "")) {
api.logger.info(
`self-improvement: command:${action} skipped on Discord channel (non-thread) reset to avoid startup race; use /new in thread or restart gateway if startup is incomplete`
);
return;
}

const exists = event.messages.some((m: unknown) => typeof m === "string" && m.includes(SELF_IMPROVEMENT_NOTE_PREFIX));
if (exists) {
api.logger.info(`self-improvement: command:${action} note already present; skip duplicate inject`);
Expand Down
Loading