Stop giving advice for situations nobody can cause

The previous commit split failures into explained and unexplained, but the
split that matters is fixable and not. A request with no card, no greeting,
or nothing in it cannot come out of Janitor. Telling someone to "open the
chat until the bot's first message shows" is the dingus message wearing a
new coat: instructions for something they did not do and cannot undo.

Only the truncated card is a user's to fix, so only it is shown verbatim,
with the context-size advice. The rest are ImpossibleRequest now: the reply
says plainly that it is not their fault and there is nothing for them to
fix, and asks them to report it, carrying a short tag so the report says
which assumption broke rather than expecting the user to explain it.

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:00:23 +08:00
parent 94d43dbb9d
commit bf74a85fec
3 changed files with 100 additions and 60 deletions
+2 -2
View File
@@ -342,10 +342,10 @@ export async function POST(request: NextRequest) {
if (!body.messages || body.messages.length < 2) {
if (isStreamingRequest) {
return createSSEErrorResponse(TOO_FEW_MESSAGES.message);
return createSSEErrorResponse(userFacingMessage(TOO_FEW_MESSAGES));
}
return NextResponse.json(
{ error: TOO_FEW_MESSAGES.message },
{ error: userFacingMessage(TOO_FEW_MESSAGES) },
{
status: 400,
headers: {