fix: extend code queue pr preflight diagnostics

This commit is contained in:
Codex
2026-05-21 01:14:24 +00:00
parent a43c24dd88
commit 9e4561e102
7 changed files with 87 additions and 8 deletions
+10 -2
View File
@@ -190,6 +190,8 @@ interface CodexPrPreflightOptions {
remote: boolean;
pushDryRun: boolean;
pushDryRunRef: string | undefined;
prCreateDryRun: boolean;
prCreateDryRunHead: string | undefined;
issueNumber: number | null;
full: boolean;
}
@@ -1259,13 +1261,15 @@ function parseQueuesOptions(args: string[]): CodexQueuesOptions {
function parsePrPreflightOptions(args: string[]): CodexPrPreflightOptions {
assertKnownOptions(args, {
flags: ["--remote", "--push-dry-run", "--pushDryRun", "--full", "--raw"],
valueOptions: ["--push-dry-run-ref", "--pushDryRunRef", "--issue", "--issue-number", "--issueNumber"],
flags: ["--remote", "--push-dry-run", "--pushDryRun", "--pr-create-dry-run", "--prCreateDryRun", "--full", "--raw"],
valueOptions: ["--push-dry-run-ref", "--pushDryRunRef", "--pr-create-dry-run-head", "--prCreateDryRunHead", "--issue", "--issue-number", "--issueNumber"],
}, "codex pr-preflight");
return {
remote: hasFlag(args, "--remote"),
pushDryRun: hasFlag(args, "--push-dry-run") || hasFlag(args, "--pushDryRun"),
pushDryRunRef: optionValue(args, ["--push-dry-run-ref", "--pushDryRunRef"]),
prCreateDryRun: hasFlag(args, "--pr-create-dry-run") || hasFlag(args, "--prCreateDryRun"),
prCreateDryRunHead: optionValue(args, ["--pr-create-dry-run-head", "--prCreateDryRunHead"]),
issueNumber: nullablePositiveNumberOption(args, ["--issue", "--issue-number", "--issueNumber"]),
full: hasFlag(args, "--full") || hasFlag(args, "--raw"),
};
@@ -2364,6 +2368,7 @@ function compactPrRuntimePreflight(preflight: Record<string, unknown>, options:
ghPrReadOnly: compactCommandProbe(remote.ghPrReadOnly),
},
pushDryRun: compactCommandProbe(pull.pushDryRun),
prCreateDryRun: compactCommandProbe(pull.prCreateDryRun),
limitations,
risks,
runnerDisposition: ok ? "ready" : "infra-blocked",
@@ -2374,6 +2379,7 @@ function compactPrRuntimePreflight(preflight: Record<string, unknown>, options:
local: "bun scripts/cli.ts gh auth status --repo pikasTech/unidesk",
runner: "bun scripts/cli.ts codex pr-preflight --remote",
runnerPushDryRun: "bun scripts/cli.ts codex pr-preflight --remote --push-dry-run --push-dry-run-ref refs/heads/probe/code-queue-pr-capability",
runnerPrCreateDryRun: "bun scripts/cli.ts codex pr-preflight --remote --pr-create-dry-run --pr-create-dry-run-head <head-branch>",
rawProxy: "bun scripts/cli.ts microservice proxy code-queue /api/runtime-preflight?remote=1 --raw",
},
};
@@ -2387,6 +2393,8 @@ function codeQueuePrPreflight(optionArgs: string[] = [], fetcher: CodexResponseF
remote: options.remote ? 1 : undefined,
pushDryRun: options.pushDryRun ? 1 : undefined,
pushDryRunRef: options.pushDryRunRef,
prCreateDryRun: options.prCreateDryRun ? 1 : undefined,
prCreateDryRunHead: options.prCreateDryRunHead,
issue: options.issueNumber,
})}`);
const response = unwrapCodexResponse(fetcher(path));