feat: add agentrun git mirror controls

This commit is contained in:
Codex
2026-06-01 17:36:55 +00:00
parent 79933f3c58
commit 9027a310d3
4 changed files with 515 additions and 20 deletions
+6 -4
View File
@@ -25,7 +25,7 @@ export interface JobRecord {
}
export interface JobProgressSummary {
kind: "hwlab-v02-trigger" | "hwlab-git-mirror" | "generic";
kind: "hwlab-v02-trigger" | "git-mirror" | "generic";
stage: string | null;
stageStatus: string | null;
sourceCommit: string | null;
@@ -196,7 +196,7 @@ export function jobWithTail(job: JobRecord, maxBytes = 12000): JobRecord & {
function summarizeJobProgress(job: JobRecord, maxBytes = 96_000, tails?: { stdoutTail: string; stderrTail: string }): JobProgressSummary {
const knownWorkflow = job.name === "hwlab_g14_v02_trigger_current";
const gitMirrorWorkflow = job.name === "hwlab_g14_git_mirror_sync" || job.name === "hwlab_g14_git_mirror_flush";
const gitMirrorWorkflow = job.name === "hwlab_g14_git_mirror_sync" || job.name === "hwlab_g14_git_mirror_flush" || job.name === "agentrun_v01_git_mirror_sync" || job.name === "agentrun_v01_git_mirror_flush";
if (!knownWorkflow && !gitMirrorWorkflow && tails === undefined) return genericJobProgress(job);
const nowMs = Date.now();
const progressTailBytes = Math.max(4096, Math.floor(maxBytes));
@@ -290,7 +290,7 @@ function summarizeGitMirrorJobProgress(job: JobRecord, stdoutTail: string, stder
.filter(([key]) => key.startsWith(`gitMirror.${action}.`) || key === "sshRuntimeMaxMs")
.map(([key, value]) => `${key}=${value}ms`);
return {
kind: "hwlab-git-mirror",
kind: "git-mirror",
stage: action,
stageStatus: status ?? (job.status === "running" ? "running" : null),
sourceCommit: null,
@@ -315,7 +315,9 @@ function summarizeGitMirrorJobProgress(job: JobRecord, stdoutTail: string, stder
].filter(Boolean).join(" "),
nextCommand: job.status === "running"
? `bun scripts/cli.ts job status ${job.id} --tail-bytes 12000`
: "bun scripts/cli.ts hwlab g14 git-mirror status",
: job.name.startsWith("agentrun_")
? "bun scripts/cli.ts agentrun v01 git-mirror status"
: "bun scripts/cli.ts hwlab g14 git-mirror status",
};
}