fix: return recovery action descriptors (#174)
Co-authored-by: AgentRun Codex <agentrun-codex@users.noreply.github.com>
This commit is contained in:
@@ -213,11 +213,11 @@ export async function createKubernetesRunnerJob(options: { store: AgentRunStore;
|
||||
retention: {
|
||||
ttlSecondsAfterFinished: render.ttlSecondsAfterFinished,
|
||||
},
|
||||
pollCommands: {
|
||||
run: `./scripts/agentrun runs show ${run.id} --manager-url ${managerUrl}`,
|
||||
command: `./scripts/agentrun commands show ${commandId} --run-id ${run.id} --manager-url ${managerUrl}`,
|
||||
events: `./scripts/agentrun runs events ${run.id} --manager-url ${managerUrl} --after-seq 0 --limit 100`,
|
||||
},
|
||||
pollActions: [
|
||||
runnerJobActionDescriptor({ action: "inspect-run", operation: "describe", resourceKind: "run", resourceName: run.id, runId: run.id }),
|
||||
runnerJobActionDescriptor({ action: "inspect-command", operation: "describe", resourceKind: "command", resourceName: commandId, runId: run.id, commandId }),
|
||||
runnerJobActionDescriptor({ action: "poll-events", operation: "events", resourceKind: "run", resourceName: run.id, runId: run.id, commandId, afterSeq: 0, limit: 100 }),
|
||||
],
|
||||
warnings: render.warnings,
|
||||
kubernetes: {
|
||||
created: true,
|
||||
@@ -459,6 +459,20 @@ function stringField(record: JsonRecord, key: string): string {
|
||||
return value.trim();
|
||||
}
|
||||
|
||||
function runnerJobActionDescriptor(input: { action: string; operation: string; resourceKind: string; resourceName: string; runId?: string | null; commandId?: string | null; afterSeq?: number | null; limit?: number | null }): JsonRecord {
|
||||
return {
|
||||
action: input.action,
|
||||
operation: input.operation,
|
||||
resourceKind: input.resourceKind,
|
||||
resourceName: input.resourceName,
|
||||
runId: input.runId ?? null,
|
||||
commandId: input.commandId ?? null,
|
||||
...(input.afterSeq !== undefined ? { afterSeq: input.afterSeq } : {}),
|
||||
...(input.limit !== undefined ? { limit: input.limit } : {}),
|
||||
valuesPrinted: false,
|
||||
};
|
||||
}
|
||||
|
||||
function optionalString(value: unknown): string | undefined {
|
||||
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user