fix: portal stability, session list DB fallback, and UX polish
- Free stale Memind listeners on 8081 before startup and exit cleanly on EADDRINUSE - Backfill owned sessions missing from Goose via h5_conversation_messages summaries - Strip Memind task orchestration prefixes from user-facing chat text - Repair missing public docx links before release MindSpace link checks Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import { stripKnownChatSkillPrompt } from './chat-skills.mjs';
|
||||
*/
|
||||
|
||||
export const TASK_ROUTING_HINT_RE = /^【TKMind 路由提示】[\s\S]*?\n\n/;
|
||||
export const MEMIND_TASK_ORCHESTRATION_RE = /^【Memind 任务编排】[\s\S]*?(?:用户任务:|用户任务:)\s*/u;
|
||||
export const MINDSPACE_CONTEXT_RE = /^\[MindSpace 上下文\][\s\S]*?\n\n/;
|
||||
const USER_IDENTITY_BLOCK_RE = /^\[用户身份\][\s\S]*?\n\n/;
|
||||
|
||||
@@ -17,6 +18,10 @@ export function stripTaskRoutingHint(text) {
|
||||
return String(text ?? '').replace(TASK_ROUTING_HINT_RE, '').trimStart();
|
||||
}
|
||||
|
||||
export function stripMemindTaskOrchestrationPrefix(text) {
|
||||
return String(text ?? '').replace(MEMIND_TASK_ORCHESTRATION_RE, '').trimStart();
|
||||
}
|
||||
|
||||
export function stripMindSpaceContextPrefix(text) {
|
||||
let next = String(text ?? '');
|
||||
while (MINDSPACE_CONTEXT_RE.test(next)) {
|
||||
@@ -60,6 +65,7 @@ export function deriveUserFacingText(text) {
|
||||
let next = String(text ?? '');
|
||||
next = stripUserIdentityPrefix(next);
|
||||
next = stripTaskRoutingHint(next);
|
||||
next = stripMemindTaskOrchestrationPrefix(next);
|
||||
next = stripMindSpaceContextPrefix(next);
|
||||
next = stripKnownChatSkillPrompt(next);
|
||||
return next.trim();
|
||||
|
||||
Reference in New Issue
Block a user