移除对 copilot 的兼容。更新示例和文档,统一使用 session_id 代替 conversationId
This commit is contained in:
Vendored
+3
-3
@@ -11,7 +11,7 @@ export class ChatSessionBridge {
|
||||
}
|
||||
async resolve(context) {
|
||||
const requestContext = {
|
||||
conversationId: context.conversationId?.trim() || `conv-${randomUUID().slice(0, 12)}`,
|
||||
clientSessionId: context.clientSessionId?.trim() || `agent-${randomUUID().slice(0, 12)}`,
|
||||
accessToken: context.accessToken,
|
||||
projectId: context.projectId,
|
||||
traceId: context.traceId?.trim() || `trace-${randomUUID().slice(0, 12)}`,
|
||||
@@ -27,13 +27,13 @@ export class ChatSessionBridge {
|
||||
}
|
||||
catch (error) {
|
||||
logger.warn({
|
||||
conversationId: requestContext.conversationId,
|
||||
clientSessionId: requestContext.clientSessionId,
|
||||
sessionId: current.sessionId,
|
||||
err: error,
|
||||
}, "existing opencode session lookup failed, creating a new session");
|
||||
}
|
||||
}
|
||||
const session = await this.runtime.createSession(requestContext.conversationId);
|
||||
const session = await this.runtime.createSession(requestContext.clientSessionId);
|
||||
const binding = this.registry.upsert(requestContext, session.id);
|
||||
this.sessionContexts.set(binding.sessionId, requestContext);
|
||||
return { binding, requestContext, created: true };
|
||||
|
||||
Reference in New Issue
Block a user