Fix 3qfx task context fallback
This commit is contained in:
1 parent
9572b66ecb
commit
c978a25b7f
3 files changed
+34
-5
No files matched your search
@@ -60,7 +60,12 @@ function useChatsBase(taskBase: string): {
|
||||
const { agent_id } = useParams<{ agent_id: string }>();
|
||||
const agentId = agent_id ?? "";
|
||||
const ctx = readTaskContext();
|
||||
const taskId = ctx?.taskId ?? "";
|
||||
const detail = readCopTaskDetail();
|
||||
const fallbackTaskId =
|
||||
detail?.id == null ? "" : String(detail.id).trim();
|
||||
// 3qfx 偶发会出现 task context 丢失,但任务详情仍在 sessionStorage 的情况。
|
||||
// 这里回退到任务详情里的 taskId,避免左侧对话列表直接失效成“空任务态”。
|
||||
const taskId = ctx?.taskId ?? fallbackTaskId;
|
||||
const actionId = ctx?.partitionByAction ? (ctx.actionId ?? "") : "";
|
||||
return { taskId, agentId, actionId, chatsBase: `${taskBase}/agent/${agentId}/chats` };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user