match token fix

This commit is contained in:
Severian
2025-10-04 04:55:44 +08:00
parent ff9d5532da
commit b0d5696a3a

View File

@@ -85,7 +85,8 @@ function extractPersonaName(content: string): string | null {
function parseConversationToken(content: string | undefined | null): string | null {
if (!content) return null;
const trimmed = content.trim();
const match = trimmed.match(/^\[sucker:conv=([a-z0-9]+)\]$/i);
// Find token anywhere in the content, not just when the whole string equals the token
const match = trimmed.match(/\[sucker:conv=([a-z0-9]+)\]/i);
if (match) {
return match[1];
}