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
29 changes: 29 additions & 0 deletions examples/openclaw-plugin/text-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ const QUESTION_CUE_RE =
/[??]|\b(?:what|when|where|who|why|how|which|can|could|would|did|does|is|are)\b|^(?:请问|能否|可否|怎么|如何|什么时候|谁|什么|哪|是否)/i;
const SPEAKER_TAG_RE = /(?:^|\s)([A-Za-z\u4e00-\u9fa5][A-Za-z0-9_\u4e00-\u9fa5-]{1,30}):\s/g;

/** Patterns that indicate cron/maintenance/scheduled tasks — these should never
* receive ingest-reply-assist because they are control/maintenance prompts,
* not memory-ingestion transcripts. See issue #982. */
const CRON_MAINTENANCE_RE = new RegExp(
[
/\b(?:daily|weekly|monthly)\s+(?:memory\s+)?(?:maintenance|distillation|synthesis|cleanup|review)/i,
/\b(?:distillation|synthesis)\.md\b/i,
/\bread\s+skills\//i,
/\b(?:cron|scheduled)\s+(?:task|job|run|prompt)/i,
/\bworkspace:\s*\/[\w/.]/,
/\bopenclaw\s+(?:cron|workspace)/i,
]
.map((r) => r.source)
.join("|"),
);

export const CAPTURE_LIMIT = 3;

function resolveCaptureMinLength(text: string): number {
Expand Down Expand Up @@ -146,6 +162,19 @@ export function isTranscriptLikeIngest(
};
}

// Exclude cron / maintenance / scheduled task prompts from ingest-reply-assist.
// These are control/maintenance instructions, not memory-ingestion transcripts.
// See https://github.com/volcengine/OpenViking/issues/982
if (CRON_MAINTENANCE_RE.test(normalizedText)) {
return {
shouldAssist: false,
reason: "cron_maintenance_task",
normalizedText,
speakerTurns: 0,
chars: normalizedText.length,
};
}

const chars = normalizedText.length;
if (chars < options.minChars) {
return {
Expand Down
Loading