Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

Remove ingestReplyAssist feature and all related config, logic, and tests (#1564)

AutoCoder98b47904eeda
diff --git a/examples/openclaw-plugin/README.md b/examples/openclaw-plugin/README.md
index c99593a77..706739249 100644
--- a/examples/openclaw-plugin/README.md
+++ b/examples/openclaw-plugin/README.md
@@ -71,18 +71,6 @@ The reranking logic is not pure vector-score sorting. The current implementation
- whether it looks like an event memory
- lexical overlap with the current query
-### Transcript ingest assist
-
-This path also includes a special transcript-oriented branch.
-
-When the latest user input looks like pasted multi-speaker transcript content:
-
-- metadata blocks, command text, and pure question text are filtered out
-- the cleaned text is checked against speaker-turn and length thresholds
-- if it matches, the plugin prepends a lightweight `<ingest-reply-assist>` instruction
-
-The goal is not to change memory logic. It is to reduce the chance that the model responds with `NO_REPLY` when the user pastes chat history, meeting notes, or conversation transcripts for ingestion.
-
## Session Lifecycle
![Session lifecycle and compaction boundary](./images/openclaw-plugin-session-lifecycle.png)
diff --git a/examples/openclaw-plugin/README_CN.md b/examples/openclaw-plugin/README_CN.md
index ca463ada5..4c978cfde 100644
--- a/examples/openclaw-plugin/README_CN.md
+++ b/examples/openclaw-plugin/README_CN.md
@@ -71,18 +71,6 @@
- 是否属于事件类记忆
- 与当前 query 的词面重合度
-### Transcript ingest assist
-
-除了普通 recall,这条链路还包含一个“转录文本辅助分支”。
-
-如果最后一条用户输入看起来像多说话人的转录文本:
-
-- 会先清理 metadata block、命令文本、纯提问文本等噪音
-- 再按说话人数和文本长度做 transcript-like 判断
-- 命中后 prepend 一个很轻量的 `<ingest-reply-assist>` 指令
-
-它的目标不是改写记忆逻辑,而是降低模型在“用户粘贴聊天记录/会议纪要/对话转录”这类场景里直接返回 `NO_REPLY` 的概率。
-
## Session 生命周期
![Session 生命周期与压缩边界](./images/openclaw-plugin-session-lifecycle.png)
diff --git a/examples/openclaw-plugin/__tests__/bypass-session-patterns.test.ts b/examples/openclaw-plugin/__tests__/bypass-session-patterns.test.ts
index f4ffb7023..2871563b7 100644
--- a/examples/openclaw-plugin/__tests__/bypass-session-patterns.test.ts
+++ b/examples/openclaw-plugin/__tests__/bypass-session-patterns.test.ts
@@ -22,7 +22,7 @@ describe("bypass session patterns", () => {
]);
});
- it("supports ingestReplyAssistIgnoreSessionPatterns as a deprecated alias", () => {
+ it("accepts deprecated ingestReplyAssistIgnoreSessionPatterns as bypassSessionPatterns fallback", () => {
const cfg = memoryOpenVikingConfigSchema.parse({
ingestReplyAssistIgnoreSessionPatterns: [
"agent:*:cron:**",
diff --git a/examples/openclaw-plugin/config.ts b/examples/openclaw-plugin/config.ts
index be9c4f916..b436fb6dd 100644
--- a/examples/openclaw-plugin/config.ts
+++ b/examples/openclaw-plugin/config.ts
@@ -25,11 +25,6 @@ export type MemoryOpenVikingConfig = {
recallTokenBudget?: number;
commitTokenThreshold?: number;
bypassSessionPatterns?: string[];
- ingestReplyAssist?: boolean;
- ingestReplyAssistMinSpeakerTurns?: number;
- ingestReplyAssistMinChars?: number;
- /** Deprecated alias for bypassSessionPatterns. */
- ingestReplyAssistIgnoreSessionPatterns?: string[];
/**
* When true (default), emit structured `openviking: diag {...}` lines (and any future
* standard-diagnostics file writes) for assemble/afterTurn. Set false to disable.
@@ -52,10 +47,6 @@ const DEFAULT_RECALL_PREFER_ABSTRACT = true;
const DEFAULT_RECALL_TOKEN_BUDGET = 2000;
const DEFAULT_COMMIT_TOKEN_THRESHOLD = 20000;
const DEFAULT_BYPASS_SESSION_PATTERNS: string[] = [];
-const DEFAULT_INGEST_REPLY_ASSIST = true;
-const DEFAULT_INGEST_REPLY_ASSIST_MIN_SPEAKER_TURNS = 2;
-const DEFAULT_INGEST_REPLY_ASSIST_MIN_CHARS = 120;
-const DEFAULT_INGEST_REPLY_ASSIST_IGNORE_SESSION_PATTERNS: string[] = [];
const DEFAULT_EMIT_STANDARD_DIAGNOSTICS = false;
const DEFAULT_LOCAL_CONFIG_PATH = join(homedir(), ".openviking", "ov.conf");
@@ -238,30 +229,6 @@ export const memoryOpenVikingConfigSchema = {
DEFAULT_BYPASS_SESSION_PATTERNS,
),
),
- ingestReplyAssist: cfg.ingestReplyAssist === true,
- ingestReplyAssistMinSpeakerTurns: Math.max(
- 1,
- Math.min(
- 12,
- Math.floor(
- toNumber(
- cfg.ingestReplyAssistMinSpeakerTurns,
- DEFAULT_INGEST_REPLY_ASSIST_MIN_SPEAKER_TURNS,
- ),
- ),
- ),
- ),
- ingestReplyAssistMinChars: Math.max(
- 32,
- Math.min(
- 10000,
- Math.floor(toNumber(cfg.ingestReplyAssistMinChars, DEFAULT_INGEST_REPLY_ASSIST_MIN_CHARS)),
- ),
- ),
- ingestReplyAssistIgnoreSessionPatterns: toStringArray(
- cfg.ingestReplyAssistIgnoreSessionPatterns,
- DEFAULT_INGEST_REPLY_ASSIST_IGNORE_SESSION_PATTERNS,
- ),
emitStandardDiagnostics:
typeof cfg.emitStandardDiagnostics === "boolean"
? cfg.emitStandardDiagnostics
@@ -373,29 +340,6 @@ export const memoryOpenVikingConfigSchema = {
advanced: true,
help: "Minimum estimated pending tokens before auto-commit triggers. Set to 0 to commit every turn.",
},
- ingestReplyAssist: {
- label: "Ingest Reply Assist",
- help: "When transcript-like memory ingestion is detected, add a lightweight reply instruction to reduce NO_REPLY.",
- advanced: true,
- },
- ingestReplyAssistMinSpeakerTurns: {
- label: "Ingest Min Speaker Turns",
- placeholder: String(DEFAULT_INGEST_REPLY_ASSIST_MIN_SPEAKER_TURNS),
- help: "Minimum speaker-tag turns (e.g. Name:) to detect transcript-like ingest text.",
- advanced: true,
- },
- ingestReplyAssistMinChars: {
- label: "Ingest Min Chars",
- placeholder: String(DEFAULT_INGEST_REPLY_ASSIST_MIN_CHARS),
- help: "Minimum sanitized text length required before ingest reply assist can trigger.",
- advanced: true,
- },
- ingestReplyAssistIgnoreSessionPatterns: {
- label: "Deprecated Ingest Ignore Session Patterns",
- placeholder: "agent:*:cron:**",
- help: "Deprecated alias for bypassSessionPatterns. Matching sessions now bypass OpenViking entirely.",
- advanced: true,
- },
emitStandardDiagnostics: {
label: "Standard diagnostics (diag JSON lines)",
advanced: true,
diff --git a/examples/openclaw-plugin/index.ts b/examples/openclaw-plugin/index.ts
index 2fca3a0ca..b20444382 100644
--- a/examples/openclaw-plugin/index.ts
+++ b/examples/openclaw-plugin/index.ts
@@ -19,7 +19,6 @@ import type {
import { formatMessageFaithful } from "./context-engine.js";
import {
compileSessionPatterns,
- isTranscriptLikeIngest,
extractLatestUserText,
sanitizeUserTextForCapture,
shouldBypassSession,
@@ -1535,26 +1534,6 @@ const mergeFindResults = (results: FindResult[]): FindResult => {
}
}
- if (cfg.ingestReplyAssist) {
- const decision = isTranscriptLikeIngest(queryText, {
- minSpeakerTurns: cfg.ingestReplyAssistMinSpeakerTurns,
- minChars: cfg.ingestReplyAssistMinChars,
- });
- if (decision.shouldAssist) {
- verboseRoutingInfo(
- `openviking: ingest-reply-assist applied (reason=${decision.reason}, speakerTurns=${decision.speakerTurns}, chars=${decision.chars})`,
- );
- prependContextParts.push(
- "<ingest-reply-assist>\n" +
- "The latest user input looks like a multi-speaker transcript used for memory ingestion.\n" +
- "Reply with 1-2 concise sentences to acknowledge or summarize key points.\n" +
- "Do not output NO_REPLY or an empty reply.\n" +
- "Do not fabricate facts beyond the provided transcript and recalled memories.\n" +
- "</ingest-reply-assist>",
- );
- }
- }
-
if (prependContextParts.length > 0) {
return {
prependContext: prependContextParts.join("\n\n"),
diff --git a/examples/openclaw-plugin/openclaw.plugin.json b/examples/openclaw-plugin/openclaw.plugin.json
index 5b5d1a2c2..df26c5060 100644
--- a/examples/openclaw-plugin/openclaw.plugin.json
+++ b/examples/openclaw-plugin/openclaw.plugin.json
@@ -102,29 +102,6 @@
"advanced": true,
"help": "Minimum estimated pending tokens before auto-commit triggers. Set to 0 to commit every turn."
},
- "ingestReplyAssist": {
- "label": "Ingest Reply Assist",
- "help": "When transcript-like memory ingestion is detected, add a lightweight reply instruction to reduce NO_REPLY.",
- "advanced": true
- },
- "ingestReplyAssistMinSpeakerTurns": {
- "label": "Ingest Min Speaker Turns",
- "placeholder": "2",
- "help": "Minimum speaker-tag turns (e.g. Name:) to detect transcript-like ingest text.",
- "advanced": true
- },
- "ingestReplyAssistMinChars": {
- "label": "Ingest Min Chars",
- "placeholder": "120",
- "help": "Minimum sanitized text length required before ingest reply assist can trigger.",
- "advanced": true
- },
- "ingestReplyAssistIgnoreSessionPatterns": {
- "label": "Deprecated Ingest Ignore Session Patterns",
- "placeholder": "agent:*:cron:**",
- "help": "Deprecated alias for bypassSessionPatterns. Matching sessions now bypass OpenViking entirely.",
- "advanced": true
- },
"emitStandardDiagnostics": {
"label": "Standard diagnostics (diag JSON lines)",
"advanced": true,
diff --git a/examples/openclaw-plugin/skills/install-openviking-memory/SKILL.md b/examples/openclaw-plugin/skills/install-openviking-memory/SKILL.md
index 011cd7848..c8b167131 100644
--- a/examples/openclaw-plugin/skills/install-openviking-memory/SKILL.md
+++ b/examples/openclaw-plugin/skills/install-openviking-memory/SKILL.md
@@ -70,7 +70,6 @@ Example: User says "Forget my phone number"
| `autoRecall` | `true` | Automatically recall and inject context |
| `recallLimit` | `6` | Maximum memories injected during auto-recall |
| `recallScoreThreshold` | `0.01` | Minimum relevance score for recall |
-| `ingestReplyAssist` | `true` | Add reply guidance when detecting multi-party conversation text |
## Daily Operations
diff --git a/examples/openclaw-plugin/tests/context-engine-assemble.test.ts b/examples/openclaw-plugin/tests/context-engine-assemble.test.ts
index e0d20991e..2f17e1941 100644
--- a/examples/openclaw-plugin/tests/context-engine-assemble.test.ts
+++ b/examples/openclaw-plugin/tests/context-engine-assemble.test.ts
@@ -9,7 +9,6 @@ const cfg = memoryOpenVikingConfigSchema.parse({
baseUrl: "http://127.0.0.1:1933",
autoCapture: false,
autoRecall: false,
- ingestReplyAssist: false,
});
function roughEstimate(messages: unknown[]): number {
diff --git a/examples/openclaw-plugin/tests/ut/config.test.ts b/examples/openclaw-plugin/tests/ut/config.test.ts
index 95f2174d3..6f60f6ed6 100644
--- a/examples/openclaw-plugin/tests/ut/config.test.ts
+++ b/examples/openclaw-plugin/tests/ut/config.test.ts
@@ -22,7 +22,6 @@ describe("memoryOpenVikingConfigSchema.parse()", () => {
expect(cfg.recallPreferAbstract).toBe(false);
expect(cfg.recallTokenBudget).toBe(2000);
expect(cfg.commitTokenThreshold).toBe(20000);
- expect(cfg.ingestReplyAssist).toBe(false);
expect(cfg.captureMode).toBe("semantic");
expect(cfg.captureMaxLength).toBe(24000);
expect(cfg.recallMaxContentChars).toBe(500);
diff --git a/examples/openclaw-plugin/tests/ut/context-engine-afterTurn.test.ts b/examples/openclaw-plugin/tests/ut/context-engine-afterTurn.test.ts
index bdb1091ad..376825ea5 100644
--- a/examples/openclaw-plugin/tests/ut/context-engine-afterTurn.test.ts
+++ b/examples/openclaw-plugin/tests/ut/context-engine-afterTurn.test.ts
@@ -25,7 +25,6 @@ function makeEngine(opts?: {
baseUrl: "http://127.0.0.1:1933",
autoCapture: opts?.autoCapture ?? true,
autoRecall: false,
- ingestReplyAssist: false,
commitTokenThreshold: opts?.commitTokenThreshold ?? 20000,
emitStandardDiagnostics: true,
...(opts?.cfgOverrides ?? {}),
diff --git a/examples/openclaw-plugin/tests/ut/context-engine-assemble.test.ts b/examples/openclaw-plugin/tests/ut/context-engine-assemble.test.ts
index beee51315..d9d1c1e97 100644
--- a/examples/openclaw-plugin/tests/ut/context-engine-assemble.test.ts
+++ b/examples/openclaw-plugin/tests/ut/context-engine-assemble.test.ts
@@ -9,7 +9,6 @@ const cfg = memoryOpenVikingConfigSchema.parse({
baseUrl: "http://127.0.0.1:1933",
autoCapture: false,
autoRecall: false,
- ingestReplyAssist: false,
});
function roughEstimate(messages: unknown[]): number {
diff --git a/examples/openclaw-plugin/tests/ut/context-engine-compact.test.ts b/examples/openclaw-plugin/tests/ut/context-engine-compact.test.ts
index 600392673..c73ab74c6 100644
--- a/examples/openclaw-plugin/tests/ut/context-engine-compact.test.ts
+++ b/examples/openclaw-plugin/tests/ut/context-engine-compact.test.ts
@@ -18,7 +18,6 @@ function makeEngine(commitResult: unknown, opts?: { throwError?: Error }) {
baseUrl: "http://127.0.0.1:1933",
autoCapture: false,
autoRecall: false,
- ingestReplyAssist: false,
});
const logger = makeLogger();
@@ -133,7 +132,6 @@ describe("context-engine commitOVSession()", () => {
baseUrl: "http://127.0.0.1:1933",
autoCapture: false,
autoRecall: false,
- ingestReplyAssist: false,
bypassSessionPatterns: ["agent:*:cron:**"],
});
const logger = makeLogger();
@@ -167,7 +165,6 @@ describe("context-engine compact()", () => {
baseUrl: "http://127.0.0.1:1933",
autoCapture: false,
autoRecall: false,
- ingestReplyAssist: false,
bypassSessionPatterns: ["agent:*:cron:**"],
});
const logger = makeLogger();
diff --git a/examples/openclaw-plugin/tests/ut/local-startup-bad-config-real.test.ts b/examples/openclaw-plugin/tests/ut/local-startup-bad-config-real.test.ts
index 7a69e0cd3..7ddac2110 100644
--- a/examples/openclaw-plugin/tests/ut/local-startup-bad-config-real.test.ts
+++ b/examples/openclaw-plugin/tests/ut/local-startup-bad-config-real.test.ts
@@ -48,7 +48,6 @@ describe("local OpenViking startup with a bad config", () => {
autoCapture: true,
autoRecall: true,
configPath: badConfigPath,
- ingestReplyAssist: false,
logFindRequests: false,
mode: "local",
port: 19439,
diff --git a/examples/openclaw-plugin/tests/ut/local-startup-failure.test.ts b/examples/openclaw-plugin/tests/ut/local-startup-failure.test.ts
index 2049dee85..44e83c565 100644
--- a/examples/openclaw-plugin/tests/ut/local-startup-failure.test.ts
+++ b/examples/openclaw-plugin/tests/ut/local-startup-failure.test.ts
@@ -95,7 +95,6 @@ describe("local OpenViking startup failure", () => {
autoCapture: true,
autoRecall: true,
configPath: "/tmp/openclaw-ovbug/bad-ov.conf",
- ingestReplyAssist: false,
logFindRequests: false,
mode: "local",
port: 19433,
diff --git a/examples/openclaw-plugin/tests/ut/plugin-bypass-session-patterns.test.ts b/examples/openclaw-plugin/tests/ut/plugin-bypass-session-patterns.test.ts
index 88e2e61d3..3eb18ae63 100644
--- a/examples/openclaw-plugin/tests/ut/plugin-bypass-session-patterns.test.ts
+++ b/examples/openclaw-plugin/tests/ut/plugin-bypass-session-patterns.test.ts
@@ -24,7 +24,6 @@ function setupPlugin(pluginConfig?: Record<string, unknown>) {
baseUrl: "http://127.0.0.1:1933",
autoCapture: true,
autoRecall: true,
- ingestReplyAssist: true,
...pluginConfig,
},
registerContextEngine,
diff --git a/examples/openclaw-plugin/tests/ut/plugin-normal-flow-real-server.test.ts b/examples/openclaw-plugin/tests/ut/plugin-normal-flow-real-server.test.ts
index 47f2b169d..c84c9b129 100644
--- a/examples/openclaw-plugin/tests/ut/plugin-normal-flow-real-server.test.ts
+++ b/examples/openclaw-plugin/tests/ut/plugin-normal-flow-real-server.test.ts
@@ -201,7 +201,6 @@ describe("plugin normal flow with healthy backend", () => {
autoRecall: true,
baseUrl,
commitTokenThreshold: 20000,
- ingestReplyAssist: false,
mode: "remote",
},
registerContextEngine: (_id, factory) => {
diff --git a/examples/openclaw-plugin/tests/ut/text-utils.test.ts b/examples/openclaw-plugin/tests/ut/text-utils.test.ts
index efc7352c9..4dc93431c 100644
--- a/examples/openclaw-plugin/tests/ut/text-utils.test.ts
+++ b/examples/openclaw-plugin/tests/ut/text-utils.test.ts
@@ -3,7 +3,6 @@ import { describe, expect, it } from "vitest";
import {
sanitizeUserTextForCapture,
getCaptureDecision,
- isTranscriptLikeIngest,
extractNewTurnTexts,
extractLatestUserText,
pickRecentUniqueTexts,
@@ -132,47 +131,6 @@ describe("getCaptureDecision", () => {
});
});
-describe("isTranscriptLikeIngest", () => {
- it("multi-speaker transcript → shouldAssist=true", () => {
- const text = "张三: 你好,今天项目进展如何?\n李四: 进展不错,基本完成了核心模块的开发工作\n张三: 很好,那我们下周可以开始测试了";
- const result = isTranscriptLikeIngest(text, { minSpeakerTurns: 2, minChars: 50 });
- expect(result.shouldAssist).toBe(true);
- expect(result.reason).toBe("transcript_like_ingest");
- expect(result.speakerTurns).toBeGreaterThanOrEqual(2);
- });
-
- it("single short text → shouldAssist=false", () => {
- const result = isTranscriptLikeIngest("hello", { minSpeakerTurns: 2, minChars: 50 });
- expect(result.shouldAssist).toBe(false);
- });
-
- it("empty text → shouldAssist=false", () => {
- const result = isTranscriptLikeIngest("", { minSpeakerTurns: 2, minChars: 50 });
- expect(result.shouldAssist).toBe(false);
- expect(result.reason).toBe("empty_text");
- });
-
- it("command text → shouldAssist=false", () => {
- const result = isTranscriptLikeIngest("/reset all the things and clear memory", { minSpeakerTurns: 2, minChars: 10 });
- expect(result.shouldAssist).toBe(false);
- expect(result.reason).toBe("command_text");
- });
-
- it("text below minChars → shouldAssist=false", () => {
- const text = "Alice: hi\nBob: hello";
- const result = isTranscriptLikeIngest(text, { minSpeakerTurns: 2, minChars: 200 });
- expect(result.shouldAssist).toBe(false);
- expect(result.reason).toBe("chars_below_threshold");
- });
-
- it("insufficient speaker turns → shouldAssist=false", () => {
- const text = "这是一段很长的文本,但只有一个人在说话,没有任何说话人标签,只是纯粹的描述文字,超过了最小字符数要求";
- const result = isTranscriptLikeIngest(text, { minSpeakerTurns: 2, minChars: 10 });
- expect(result.shouldAssist).toBe(false);
- expect(result.reason).toBe("speaker_turns_below_threshold");
- });
-});
-
describe("extractNewTurnTexts", () => {
it("extracts user + assistant text messages", () => {
const messages = [
diff --git a/examples/openclaw-plugin/tests/ut/tools.test.ts b/examples/openclaw-plugin/tests/ut/tools.test.ts
index fb5edbd96..40a615968 100644
--- a/examples/openclaw-plugin/tests/ut/tools.test.ts
+++ b/examples/openclaw-plugin/tests/ut/tools.test.ts
@@ -84,7 +84,6 @@ function setupPlugin(clientOverrides?: Record<string, unknown>) {
baseUrl: "http://127.0.0.1:1933",
autoCapture: false,
autoRecall: false,
- ingestReplyAssist: false,
},
logger: {
info: vi.fn(),
diff --git a/examples/openclaw-plugin/text-utils.ts b/examples/openclaw-plugin/text-utils.ts
index 6a33f6ada..7babeb904 100644
--- a/examples/openclaw-plugin/text-utils.ts
+++ b/examples/openclaw-plugin/text-utils.ts
@@ -27,8 +27,6 @@ const SUBAGENT_CONTEXT_RE = /^\s*\[Subagent Context\]/i;
const MEMORY_INTENT_RE = /记住|记下|remember|save|store|偏好|preference|规则|rule|事实|fact/i;
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;
-
export const CAPTURE_LIMIT = 3;
function resolveCaptureMinLength(text: string): number {
@@ -88,14 +86,6 @@ export function looksLikeQuestionOnlyText(text: string): boolean {
return true;
}
-export type TranscriptLikeIngestDecision = {
- shouldAssist: boolean;
- reason: string;
- normalizedText: string;
- speakerTurns: number;
- chars: number;
-};
-
export function compileSessionPattern(pattern: string): RegExp {
const escaped = pattern
.replace(/[.+^${}()|[\]\\]/g, "\\$&")
@@ -142,113 +132,6 @@ export function shouldBypassSession(
return matchesSessionPattern(candidate, patterns);
}
-export function shouldSkipIngestReplyAssistSession(
- params: {
- sessionId?: string;
- sessionKey?: string;
- },
- patterns: RegExp[],
-): boolean {
- return shouldBypassSession(params, patterns);
-}
-
-function countSpeakerTurns(text: string): number {
- let count = 0;
- for (const _match of text.matchAll(SPEAKER_TAG_RE)) {
- count += 1;
- }
- return count;
-}
-
-export function isTranscriptLikeIngest(
- text: string,
- options: {
- minSpeakerTurns: number;
- minChars: number;
- },
-): TranscriptLikeIngestDecision {
- const normalizedText = sanitizeUserTextForCapture(text.trim());
- if (!normalizedText) {
- return {
- shouldAssist: false,
- reason: "empty_text",
- normalizedText,
- speakerTurns: 0,
- chars: 0,
- };
- }
-
- if (COMMAND_TEXT_RE.test(normalizedText)) {
- return {
- shouldAssist: false,
- reason: "command_text",
- normalizedText,
- speakerTurns: 0,
- chars: normalizedText.length,
- };
- }
-
- if (SUBAGENT_CONTEXT_RE.test(normalizedText)) {
- return {
- shouldAssist: false,
- reason: "subagent_context",
- normalizedText,
- speakerTurns: 0,
- chars: normalizedText.length,
- };
- }
-
- if (NON_CONTENT_TEXT_RE.test(normalizedText)) {
- return {
- shouldAssist: false,
- reason: "non_content_text",
- normalizedText,
- speakerTurns: 0,
- chars: normalizedText.length,
- };
- }
-
- if (looksLikeQuestionOnlyText(normalizedText)) {
- return {
- shouldAssist: false,
- reason: "question_text",
- normalizedText,
- speakerTurns: 0,
- chars: normalizedText.length,
- };
- }
-
- const chars = normalizedText.length;
- if (chars < options.minChars) {
- return {
- shouldAssist: false,
- reason: "chars_below_threshold",
- normalizedText,
- speakerTurns: 0,
- chars,
- };
- }
-
- const speakerTurns = countSpeakerTurns(normalizedText);
- if (speakerTurns < options.minSpeakerTurns) {
- return {
- shouldAssist: false,
- reason: "speaker_turns_below_threshold",
- normalizedText,
- speakerTurns,
- chars,
- };
- }
-
- return {
- shouldAssist: true,
- reason: "transcript_like_ingest",
- normalizedText,
- speakerTurns,
- chars,
- };
-}
-
function normalizeDedupeText(text: string): string {
return text.toLowerCase().replace(/\s+/g, " ").trim();
}