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:
Severian
2026-09-11 06:06:36 +08:00
parent bf74a85fec
commit a8b3669c17
3 changed files with 58 additions and 20 deletions
+29 -8
View File
@@ -74,15 +74,36 @@ export function userFacingMessage(error: unknown): string {
}
/**
* The one failure a user can act on: Janitor cut the card short because the
* bot is bigger than their context size, so the markers sucker reads are gone.
* The two markers sucker reads map one-to-one onto the two steps the
* instructions mark REQUIRED, so a missing one names the setting that is not
* coming through rather than sending people back to re-read everything.
*
* Truncation produces the same symptom — Janitor cuts a card bigger than the
* context size and takes the markers with it — so it is named too, second,
* because it only applies once the settings really are right.
*/
export const TRUNCATED_CARD = new SuckerError(
"The card came through incomplete — the markers sucker looks for are not in " +
"it. That usually means the bot is larger than your context size and " +
"Janitor cut it short, so raise Context Size in Generation Settings and " +
`try again. If it is already generous, re-read the directions on sucker, and ${CONTACT} if it still will not go.`
);
export function missingSetup(hasPrompt: boolean, hasPersona: boolean): SuckerError {
const PROMPT = "your custom prompt is not coming through as <.> — set it in your API settings";
const PERSONA =
"your persona is not coming through — it needs the name {{user}} and a description of just a dot";
let what: string;
if (!hasPrompt && !hasPersona) {
what =
"neither of the two required settings came through: the custom prompt " +
"has to be <.>, and your persona needs the name {{user}} with a " +
"description of just a dot";
} else {
what = hasPrompt ? PERSONA : PROMPT;
}
return new SuckerError(
`Sucker could not read that card: ${what}. Save it, then refresh Janitor — ` +
"the settings page, not sucker. If it is already set that way, the bot is " +
"probably bigger than your context size and Janitor cut the card short, " +
`so raise Context Size in Generation Settings. Still stuck: ${CONTACT}.`
);
}
// None of these can happen through Janitor. They exist so that if one ever
// does, the reply is honest about whose problem it is and the report says