feat: complete chat routing and openai onboarding
This commit is contained in:
51
local-agent/codex-task-runner.mjs
Normal file
51
local-agent/codex-task-runner.mjs
Normal file
@@ -0,0 +1,51 @@
|
||||
export function buildCodexTaskExecution(config, task, outputFile) {
|
||||
const targetThreadRef =
|
||||
String(task?.targetCodexThreadRef || task?.targetThreadId || "").trim();
|
||||
const targetFolderRef =
|
||||
String(task?.targetCodexFolderRef || config.masterAgentWorkdir || process.cwd()).trim() ||
|
||||
process.cwd();
|
||||
const prompt = String(task?.executionPrompt || "");
|
||||
|
||||
if (
|
||||
targetThreadRef &&
|
||||
(task?.taskType === "conversation_reply" || task?.taskType === "dispatch_execution")
|
||||
) {
|
||||
const args = [
|
||||
"exec",
|
||||
"resume",
|
||||
"--skip-git-repo-check",
|
||||
"-o",
|
||||
outputFile,
|
||||
];
|
||||
if (config.masterAgentModel) {
|
||||
args.push("-m", config.masterAgentModel);
|
||||
}
|
||||
args.push(targetThreadRef, prompt);
|
||||
return {
|
||||
mode: "resume",
|
||||
cwd: targetFolderRef,
|
||||
args,
|
||||
};
|
||||
}
|
||||
|
||||
const args = [
|
||||
"exec",
|
||||
"--ephemeral",
|
||||
"--skip-git-repo-check",
|
||||
"-C",
|
||||
config.masterAgentWorkdir || process.cwd(),
|
||||
"-s",
|
||||
config.masterAgentSandbox || "workspace-write",
|
||||
"-o",
|
||||
outputFile,
|
||||
];
|
||||
if (config.masterAgentModel) {
|
||||
args.push("-m", config.masterAgentModel);
|
||||
}
|
||||
args.push(prompt);
|
||||
return {
|
||||
mode: "ephemeral",
|
||||
cwd: config.masterAgentWorkdir || process.cwd(),
|
||||
args,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user