CRD Reference

AgentJob Reference

A single AI coding task with full lifecycle management, from spec to pull request

Overview

An AgentJob (apiVersion: nominos.io/v1) describes one task for a coding agent: what to do, which repository to do it in, and how the agent should run. The nominos-core controller reconciles each AgentJob into a Kubernetes Job that clones the repo, runs the agent, pushes a branch, and (optionally) opens a pull request.

kubectl
kubectl get agentjobs
NAME                  PHASE       AGE   BRANCH                        COMMITS
update-dependencies   Completed   12m   nominos/update-dependencies   2

Spec Fields

FieldTypeDefaultDescription
taskTaskSpecWhat the agent should do. Required.
agentAgentSpecAgent image, model, harness, and execution configuration.
repositoryRepositorySpecGit repository the agent works on.
pausedbooleanfalseWhen true, the job stays in the Draft phase and is not scheduled.
priorityinteger0Scheduling order — higher priority runs first.
timeoutSecondsinteger3600Maximum time the agent can run, in seconds.
backoffLimitinteger3Number of retries before the job is marked Failed.
resourcesResourceRequirementsStandard Kubernetes resource requests/limits for the agent pod.
maxCostDollarsstringMaximum spend in dollars for this job.
interactionModeInteractionModeSpecCheckpoint-based workflow configuration.

spec.task

FieldTypeDefaultDescription
descriptionstringHuman-readable description of the task. Required.
detailsstringExtended elaboration on the task.
acceptanceCriteriastring[]Criteria for task completion.
focusFilesstring[]Files the agent should focus on.
contextstringAdditional context or instructions.

spec.agent

FieldTypeDefaultDescription
imagestringghcr.io/johnhenry/nominos-agent:latestAgent container image.
modelstringclaude-sonnet-5Model to use (e.g. claude-sonnet-5, claude-opus-5).
harnessenum: claude-code | piclaude-codeCoding-agent harness that executes the task. pi enables multi-model execution across providers.
maxTurnsinteger50Maximum conversation turns.
credentialsSecretstringnominos-credentialsSecret containing API credentials.
zeroShotZeroShotConfigMulti-agent execution with blind validation. Sub-fields: isolation (none | worktree | docker, default none) and provider (claude | openai | gemini, default claude).
interactivebooleanfalseChat mode — the agent completes the task, then stays alive for follow-up messages.
imagePullSecretsstring[]Secret names for pulling private container images (e.g. from ghcr.io).

New: the harness field

Set spec.agent.harness: pi to execute the task with the pi coding agent instead of Claude Code. The pi harness is provider-agnostic, so you can pair it with non-Anthropic models via your own API keys. The default remains claude-code.

spec.repository

FieldTypeDefaultDescription
urlstringRepository URL (SSH or HTTPS). Required.
baseBranchstringmainBranch to base work on.
workBranchstringauto-generatedBranch name for the agent’s work.
authSecretstringSecret containing an SSH key or token for git access.
mergeBranchstringBranch to merge into baseBranch, producing real conflict markers for conflict-resolution jobs.
createPRbooleantrueCreate a pull request after pushing changes.
autoMergebooleanfalseEnable auto-merge on the PR (requires branch protection rules).
prLabelsstring[]Labels to add to the PR.
createDraftPRbooleanfalseCreate the PR as a draft.
updateClaudeMdbooleanfalseInstruct the agent to update CLAUDE.md with learnings.
mergeStrategyenum: squash | merge | rebasesquashHow the PR should be merged.

spec.interactionMode

FieldTypeDefaultDescription
modeenum: fire_and_forget | checkpoints | interactive | batch_reviewfire_and_forgetHow the agent interacts with users during execution.
modeConfigIdstringReference to a pre-configured mode config.
checkpointTriggersenum[]When checkpoints are created: before_commit, before_pr, on_error, on_ambiguity, on_scope_change, on_cost_threshold, on_time_threshold.

Status

Phases

PhaseMeaning
DraftJob is paused (spec.paused: true), not scheduled.
PendingWaiting to be scheduled.
QueuedQueued, waiting for resources.
RunningAgent is actively running.
PausedPaused mid-execution.
MergingAgent work done, PR created and waiting in a merge queue.
CompletedCompleted successfully.
FailedFailed after exhausting retries.
CancelledCancelled by the user.

Status Fields

FieldDescription
phaseCurrent phase (see table above).
messageHuman-readable status message.
harnessHarness that actually executed the task, as reported by the runner.
warningsNon-fatal issues (e.g. missing credentials, PR creation failed).
startTime / completionTimeWhen the job started and finished.
retriesRetry count so far.
jobRefReference to the underlying Kubernetes Job.
workBranch / commits / commitSHA / filesChangedGit results: branch created, commit count, final SHA, changed files.
pullRequestURLURL of the PR, if one was created.
estimatedCostDollars / tokenUsageEstimated spend and input/output token counts.
checkpointResume state after pod failure (last turn, restart count, ConfigMap ref).
zeroShotMulti-agent execution state: phase, complexity, validators run/passed, iterations.
chatInteractive-mode state: ready flag, message count, last message time.
crContinuation Record status: progress counts, key decisions, blockers, resume points.
logsAgent logs, preserved after pod deletion.
conditionsStandard Kubernetes conditions.

Examples

Minimal job: fix a bug and open a PR

agentjob.yaml
apiVersion: nominos.io/v1
kind: AgentJob
metadata:
  name: fix-auth-bug
spec:
  task:
    description: "Fix the authentication bypass vulnerability in auth.go"
  repository:
    url: "https://github.com/org/repo"
    baseBranch: "main"
    createPR: true
    prLabels: ["security", "priority-high"]
  agent:
    model: "claude-sonnet-5"
    maxTurns: 50

Checkpointed job on the pi harness

agentjob-checkpoints.yaml
apiVersion: nominos.io/v1
kind: AgentJob
metadata:
  name: refactor-payment-service
spec:
  task:
    description: "Extract the payment retry logic into its own module"
    acceptanceCriteria:
      - "Existing tests still pass"
      - "Retry behavior is unchanged"
    focusFiles: ["internal/payments/"]
  repository:
    url: "https://github.com/org/payments"
    createDraftPR: true
  agent:
    harness: pi          # multi-model harness
    model: "claude-sonnet-5"
  timeoutSeconds: 5400
  maxCostDollars: "2.00"
  interactionMode:
    mode: checkpoints
    checkpointTriggers: [before_commit, before_pr]

With checkpointTriggers set, the agent pauses at each trigger and waits up to one hour for approval in the dashboard before continuing.