mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:21:37 +00:00
test(session): cover internal route without external fallback
This commit is contained in:
@@ -1539,6 +1539,25 @@ describe("initSessionState internal channel routing preservation", () => {
|
|||||||
expect(result.sessionEntry.deliveryContext?.channel).toBe("telegram");
|
expect(result.sessionEntry.deliveryContext?.channel).toBe("telegram");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("keeps internal route when there is no persisted external fallback", async () => {
|
||||||
|
const storePath = await createStorePath("no-external-fallback-");
|
||||||
|
const cfg = { session: { store: storePath } } as OpenClawConfig;
|
||||||
|
|
||||||
|
const result = await initSessionState({
|
||||||
|
ctx: {
|
||||||
|
Body: "handoff only",
|
||||||
|
SessionKey: "agent:main:main",
|
||||||
|
OriginatingChannel: "sessions_send",
|
||||||
|
OriginatingTo: "session:handoff",
|
||||||
|
},
|
||||||
|
cfg,
|
||||||
|
commandAuthorized: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(result.sessionEntry.lastChannel).toBe("sessions_send");
|
||||||
|
expect(result.sessionEntry.lastTo).toBe("session:handoff");
|
||||||
|
});
|
||||||
|
|
||||||
it("keeps webchat channel for webchat/main sessions", async () => {
|
it("keeps webchat channel for webchat/main sessions", async () => {
|
||||||
const storePath = await createStorePath("preserve-webchat-main-");
|
const storePath = await createStorePath("preserve-webchat-main-");
|
||||||
const cfg = { session: { store: storePath } } as OpenClawConfig;
|
const cfg = { session: { store: storePath } } as OpenClawConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user