fix: 支持 Artificer 模型选择与 gpt-pika

关联 #325。固定 v0.2 gpt-pika SecretRef,支持 task 级模型与 reasoning override,并将 reasoning effort 传递到 Codex app-server。

Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
root
2026-07-12 16:02:23 +02:00
parent 201beba9fe
commit 46b191e3e0
13 changed files with 578 additions and 44 deletions
+15 -6
View File
@@ -1112,6 +1112,10 @@ function queueSubmitConfirmCommand(args: ParsedArgs): string {
function queueSubmitAipodConfirmCommand(args: ParsedArgs, aipod: string): string {
const parts = [`./scripts/agentrun queue submit --aipod ${aipod} --prompt-stdin`];
const model = optionalFlag(args, "model");
const reasoningEffort = optionalFlag(args, "reasoning-effort");
if (model) parts.push(`--model ${model}`);
if (reasoningEffort) parts.push(`--reasoning-effort ${reasoningEffort}`);
if (optionalFlag(args, "idempotency-key")) parts.push("--idempotency-key <idempotency-key>");
return parts.join(" ");
}
@@ -1522,6 +1526,8 @@ async function aipodRenderInput(args: ParsedArgs, trailingPromptStart: number, o
copyOptionalFlag(args, input as JsonRecord, "lane");
copyOptionalFlag(args, input as JsonRecord, "title");
copyOptionalFlag(args, input as JsonRecord, "provider-id", "providerId");
copyOptionalFlag(args, input as JsonRecord, "model");
copyOptionalFlag(args, input as JsonRecord, "reasoning-effort", "reasoningEffort");
const profile = optionalFlag(args, "profile") ?? optionalFlag(args, "backend-profile");
if (profile) input.backendProfile = normalizeProfile(profile);
const priority = optionalFlag(args, "priority");
@@ -1554,7 +1560,10 @@ async function submitQueueTaskWithAipod(args: ParsedArgs, aipod: string): Promis
const rendered = await renderAipodForCommand(args, aipod, 2);
const body = rendered.queueTask as unknown as JsonRecord;
if (args.flags.get("dry-run") === true) {
return queueMutationDryRunPlan("queue-submit", null, "/api/v1/queue/tasks", body, "POST", queueSubmitAipodConfirmCommand(args, aipod), undefined, { source: "aipod-spec", aipod, preferred: "--aipod", valuesPrinted: false });
return {
...queueMutationDryRunPlan("queue-submit", null, "/api/v1/queue/tasks", body, "POST", queueSubmitAipodConfirmCommand(args, aipod), undefined, { source: "aipod-spec", aipod, preferred: "--aipod", valuesPrinted: false }),
modelResolution: rendered.modelResolution,
};
}
return client(args).post("/api/v1/queue/tasks", body);
}
@@ -1592,8 +1601,8 @@ async function sessionSendWithAipod(args: ParsedArgs, positionalSessionId: strin
if (commandIdempotencyKey) sendBody.commandIdempotencyKey = commandIdempotencyKey;
if (args.flags.get("dry-run") !== true) await ensureSessionForSend(args, sessionId, String(task.tenantId), String(task.projectId), profile);
const result = await client(args).post(`/api/v1/sessions/${encodeURIComponent(sessionId)}/send`, sendBody);
if (wantsExpandedOutput(args)) return { action: "session-send", aipod, result: result as JsonValue, valuesPrinted: false };
return summarizeSessionSendResult(result, sessionId, profile, aipod);
if (wantsExpandedOutput(args)) return { action: "session-send", aipod, modelResolution: rendered.modelResolution, result: result as JsonValue, valuesPrinted: false };
return { ...summarizeSessionSendResult(result, sessionId, profile, aipod), modelResolution: rendered.modelResolution };
}
async function submitQueueTask(args: ParsedArgs): Promise<JsonValue> {
@@ -2302,7 +2311,7 @@ function help(args: ParsedArgs, group?: string): JsonRecord {
"sessions storage <sessionId>",
"sessions storage <sessionId> --delete",
"sessions show <sessionId> [--reader-id <reader>]",
"sessions send [sessionId] [--aipod <name>|--json-stdin|--json-file <run-base.json>] [--prompt-stdin|--prompt-file <file>|--prompt <text>] [--profile codex|deepseek|minimax-m3|dsflash-go|<dynamic-profile>|M3] [--runner-json-stdin|--runner-json-file <job.json>] [--no-runner-job] [--dry-run]",
"sessions send [sessionId] [--aipod <name>|--json-stdin|--json-file <run-base.json>] [--prompt-stdin|--prompt-file <file>|--prompt <text>] [--model <model>] [--reasoning-effort <effort>] [--profile codex|deepseek|minimax-m3|dsflash-go|<dynamic-profile>|M3] [--runner-json-stdin|--runner-json-file <job.json>] [--no-runner-job] [--dry-run]",
"sessions cancel <sessionId> [--reason <text>] [--full|--raw]",
"sessions trace <sessionId> [--after-seq <n>] [--limit <n>] [--run-id <runId>] [--summary-chars <n>] [--include-output] [--seq <n>|--event-id <id>|--item-id <id>] [--detail-scan-pages <n>] [--full|--raw]",
"sessions output <sessionId> [--after-seq <n>] [--limit <n>] [--run-id <runId>] [--summary-chars <n>] [--include-output] [--seq <n>|--event-id <id>|--item-id <id>] [--detail-scan-pages <n>] [--full|--raw]",
@@ -2318,7 +2327,7 @@ function help(args: ParsedArgs, group?: string): JsonRecord {
"runner job-status [runnerJobId] --run-id <runId>",
"runner reconcile [--limit <n>] [--namespace <namespace>] [--dry-run]",
"queue submit --json-stdin|--json-file <task.json> [--idempotency-key <key>] [--dry-run]",
"queue submit --aipod <name> [--prompt-stdin|--prompt-file <file>|--prompt <text>] [--idempotency-key <key>] [--dry-run]",
"queue submit --aipod <name> [--prompt-stdin|--prompt-file <file>|--prompt <text>] [--model <model>] [--reasoning-effort <effort>] [--idempotency-key <key>] [--dry-run]",
"queue list [--queue <queue>] [--state <state>] [--cursor <cursor>] [--limit <limit>] [--updated-after <version>] [--full|--raw]",
"queue show <taskId> [--full|--raw]",
"queue stats [--queue <queue>]",
@@ -2331,7 +2340,7 @@ function help(args: ParsedArgs, group?: string): JsonRecord {
"queue refresh <taskId> [--dry-run] [--full|--raw]",
"aipod-specs list",
"aipod-specs show <name>",
"aipod-specs render <name> [--json-stdin|--json-file <input.json>] [--prompt-stdin|--prompt-file <file>|--prompt <text>]",
"aipod-specs render <name> [--json-stdin|--json-file <input.json>] [--prompt-stdin|--prompt-file <file>|--prompt <text>] [--model <model>] [--reasoning-effort <effort>]",
"aipod-specs apply [name] --yaml-stdin|--yaml-file <spec.yaml> [--dry-run]",
"aipod-specs delete <name>",
"secrets codex render --dry-run [--profile codex|deepseek|minimax-m3|dsflash-go|<dynamic-profile>] [--codex-home <dir>] [--model-catalog-file <file>] [--namespace agentrun-v01] [--secret-name <name>]",