feat: 支持 v0.1 deepseek backend profile
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { BackendTurnResult, CommandRecord, RunRecord } from "../common/types.js";
|
||||
import { runCodexStdioTurn, type CodexStdioTurnOptions } from "./codex-stdio.js";
|
||||
import { backendProfileSpec } from "../common/backend-profiles.js";
|
||||
|
||||
export interface BackendAdapterOptions {
|
||||
codexCommand?: string;
|
||||
@@ -9,11 +10,13 @@ export interface BackendAdapterOptions {
|
||||
}
|
||||
|
||||
export async function runBackendTurn(run: RunRecord, command: CommandRecord, options: BackendAdapterOptions = {}): Promise<BackendTurnResult> {
|
||||
if (run.backendProfile !== "codex") {
|
||||
const spec = backendProfileSpec(run.backendProfile);
|
||||
if (!spec || spec.backendKind !== "codex-app-server-stdio") {
|
||||
return { terminalStatus: "failed", failureKind: "backend-failed", failureMessage: `unsupported backendProfile ${run.backendProfile}`, events: [{ type: "error", payload: { failureKind: "backend-failed", backendProfile: run.backendProfile } }] };
|
||||
}
|
||||
const prompt = typeof command.payload.prompt === "string" ? command.payload.prompt : JSON.stringify(command.payload);
|
||||
const turnOptions: CodexStdioTurnOptions = {
|
||||
backendProfile: run.backendProfile,
|
||||
prompt,
|
||||
cwd: typeof run.workspaceRef.path === "string" ? run.workspaceRef.path : process.cwd(),
|
||||
approvalPolicy: run.executionPolicy.approval,
|
||||
|
||||
Reference in New Issue
Block a user