fix: AgentRun bridge help prefer stdin input

This commit is contained in:
Codex
2026-06-10 05:24:06 +00:00
parent 4bb5f7e7f4
commit 0a8a8396d8
7 changed files with 40 additions and 23 deletions
+20 -3
View File
@@ -20,10 +20,26 @@ assertCondition(
);
assertCondition(
agentRunUsage.some((line) => line.includes("queue submit --json-file <task.json> --dry-run"))
&& agentRunUsage.some((line) => line.includes("queue dispatch <taskId> --json-file <dispatch.json> --dry-run"))
agentRunUsage.some((line) => line.includes("queue submit --json-stdin --dry-run"))
&& agentRunUsage.some((line) => line.includes("queue dispatch <taskId> --json-stdin --dry-run"))
&& agentRunUsage.some((line) => line.includes("queue commander --reader-id cli --limit 20")),
"AgentRun help must expose queue dry-run and compact commander usage",
"AgentRun help must expose stdin-first queue dry-run and compact commander usage",
agentRunUsage,
);
const submitStdinIndex = agentRunUsage.findIndex((line) => line.includes("queue submit --json-stdin"));
const submitFileIndex = agentRunUsage.findIndex((line) => line.includes("queue submit --json-file"));
const dispatchStdinIndex = agentRunUsage.findIndex((line) => line.includes("queue dispatch <taskId> --json-stdin"));
const dispatchFileIndex = agentRunUsage.findIndex((line) => line.includes("queue dispatch <taskId> --json-file"));
assertCondition(
submitStdinIndex >= 0
&& dispatchStdinIndex >= 0
&& submitFileIndex > submitStdinIndex
&& dispatchFileIndex > dispatchStdinIndex
&& !agentRunUsage.some((line) => line.includes("queue submit --json-file <task.json> --dry-run"))
&& !agentRunUsage.some((line) => line.includes("queue dispatch <taskId> --json-file <dispatch.json> --dry-run")),
"AgentRun help must present heredoc/stdin before reusable file fallbacks",
agentRunUsage,
);
@@ -54,6 +70,7 @@ console.log(JSON.stringify({
checks: [
"AgentRun command help exposes cleanup-runs and cleanup-released-pvs",
"AgentRun command help exposes queue dry-run and compact commander usage",
"AgentRun command help presents heredoc/stdin before reusable file fallbacks",
"global help indexes AgentRun v0.1 entrypoints",
"AgentRun control-plane status degrades empty runtime JSON snippets",
],
+6 -6
View File
@@ -28,12 +28,12 @@ export function agentRunHelp(): unknown {
usage: [
"bun scripts/cli.ts agentrun v01 queue commander --reader-id cli",
"bun scripts/cli.ts agentrun v01 queue commander --reader-id cli --limit 20",
"bun scripts/cli.ts agentrun v01 queue submit --json-file <task.json>",
"cat task.json | bun scripts/cli.ts agentrun v01 queue submit --json-stdin",
"bun scripts/cli.ts agentrun v01 queue submit --json-file <task.json> --dry-run",
"bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-file <dispatch.json>",
"cat dispatch.json | bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-stdin",
"bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-file <dispatch.json> --dry-run",
"bun scripts/cli.ts agentrun v01 queue submit --json-stdin <<'JSON'",
"bun scripts/cli.ts agentrun v01 queue submit --json-stdin --dry-run <<'JSON'",
"bun scripts/cli.ts agentrun v01 queue submit --json-file <task.json> # reusable reviewed file fallback",
"bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-stdin <<'JSON'",
"bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-stdin --dry-run <<'JSON'",
"bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-file <dispatch.json> # reusable reviewed file fallback",
"bun scripts/cli.ts agentrun v01 queue cancel <taskId> --reason <text> --dry-run",
"bun scripts/cli.ts agentrun v01 sessions trace <sessionId> --after-seq 0 --limit 100",
"bun scripts/cli.ts agentrun v01 sessions output <sessionId> --after-seq 0 --limit 100",
+3 -3
View File
@@ -66,11 +66,11 @@ const codexTaskStatuses = ["queued", "running", "judging", "retry_wait", "succee
const codexTerminalTaskStatuses = ["succeeded", "failed", "canceled"] as const;
const agentRunQueueReplacementCommands = {
queueCommander: "bun scripts/cli.ts agentrun v01 queue commander --reader-id cli",
queueSubmit: "bun scripts/cli.ts agentrun v01 queue submit --json-file <task.json>",
queueDispatch: "bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-file <dispatch.json>",
queueSubmit: "bun scripts/cli.ts agentrun v01 queue submit --json-stdin <<'JSON'",
queueDispatch: "bun scripts/cli.ts agentrun v01 queue dispatch <taskId> --json-stdin <<'JSON'",
sessionsTrace: "bun scripts/cli.ts agentrun v01 sessions trace <sessionId> --after-seq 0 --limit 100",
sessionsOutput: "bun scripts/cli.ts agentrun v01 sessions output <sessionId> --after-seq 0 --limit 100",
sessionsSteer: "bun scripts/cli.ts agentrun v01 sessions steer <sessionId> --prompt-file <path>",
sessionsSteer: "bun scripts/cli.ts agentrun v01 sessions steer <sessionId> --prompt-stdin <<'EOF'",
sessionsRead: "bun scripts/cli.ts agentrun v01 sessions read <sessionId> --reader-id cli",
queueCancel: "bun scripts/cli.ts agentrun v01 queue cancel <taskId> --reason <text>",
};
+4 -4
View File
@@ -391,7 +391,7 @@ function codexHelp(): unknown {
"bun scripts/cli.ts codex deploy <commitId> # disabled legacy deployment entry",
"bun scripts/cli.ts codex prompt-lint [prompt|--prompt-file path|--prompt-stdin]",
"bun scripts/cli.ts agentrun v01 queue commander --reader-id cli",
"bun scripts/cli.ts agentrun v01 queue submit --json-file <task.json>",
"bun scripts/cli.ts agentrun v01 queue submit --json-stdin <<'JSON'",
"bun scripts/cli.ts agentrun v01 sessions trace <sessionId> --after-seq 0 --limit 100",
"bun scripts/cli.ts codex submit # frozen legacy write entry; returns legacy-code-queue-frozen",
"bun scripts/cli.ts codex task <taskId> [--detail] [--trace --tail|--from-start|--after-seq N|--before-seq N --limit N] [--full]",
@@ -405,7 +405,7 @@ function codexHelp(): unknown {
"bun scripts/cli.ts codex execution-plane [--full|--raw]",
"bun scripts/cli.ts codex pr-preflight [--remote] [--push-dry-run --push-dry-run-ref refs/heads/probe/<name>] [--pr-create-dry-run --pr-create-dry-run-head <head>] [--issue N] [--full|--raw]",
"bun scripts/cli.ts codex judge <taskId> --attempt N [--dry-run] [--include-prompt]",
"bun scripts/cli.ts agentrun v01 sessions steer <sessionId> --prompt-file <path>",
"bun scripts/cli.ts agentrun v01 sessions steer <sessionId> --prompt-stdin",
"bun scripts/cli.ts codex steer <taskId> # frozen legacy write entry",
"bun scripts/cli.ts codex resume <taskId> # frozen legacy write entry",
"bun scripts/cli.ts codex steer-confirm <taskId> --steer-id <id> [--raw]",
@@ -426,7 +426,7 @@ function codexHelp(): unknown {
},
submitSummary: {
default: "codex submit/enqueue now returns ok=false, frozen=true, degradedReason=legacy-code-queue-frozen and AgentRun replacement commands.",
replacement: "Use bun scripts/cli.ts agentrun v01 queue submit --json-file <task.json> for new work.",
replacement: "Use bun scripts/cli.ts agentrun v01 queue submit --json-stdin with a quoted heredoc for new one-shot work; reserve --json-file for reusable reviewed files.",
noDoubleWrite: "UniDesk does not mirror AgentRun submissions into old Code Queue and does not migrate old history into AgentRun.",
rawDrillDown: "Use codex tasks/task/output/read/unread/queues only for legacy archive inspection.",
},
@@ -457,7 +457,7 @@ function codexHelp(): unknown {
examples: {
promptLint: "bun scripts/cli.ts codex prompt-lint --prompt-file /tmp/code-queue-prompt.md",
agentRunCommander: "bun scripts/cli.ts agentrun v01 queue commander --reader-id cli",
agentRunSubmit: "bun scripts/cli.ts agentrun v01 queue submit --json-file <task.json>",
agentRunSubmit: "bun scripts/cli.ts agentrun v01 queue submit --json-stdin <<'JSON'",
agentRunTrace: "bun scripts/cli.ts agentrun v01 sessions trace <sessionId> --after-seq 0 --limit 100",
frozenLegacySubmit: "bun scripts/cli.ts codex submit --prompt-file /tmp/code-queue-prompt.md",
},