feat: 补齐 HWLAB 手动调度能力
This commit is contained in:
@@ -6,6 +6,8 @@ export interface BackendAdapterOptions {
|
||||
codexCommand?: string;
|
||||
codexArgs?: string[];
|
||||
codexHome?: string;
|
||||
workspacePath?: string;
|
||||
abortSignal?: AbortSignal;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
}
|
||||
|
||||
@@ -18,16 +20,18 @@ export async function runBackendTurn(run: RunRecord, command: CommandRecord, opt
|
||||
const turnOptions: CodexStdioTurnOptions = {
|
||||
backendProfile: run.backendProfile,
|
||||
prompt,
|
||||
cwd: typeof run.workspaceRef.path === "string" ? run.workspaceRef.path : process.cwd(),
|
||||
cwd: options.workspacePath ?? (typeof run.workspaceRef.path === "string" ? run.workspaceRef.path : process.cwd()),
|
||||
approvalPolicy: run.executionPolicy.approval,
|
||||
sandbox: run.executionPolicy.sandbox,
|
||||
timeoutMs: run.executionPolicy.timeoutMs,
|
||||
};
|
||||
if (typeof command.payload.model === "string") turnOptions.model = command.payload.model;
|
||||
if (typeof command.payload.threadId === "string") turnOptions.threadId = command.payload.threadId;
|
||||
else if (typeof run.sessionRef?.threadId === "string") turnOptions.threadId = run.sessionRef.threadId;
|
||||
if (options.codexCommand) turnOptions.command = options.codexCommand;
|
||||
if (options.codexArgs) turnOptions.args = options.codexArgs;
|
||||
if (options.env) turnOptions.env = options.env;
|
||||
if (options.codexHome) turnOptions.codexHome = options.codexHome;
|
||||
if (options.abortSignal) turnOptions.abortSignal = options.abortSignal;
|
||||
return runCodexStdioTurn(turnOptions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user