mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-05 12:34:35 +08:00
Merge pull request #35 from huangzhenhao90/fix/opencode-go-session-header
fix(ai): 修复 OpenCode Go 缺少会话 header 导致日报生成失败
This commit is contained in:
@@ -95,6 +95,7 @@ interface UseGroupReportGenerationArgs {
|
||||
}
|
||||
|
||||
interface PreparedReportContext {
|
||||
sessionId: string
|
||||
input: Awaited<ReturnType<typeof buildGroupReportInput>>
|
||||
startedAt: number
|
||||
logs: ReportGenerationLog[]
|
||||
@@ -507,6 +508,7 @@ export function useGroupReportGeneration({
|
||||
const result = await trackStep(`AI 生成(${selectedModel.model})`, () =>
|
||||
withTimeout(
|
||||
window.api.aiChat(aiMessages, {
|
||||
sessionId: context.sessionId,
|
||||
providerId: selectedModel.providerId,
|
||||
modelId: selectedModel.model,
|
||||
timeoutMs: reportTimeoutSeconds * 1000
|
||||
@@ -560,6 +562,7 @@ export function useGroupReportGeneration({
|
||||
const repairResult = await trackStep(`AI 修复 JSON(${selectedModel.model})`, () =>
|
||||
withTimeout(
|
||||
window.api.aiChat(repairMessages, {
|
||||
sessionId: context.sessionId,
|
||||
providerId: selectedModel.providerId,
|
||||
modelId: selectedModel.model,
|
||||
timeoutMs: reportTimeoutSeconds * 1000
|
||||
@@ -792,7 +795,12 @@ export function useGroupReportGeneration({
|
||||
imageInsightsInjectedIntoPrompt:
|
||||
input.imageInsightSummary.succeeded > 0 && input.prompt.includes('AI 图片识别摘要:')
|
||||
})
|
||||
const context: PreparedReportContext = { input, startedAt: startGenerateTime, logs }
|
||||
const context: PreparedReportContext = {
|
||||
sessionId: crypto.randomUUID(),
|
||||
input,
|
||||
startedAt: startGenerateTime,
|
||||
logs
|
||||
}
|
||||
preparedContextRef.current = context
|
||||
if (input.imageInsightSummary.failed > 0) {
|
||||
setPreparationProgress({
|
||||
|
||||
Reference in New Issue
Block a user