mirror of
https://github.com/severian-dev/sucker.severian.dev.git
synced 2026-10-18 01:20:29 +00:00
Name the setting that did not come through
The instructions mark exactly two steps REQUIRED, and the two markers sucker looks for are those two steps. So a failure can say which one is missing — the custom prompt, the persona, or both — instead of sending someone back to re-read a page they have already followed. Truncation causes the same symptom, so it is still named, but second: it only applies once the settings really are set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NX2SsmUqQftWTZAY4BDuFa
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
NO_CARD,
|
||||
NO_GREETING,
|
||||
TOO_FEW_MESSAGES,
|
||||
TRUNCATED_CARD,
|
||||
missingSetup,
|
||||
userFacingMessage,
|
||||
} from "@/lib/errors";
|
||||
|
||||
@@ -165,11 +165,12 @@ function extractCardData(messages: Message[]): ExtractedCard {
|
||||
`Name extraction: user="${nameFromUser}", inferred="${inferredName}", tracking="${cleanTrackingName}", display="${displayName}"`
|
||||
);
|
||||
|
||||
if (
|
||||
!content.includes("<.>") ||
|
||||
!content.includes("<UserPersona>.</UserPersona>")
|
||||
) {
|
||||
throw TRUNCATED_CARD;
|
||||
// Each marker is one of the two REQUIRED steps in the instructions, so the
|
||||
// error can name the one that did not arrive.
|
||||
const hasPrompt = content.includes("<.>");
|
||||
const hasPersona = content.includes("<UserPersona>.</UserPersona>");
|
||||
if (!hasPrompt || !hasPersona) {
|
||||
throw missingSetup(hasPrompt, hasPersona);
|
||||
}
|
||||
|
||||
content = content.replace("<.>", "");
|
||||
|
||||
Reference in New Issue
Block a user