fix(web): type the history lookup used by task resume
The chat window hook only exposed refresh helpers, so the continue path did not type-check after it started reading history bubbles. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import { fetchChatTurnStatus } from '../api/chatTurn';
|
||||
import { mapTaskStatusToMessageStatus } from '../api/chatWindow';
|
||||
import { listProjectWorkflowDocuments } from '../api/projectDocuments';
|
||||
import { createTaskRun, getTaskRun, resumeTaskRun, subscribeTaskRunEvents } from '../api/taskRuns';
|
||||
import { buildResumeRequest, buildTaskRequest, streamTask } from '../api/taskStream';
|
||||
import { buildTaskRequest, streamTask } from '../api/taskStream';
|
||||
import { applyPhaseEvent } from '../engine/phaseEventMapper';
|
||||
import { resolveTaskTemplateForMessage } from '../engine/templateMatch';
|
||||
import { GOVERNANCE_BLOCKED_HINT, isBlockedGovernanceStatus } from '../lib/blockedGovernanceCopy';
|
||||
@@ -76,6 +76,8 @@ export interface TaskRunAttemptsInput {
|
||||
chatWindow: {
|
||||
replaceMessageServerId: (tempId: string, serverId: number) => void;
|
||||
refresh: () => Promise<void>;
|
||||
allMessages: ChatMessage[];
|
||||
updateLiveMessage: (id: string, patch: Partial<ChatMessage>) => void;
|
||||
};
|
||||
setMessages: Dispatch<SetStateAction<ChatMessage[]>>;
|
||||
setDeliverables: Dispatch<SetStateAction<DeliverableItem[]>>;
|
||||
@@ -604,10 +606,7 @@ export function useTaskRunAttempts(input: TaskRunAttemptsInput) {
|
||||
return;
|
||||
}
|
||||
|
||||
const body =
|
||||
mode === 'resume' && opts?.workDir
|
||||
? buildResumeRequest(task, opts.workDir)
|
||||
: buildTaskRequest(task);
|
||||
const body = buildTaskRequest(task);
|
||||
|
||||
if (task.sessionId && task.projectId && task.projectId > 0 && mode === 'run') {
|
||||
// 断线重试:显式 reconnectRunId 保留;禁止 setMessages updater 取 runId
|
||||
|
||||
Reference in New Issue
Block a user