mirror of
https://github.com/severian-dev/sucker.severian.dev.git
synced 2026-10-18 01:20:29 +00:00
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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user