feat: persist session origin metadata across connectors
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
import { loadConfig } from "../config/config.js";
|
||||
import {
|
||||
resolveMainSessionKeyFromConfig,
|
||||
snapshotSessionOrigin,
|
||||
type SessionEntry,
|
||||
updateSessionStore,
|
||||
} from "../config/sessions.js";
|
||||
@@ -205,6 +206,7 @@ export const handleSessionsBridgeMethods: BridgeMethodHandler = async (
|
||||
contextTokens: entry?.contextTokens,
|
||||
sendPolicy: entry?.sendPolicy,
|
||||
label: entry?.label,
|
||||
origin: snapshotSessionOrigin(entry),
|
||||
displayName: entry?.displayName,
|
||||
chatType: entry?.chatType,
|
||||
channel: entry?.channel,
|
||||
|
||||
@@ -6,6 +6,7 @@ import { stopSubagentsForRequester } from "../../auto-reply/reply/abort.js";
|
||||
import { clearSessionQueues } from "../../auto-reply/reply/queue.js";
|
||||
import { loadConfig } from "../../config/config.js";
|
||||
import {
|
||||
snapshotSessionOrigin,
|
||||
resolveMainSessionKey,
|
||||
type SessionEntry,
|
||||
updateSessionStore,
|
||||
@@ -173,6 +174,7 @@ export const sessionsHandlers: GatewayRequestHandlers = {
|
||||
contextTokens: entry?.contextTokens,
|
||||
sendPolicy: entry?.sendPolicy,
|
||||
label: entry?.label,
|
||||
origin: snapshotSessionOrigin(entry),
|
||||
lastChannel: entry?.lastChannel,
|
||||
lastTo: entry?.lastTo,
|
||||
skillsSnapshot: entry?.skillsSnapshot,
|
||||
|
||||
@@ -381,6 +381,8 @@ export function listSessionsFromStore(params: {
|
||||
const groupChannel = entry?.groupChannel;
|
||||
const space = entry?.space;
|
||||
const id = parsed?.id;
|
||||
const origin = entry?.origin;
|
||||
const originLabel = origin?.label;
|
||||
const displayName =
|
||||
entry?.displayName ??
|
||||
(channel
|
||||
@@ -393,7 +395,8 @@ export function listSessionsFromStore(params: {
|
||||
key,
|
||||
})
|
||||
: undefined) ??
|
||||
entry?.label;
|
||||
entry?.label ??
|
||||
originLabel;
|
||||
const deliveryFields = normalizeSessionDeliveryFields(entry);
|
||||
return {
|
||||
key,
|
||||
@@ -405,6 +408,7 @@ export function listSessionsFromStore(params: {
|
||||
groupChannel,
|
||||
space,
|
||||
chatType: entry?.chatType,
|
||||
origin,
|
||||
updatedAt,
|
||||
sessionId: entry?.sessionId,
|
||||
systemSent: entry?.systemSent,
|
||||
|
||||
@@ -18,6 +18,7 @@ export type GatewaySessionRow = {
|
||||
groupChannel?: string;
|
||||
space?: string;
|
||||
chatType?: NormalizedChatType;
|
||||
origin?: SessionEntry["origin"];
|
||||
updatedAt: number | null;
|
||||
sessionId?: string;
|
||||
systemSent?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user