diff --git a/src/server/dsh-compaction-guard.ts b/src/server/dsh-compaction-guard.ts index 93eb0f3b28..505bd8003a 100644 --- a/src/server/dsh-compaction-guard.ts +++ b/src/server/dsh-compaction-guard.ts @@ -265,7 +265,8 @@ export type Refusal = { status: number; body: unknown }; const REFUSAL_MESSAGE = `dsh native compaction call refused by billion-context: bili owns compression on this lane (#1729, cf. #1772/#1206). ` + `A landed dsh compaction checkpoint durably shadows the raw conversation history, which destroys the proxy's compression substrate. ` + - `To run dsh native compaction on this lane anyway, opt in explicitly: "allowDshCompaction": true in the bili config or env BILI_ALLOW_DSH_COMPACTION=1 (#2028).`; + `No action is needed: your conversation is intact and bili compresses automatically as turns grow too large — if the session is currently over its window, it starts folding on the next turn (#3453). ` + + `If you still want dsh native compaction on this lane, opt in explicitly: "allowDshCompaction": true in the bili config or env BILI_ALLOW_DSH_COMPACTION=1 (#2028).`; /** Protocol-shaped refusal body (mirrors the #554 side-request guard shape so * clients render it natively). 422: a policy refusal of this one request — not diff --git a/tests/dsh-compaction-guard.test.ts b/tests/dsh-compaction-guard.test.ts index d0de9e2e9b..a8d68c774a 100644 --- a/tests/dsh-compaction-guard.test.ts +++ b/tests/dsh-compaction-guard.test.ts @@ -185,6 +185,11 @@ test("refusal bodies carry the marker reason and are non-retryable", () => { assert.equal(openai.status, 422); assert.equal(openai.body.error.retryable, false); assert.match(openai.body.error.message, /#1729/); + // #3499: the refusal must tell the user what to do INSTEAD (keep using the + // lane; over-window sessions fold on the next turn), not only how to force + // the refused behavior — the incident user read the bare opt-in as "the fix". + assert.match(openai.body.error.message, /No action is needed/); + assert.match(openai.body.error.message, /starts folding on the next turn/); const anthropic = dshCompactionRefusal("anthropic") as { status: number; body: { error: { message: string } } }; assert.equal(anthropic.status, 422); assert.match(anthropic.body.error.message, /durably/);