feat: complete chat routing and openai onboarding

This commit is contained in:
kris
2026-03-31 03:31:22 +08:00
parent 5b590f7cc1
commit 9c02ebb574
25 changed files with 2241 additions and 133 deletions

View 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,
};
}