fix(session): propagate network context
This commit is contained in:
@@ -17,6 +17,7 @@ export type SessionBinding = {
|
||||
export type SessionContext = {
|
||||
clientSessionId: string;
|
||||
accessToken?: string;
|
||||
network?: string;
|
||||
projectId?: string;
|
||||
tokenExpiresAt?: string;
|
||||
userId?: string;
|
||||
@@ -36,6 +37,7 @@ export class ChatSessionBridge {
|
||||
async resolve(context: {
|
||||
sessionId?: string;
|
||||
accessToken?: string;
|
||||
network?: string;
|
||||
projectId?: string;
|
||||
traceId?: string;
|
||||
tokenExpiresAt?: string;
|
||||
@@ -71,6 +73,7 @@ export class ChatSessionBridge {
|
||||
allowLearningWrite: true,
|
||||
clientSessionId: requestContext.clientSessionId,
|
||||
learningMode: "interactive",
|
||||
network: requestContext.network,
|
||||
projectId: requestContext.projectId,
|
||||
projectKey: requestContext.projectKey,
|
||||
sessionId,
|
||||
@@ -144,6 +147,7 @@ export class ChatSessionBridge {
|
||||
private buildRequestContext(context: {
|
||||
sessionId?: string;
|
||||
accessToken?: string;
|
||||
network?: string;
|
||||
projectId?: string;
|
||||
traceId?: string;
|
||||
tokenExpiresAt?: string;
|
||||
@@ -154,6 +158,7 @@ export class ChatSessionBridge {
|
||||
clientSessionId: sessionId || this.createClientSessionId(),
|
||||
accessToken: context.accessToken,
|
||||
actorKey: toActorKey(context.userId),
|
||||
network: context.network,
|
||||
projectId: context.projectId,
|
||||
projectKey: toProjectKey(context.projectId),
|
||||
tokenExpiresAt: context.tokenExpiresAt,
|
||||
|
||||
Reference in New Issue
Block a user