feat: surface codex windows sandbox progress

This commit is contained in:
AI Bot
2026-06-01 19:16:23 +08:00
parent b0a778ee68
commit 94e0cc8bad
12 changed files with 141 additions and 10 deletions

View File

@@ -205,6 +205,12 @@ export interface ExecutionProgressRemoteControl {
environmentId?: string;
}
export interface ExecutionProgressWindowsSandbox {
status?: string;
setupMode?: string;
error?: string;
}
export interface ExecutionProgressThreadGoal {
objective?: string;
status: string;
@@ -277,6 +283,7 @@ export interface ExecutionProgressSnapshot {
modelVerification?: ExecutionProgressModelVerification;
mcpServers?: ExecutionProgressMcpServer[];
remoteControl?: ExecutionProgressRemoteControl;
windowsSandbox?: ExecutionProgressWindowsSandbox;
threadGoal?: ExecutionProgressThreadGoal;
threadSettings?: ExecutionProgressThreadSettings;
compaction?: ExecutionProgressCompaction;
@@ -302,6 +309,7 @@ export interface ExecutionProgressInput {
modelVerification?: Partial<ExecutionProgressModelVerification> & { turnId?: unknown };
mcpServers?: Array<Partial<ExecutionProgressMcpServer> & { name?: string }>;
remoteControl?: Partial<ExecutionProgressRemoteControl> & { installationId?: unknown };
windowsSandbox?: Partial<ExecutionProgressWindowsSandbox> & { sourcePath?: unknown; samplePaths?: unknown };
threadGoal?: Partial<ExecutionProgressThreadGoal>;
threadSettings?: Partial<ExecutionProgressThreadSettings> & { cwd?: unknown };
compaction?: Partial<ExecutionProgressCompaction> & { turnId?: unknown };
@@ -4007,6 +4015,7 @@ function normalizeExecutionProgressSnapshot(raw: Partial<ExecutionProgressSnapsh
: normalizeExecutionProgressModelVerification(raw.modelVerification),
mcpServers: nativeRemoteControl ? undefined : normalizeExecutionProgressMcpServers(raw.mcpServers),
remoteControl: nativeRemoteControl ? undefined : normalizeExecutionProgressRemoteControl(raw.remoteControl),
windowsSandbox: nativeRemoteControl ? undefined : normalizeExecutionProgressWindowsSandbox(raw.windowsSandbox),
threadGoal: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadGoal(raw.threadGoal),
threadSettings: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadSettings(raw.threadSettings),
compaction: nativeRemoteControl ? undefined : normalizeExecutionProgressCompaction(raw.compaction),
@@ -5418,6 +5427,14 @@ function safeExecutionProgressText(value: unknown, fallback = "") {
return sanitized || fallback;
}
function safeExecutionProgressDiagnosticText(value: unknown, fallback = "") {
const text = safeExecutionProgressText(value, fallback)
.replace(/[A-Za-z]:\\[^\s]+/g, "[path]")
.replace(/\/Users\/[^\s]+/g, "[path]")
.trim();
return text || fallback;
}
function normalizeExecutionProgressStatus(status: unknown): ExecutionProgressStatus {
return status === "running" || status === "completed" || status === "failed" || status === "queued"
? status
@@ -5718,6 +5735,23 @@ function normalizeExecutionProgressRemoteControl(
};
}
function normalizeExecutionProgressWindowsSandbox(
input?: ExecutionProgressInput["windowsSandbox"],
): ExecutionProgressWindowsSandbox | undefined {
if (!input) {
return undefined;
}
const status = safeExecutionProgressText(input.status);
const setupMode = safeExecutionProgressText(input.setupMode);
const error = safeExecutionProgressDiagnosticText(input.error);
const snapshot: ExecutionProgressWindowsSandbox = {
status: status || undefined,
setupMode: setupMode || undefined,
error: error || undefined,
};
return Object.values(snapshot).some((value) => value !== undefined && value !== "") ? snapshot : undefined;
}
function normalizeExecutionProgressThreadGoal(
input?: ExecutionProgressInput["threadGoal"],
): ExecutionProgressThreadGoal | undefined {
@@ -5977,6 +6011,9 @@ function buildExecutionProgressSnapshot(
: normalizeExecutionProgressModelVerification(input?.modelVerification),
mcpServers: nativeRemoteControl ? undefined : normalizeExecutionProgressMcpServers(input?.mcpServers),
remoteControl: nativeRemoteControl ? undefined : normalizeExecutionProgressRemoteControl(input?.remoteControl),
windowsSandbox: nativeRemoteControl
? undefined
: normalizeExecutionProgressWindowsSandbox(input?.windowsSandbox),
threadGoal: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadGoal(input?.threadGoal),
threadSettings: nativeRemoteControl ? undefined : normalizeExecutionProgressThreadSettings(input?.threadSettings),
compaction: nativeRemoteControl ? undefined : normalizeExecutionProgressCompaction(input?.compaction),