feat(agent): implement permission mode handling for Codex threads and approvals

This commit is contained in:
HouYunFei
2026-07-29 16:44:51 +08:00
parent bd8cf318f7
commit b926feeb14
14 changed files with 372 additions and 46 deletions
+3 -3
View File
@@ -12,8 +12,8 @@ export type CodexTurnInput =
| { type: "localImage"; path: string };
type ThreadOptions = {
approvalPolicy: "never";
sandbox: "workspace-write";
approvalPolicy: "never" | "onRequest";
sandbox: "workspaceWrite" | "dangerFullAccess";
config: JsonRecord;
cwd?: string;
};
@@ -54,7 +54,7 @@ type CodexRequestSpec = {
result: Record<string, never>;
};
"turn/start": {
params: { threadId: string; input: CodexTurnInput[]; approvalPolicy: "never" };
params: { threadId: string; input: CodexTurnInput[]; approvalPolicy: "never" | "onRequest"; sandboxPolicy: { type: "workspaceWrite"; networkAccess: boolean } | { type: "dangerFullAccess" } };
result: { turn: CodexTurn };
};
"turn/interrupt": {