fix: 增强 AgentRun control-plane status drill-down

This commit is contained in:
Codex
2026-06-10 18:31:02 +00:00
parent 6c39fab601
commit ef5c1c0680
3 changed files with 188 additions and 16 deletions
+11 -8
View File
@@ -19,6 +19,13 @@ assertCondition(
agentRunUsage,
);
assertCondition(
agentRunUsage.some((line) => line.includes("control-plane status --pipeline-run agentrun-v01-ci-<short-sha>"))
&& agentRunUsage.some((line) => line.includes("control-plane status --source-commit <full-sha>")),
"AgentRun help must expose targeted control-plane status drill-down options",
agentRunUsage,
);
assertCondition(
agentRunUsage.some((line) => line.includes("queue submit --json-stdin --dry-run"))
&& agentRunUsage.some((line) => line.includes("queue dispatch <taskId> --json-stdin --dry-run"))
@@ -46,7 +53,7 @@ assertCondition(
const globalHelp = JSON.stringify(rootHelp());
assertCondition(
globalHelp.includes("agentrun v01 queue|sessions|control-plane|git-mirror"),
globalHelp.includes("agentrun v01 aipod-specs|queue|sessions|control-plane|git-mirror"),
"global help must index AgentRun v0.1 entrypoints",
rootHelp(),
);
@@ -54,14 +61,9 @@ assertCondition(
const agentRunSource = readFileSync("scripts/src/agentrun.ts", "utf8");
const runtimeJsonFallback = "\"node <<'NODE' || printf '{}\\\\n'\"";
function statusScriptSection(label: string): string {
const start = agentRunSource.indexOf(`printf '${label}='`);
return start >= 0 ? agentRunSource.slice(start, start + 500) : "";
}
assertCondition(
statusScriptSection("pipelineRunCondition").includes(runtimeJsonFallback)
&& statusScriptSection("ciSummary").includes(runtimeJsonFallback),
agentRunSource.includes(runtimeJsonFallback)
&& agentRunSource.includes("const sourceCommit = params.find((entry) => entry?.name === 'revision')?.value || null;"),
"AgentRun control-plane status must degrade empty runtime JSON snippets instead of failing the whole status probe",
);
@@ -69,6 +71,7 @@ console.log(JSON.stringify({
ok: true,
checks: [
"AgentRun command help exposes cleanup-runs and cleanup-released-pvs",
"AgentRun command help exposes targeted control-plane status drill-down options",
"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",