feat(agent): add support for selecting Codex model and reasoning effort in the canvas agent, retaining choices for subsequent tasks

This commit is contained in:
HouYunFei
2026-07-31 11:03:19 +08:00
parent 3c6af91e8d
commit 9330bdb318
9 changed files with 164 additions and 12 deletions
+14 -1
View File
@@ -6,6 +6,15 @@ export type CodexTurnError = JsonRecord & { message: string };
export type CodexItem = JsonRecord & { id: string; type: string; text?: string };
export type CodexPlanStep = { step: string; status: "pending" | "inProgress" | "completed" };
export type CodexPlanUpdate = { threadId: string; turnId: string; explanation?: string | null; plan: CodexPlanStep[]; turnStatus?: string };
export type CodexReasoningEffort = "minimal" | "low" | "medium" | "high" | "xhigh";
export type CodexModel = JsonRecord & {
id: string;
model: string;
displayName: string;
defaultReasoningEffort: CodexReasoningEffort;
supportedReasoningEfforts: Array<{ reasoningEffort: CodexReasoningEffort; description?: string }>;
isDefault?: boolean;
};
export type CodexTurnInput =
| { type: "text"; text: string; text_elements: [] }
@@ -53,8 +62,12 @@ type CodexRequestSpec = {
params: { threadId: string };
result: Record<string, never>;
};
"model/list": {
params: { limit: number; includeHidden: boolean };
result: { data: CodexModel[]; nextCursor: string | null };
};
"turn/start": {
params: { threadId: string; input: CodexTurnInput[]; approvalPolicy: "never" | "on-request"; sandboxPolicy: { type: "workspaceWrite"; networkAccess: boolean } | { type: "dangerFullAccess" } };
params: { threadId: string; input: CodexTurnInput[]; approvalPolicy: "never" | "on-request"; sandboxPolicy: { type: "workspaceWrite"; networkAccess: boolean } | { type: "dangerFullAccess" }; model?: string; effort?: CodexReasoningEffort };
result: { turn: CodexTurn };
};
"turn/interrupt": {