mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
# v0.5.3 (2026-06-18)
## Fixes - **Kiro**: honor thinking effort budgets - **AG/Kiro/Xiaomi**: provider fixes - **Combo/Fusion**: flatten tool history in panel calls to prevent 503 - **LLM selector**: show custom vision models in selector and model list - **Image**: prevent compatible nodes from shadowing provider aliases
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
import { describe, it, expect, beforeEach } from "vitest";
|
||||
import { resolveSessionId, deriveSessionId, clearSessionStore } from "../../open-sse/utils/sessionManager.js";
|
||||
|
||||
// Assistant text must exceed ASSISTANT_MIN_LEN (50) to trigger sticky hash path.
|
||||
// Assistant text must reach ASSISTANT_MIN_LEN (80) to use assistant anchor; else first user message.
|
||||
const longAssistant = "x".repeat(80);
|
||||
const bodyWithAssistant = { messages: [{ role: "assistant", content: longAssistant }] };
|
||||
const bodyWithUserOnly = { messages: [{ role: "user", content: "hello from first user message anchor" }] };
|
||||
|
||||
beforeEach(() => clearSessionStore());
|
||||
|
||||
@@ -26,6 +27,18 @@ describe("resolveSessionId", () => {
|
||||
expect(a).not.toBe(b);
|
||||
});
|
||||
|
||||
it("first user message anchor when assistant text below cap", () => {
|
||||
const opts = { body: bodyWithUserOnly, connectionId: "conn1", scope: "codex" };
|
||||
expect(resolveSessionId(opts)).toBe(resolveSessionId(opts));
|
||||
});
|
||||
|
||||
it("assistant anchor wins once assistant text reaches cap", () => {
|
||||
const shortAssistant = { messages: [{ role: "user", content: "same user" }, { role: "assistant", content: "y".repeat(80) }] };
|
||||
const a = resolveSessionId({ body: shortAssistant, connectionId: "conn1", scope: "codex" });
|
||||
const b = resolveSessionId({ body: shortAssistant, connectionId: "conn1", scope: "codex" });
|
||||
expect(a).toBe(b);
|
||||
});
|
||||
|
||||
it("fallback: empty body+no header+no workspaceId -> deriveSessionId(connectionId)", () => {
|
||||
const got = resolveSessionId({ body: {}, connectionId: "connFallback" });
|
||||
expect(got).toBe(deriveSessionId("connFallback"));
|
||||
|
||||
Reference in New Issue
Block a user