feat: sync codex thread goals

This commit is contained in:
AI Bot
2026-06-03 14:21:27 +08:00
parent cc31b0d836
commit 0186ef7057
11 changed files with 397 additions and 2 deletions

View File

@@ -488,6 +488,7 @@ export type ComputerControlIntentCategory =
| "thread_archive"
| "thread_unarchive"
| "thread_rename"
| "thread_goal_sync"
| "browser_control"
| "desktop_control";
export type ComputerControlRuntimeKind =
@@ -1357,6 +1358,10 @@ export interface MasterAgentTask {
threadLifecycleReason?: string;
threadRenameName?: string;
threadRenameReason?: string;
threadGoalObjective?: string;
threadGoalStatus?: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
threadGoalTokenBudget?: number;
threadGoalReason?: string;
intentCategory?: ComputerControlIntentCategory;
runtimeKind?: ComputerControlRuntimeKind;
controlPlatform?: ComputerControlPlatform;
@@ -4752,6 +4757,21 @@ export function migrateBossState(raw: Partial<BossState> | undefined): BossState
threadLifecycleReason: trimToDefined(task.threadLifecycleReason),
threadRenameName: trimToDefined(task.threadRenameName),
threadRenameReason: trimToDefined(task.threadRenameReason),
threadGoalObjective: trimToDefined(task.threadGoalObjective),
threadGoalStatus:
task.threadGoalStatus === "active" ||
task.threadGoalStatus === "paused" ||
task.threadGoalStatus === "blocked" ||
task.threadGoalStatus === "usageLimited" ||
task.threadGoalStatus === "budgetLimited" ||
task.threadGoalStatus === "complete"
? task.threadGoalStatus
: undefined,
threadGoalTokenBudget:
Number.isFinite(Number(task.threadGoalTokenBudget)) && Number(task.threadGoalTokenBudget) > 0
? Math.floor(Number(task.threadGoalTokenBudget))
: undefined,
threadGoalReason: trimToDefined(task.threadGoalReason),
intentCategory:
task.intentCategory === "discussion_only" ||
task.intentCategory === "project_development" ||
@@ -4761,6 +4781,7 @@ export function migrateBossState(raw: Partial<BossState> | undefined): BossState
task.intentCategory === "thread_archive" ||
task.intentCategory === "thread_unarchive" ||
task.intentCategory === "thread_rename" ||
task.intentCategory === "thread_goal_sync" ||
task.intentCategory === "browser_control" ||
task.intentCategory === "desktop_control"
? task.intentCategory
@@ -8832,6 +8853,10 @@ export async function queueMasterAgentTask(payload: {
threadLifecycleReason?: string;
threadRenameName?: string;
threadRenameReason?: string;
threadGoalObjective?: string;
threadGoalStatus?: "active" | "paused" | "blocked" | "usageLimited" | "budgetLimited" | "complete";
threadGoalTokenBudget?: number;
threadGoalReason?: string;
intentCategory?: ComputerControlIntentCategory;
runtimeKind?: ComputerControlRuntimeKind;
controlPlatform?: ComputerControlPlatform;
@@ -8906,6 +8931,21 @@ export async function queueMasterAgentTask(payload: {
threadLifecycleReason: trimToDefined(payload.threadLifecycleReason),
threadRenameName: trimToDefined(payload.threadRenameName),
threadRenameReason: trimToDefined(payload.threadRenameReason),
threadGoalObjective: trimToDefined(payload.threadGoalObjective),
threadGoalStatus:
payload.threadGoalStatus === "active" ||
payload.threadGoalStatus === "paused" ||
payload.threadGoalStatus === "blocked" ||
payload.threadGoalStatus === "usageLimited" ||
payload.threadGoalStatus === "budgetLimited" ||
payload.threadGoalStatus === "complete"
? payload.threadGoalStatus
: undefined,
threadGoalTokenBudget:
Number.isFinite(Number(payload.threadGoalTokenBudget)) && Number(payload.threadGoalTokenBudget) > 0
? Math.floor(Number(payload.threadGoalTokenBudget))
: undefined,
threadGoalReason: trimToDefined(payload.threadGoalReason),
intentCategory: payload.intentCategory,
runtimeKind: payload.runtimeKind,
controlPlatform: payload.controlPlatform,