feat: map codex thread collaboration progress

This commit is contained in:
AI Bot
2026-06-01 17:52:29 +08:00
parent defa3da185
commit 2a5dccf5cb
11 changed files with 317 additions and 7 deletions

View File

@@ -232,6 +232,13 @@ export interface ExecutionProgressCompaction {
message?: string;
}
export interface ExecutionProgressThreadCollaboration {
tool?: string;
status: string;
target?: string;
agentStatus?: string;
}
export interface ExecutionProgressSnapshot {
taskId: string;
projectId: string;
@@ -261,6 +268,7 @@ export interface ExecutionProgressSnapshot {
threadGoal?: ExecutionProgressThreadGoal;
threadSettings?: ExecutionProgressThreadSettings;
compaction?: ExecutionProgressCompaction;
threadCollaboration?: ExecutionProgressThreadCollaboration;
updatedAt: string;
}
@@ -283,6 +291,12 @@ export interface ExecutionProgressInput {
threadGoal?: Partial<ExecutionProgressThreadGoal>;
threadSettings?: Partial<ExecutionProgressThreadSettings> & { cwd?: unknown };
compaction?: Partial<ExecutionProgressCompaction> & { turnId?: unknown };
threadCollaboration?: Partial<ExecutionProgressThreadCollaboration> & {
senderThreadId?: unknown;
receiverThreadId?: unknown;
newThreadId?: unknown;
prompt?: unknown;
};
}
export interface ForwardSource {
@@ -3967,6 +3981,9 @@ function normalizeExecutionProgressSnapshot(raw: Partial<ExecutionProgressSnapsh
threadGoal: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadGoal(raw.threadGoal),
threadSettings: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadSettings(raw.threadSettings),
compaction: nativeRemoteControl ? undefined : normalizeExecutionProgressCompaction(raw.compaction),
threadCollaboration: nativeRemoteControl
? undefined
: normalizeExecutionProgressThreadCollaboration(raw.threadCollaboration),
updatedAt: raw.updatedAt ?? nowIso(),
};
}
@@ -5723,6 +5740,23 @@ function normalizeExecutionProgressCompaction(
};
}
function normalizeExecutionProgressThreadCollaboration(
input?: ExecutionProgressInput["threadCollaboration"],
): ExecutionProgressThreadCollaboration | undefined {
if (!input) {
return undefined;
}
const collaboration: ExecutionProgressThreadCollaboration = {
tool: safeExecutionProgressText(input.tool) || undefined,
status: safeExecutionProgressText(input.status) || "running",
target: safeExecutionProgressText(input.target) || undefined,
agentStatus: safeExecutionProgressText(input.agentStatus) || undefined,
};
return Object.values(collaboration).some((value) => value !== undefined && value !== "")
? collaboration
: undefined;
}
function defaultExecutionProgressStepTexts(task: Pick<MasterAgentTask, "taskType" | "relayViaMasterAgent">) {
if (task.taskType === "browser_control") {
return [
@@ -5871,6 +5905,9 @@ function buildExecutionProgressSnapshot(
threadGoal: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadGoal(input?.threadGoal),
threadSettings: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadSettings(input?.threadSettings),
compaction: nativeRemoteControl ? undefined : normalizeExecutionProgressCompaction(input?.compaction),
threadCollaboration: nativeRemoteControl
? undefined
: normalizeExecutionProgressThreadCollaboration(input?.threadCollaboration),
updatedAt: nowIso(),
};
}