Repository navigation
Description
Problem or Motivation
The Service continues a runner Job that ended with no result (#3721). It skips the continuation for the failure class oom, because a second run on the same memory limit ends the same way.
The Service finds the class oom only from the log of the Job. It passes an exit status to classify_failure for a stall only (143). It never reads the pod status. A kernel kill of the runner process (OOMKilled, exit status 137) can leave no text in the container log. Then the class is ci_infra, and the Service continues the item two times with the same limit.
The cost is bounded: at most 2 extra Jobs for each item.
Proposed Solution & Architectural Design
- Read
status.containerStatuses[].state.terminated(reason,exitCode) of the pod of the Job when the Service reports a Job that ended. - Put the exit status in
FailureEvidence.exit_status, soclassify_failuregivesoomfor 137 or the reasonOOMKilled. - Keep the Role of the Service: it already lists pods.
- Test first: a pod with
OOMKilledand an empty log must give the classoomand no continuation.
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
The Kubernetes API (kubernetes client) already gives the container status. No new library is needed. The cost to build is one read of a field and one test, about 30000 tokens.
Proposed design
Problem statement
The Service continues a runner Job that ended with no result. It skips the continuation for the class oom, because a second run on the same memory limit ends the same way. The Service finds oom only from the log of the Job. A kernel kill of the runner process can leave no text in the log, so the class becomes ci_infra and the Service continues the item two times with the same limit. The fix reads the pod status of the Job to find the exit status of a killed container.
Acceptance criteria
Requirement: Pod exit status in the failure evidence
The Service SHALL read the terminated exit status of the container of the Job's pod when it reports a Job that ended, and SHALL pass it to classify_failure.
Scenario: Terminated container with exit status 137
- WHEN The pod status of the Job holds a terminated container with exit status 137.
- THEN
classify_failurereceives exit status 137 in its failure evidence.
Requirement: Class oom from the exit status
classify_failure SHALL return the class oom when the exit status is 137 and the error text is empty.
Scenario: Empty log and exit status 137
- WHEN The failure evidence holds an empty error text and exit status 137.
- THEN
classify_failurereturnsoom.
Requirement: No continuation for the class oom
The Service MUST NOT continue an item whose stop has the class oom.
Scenario: OOMKilled pod with no log text
- WHEN A Job ends with a container killed for memory, its log is empty, and the class
oomis recorded. - THEN The Service records the stop as
job, makes no continuation Job, and the item waits for a retry.
Requirement: Container whose log the Service reads
The Service SHALL read the terminated state of the same container whose log it reads, from state and then from lastState.
Scenario: Restarted container with a terminated last state
- WHEN The state of the container holds no terminated state and its last state holds exit status 137.
- THEN The Service passes exit status 137 to
classify_failure.
Requirement: No terminated state in the pod status
The Service SHALL keep the class of the log when the pod status holds no terminated state.
Scenario: Pod status without a terminated container
- WHEN The pod status holds no terminated state for the container and the log holds error text.
- THEN The Service classifies the failure from the log with no error and records no
oomclass.
Requirement: Exit status 143 stays a timeout
classify_failure SHALL keep the class timeout for the exit status 143 of a stall.
Scenario: Stalled Job with exit status 143
- WHEN The Service ends a stalled Job and passes exit status 143.
- THEN
classify_failurereturnstimeoutand notoom.
Existing Tool Considered
No alternatives check has run. The Kubernetes API through the kubernetes Python client already gives the container status, and the Service already holds a client and lists pods. No new library is needed. The written cost to build is one field read in the report path, one rule in classify_failure and their tests: about 30000 tokens, and less than one day.
Key questions
- Does
FailureEvidencealready carry the exit status?: Yes.FailureEvidencealready holds the exit status, andclassify_failurereads it as one of five fields. [sources: openspec/changes/archive/2026-11-02-3065-failure-taxonomy-and-action-table/design.md, src/devops_cli/roadmap/failure.py] - How does the Service find the class
oomnow?: Only a sign in the log gives the classoom. The Service reads no pod status, so a kill with no text in the log becomesci_infra. [sources: docs/ROADMAP_WORKFLOW.md:156, src/devops_cli/roadmap/failure.py] - Does the Service already read the pod of the Job that it reports?: Yes. The implement row reports each Job that ended and reads the last 40 lines of the log of the Job's pod. The same pod read gives the container status. [sources: k8s/README.md:651, docs/ROADMAP_WORKFLOW.md:162]
- Does the class
oomstop a continuation?: Yes. The continue rule needs the actionretryinACTION_BY_CLASS. The classoomhas the actionraise_limit, so a stop with the classoomgets no continuation Job. [sources: docs/ROADMAP_WORKFLOW.md:156, src/devops_cli/roadmap/failure.py] - Which pod status field gives the class
oom?: The terminated exit status. The Service passes exit status 137, andclassify_failuregivesoomfor it. An OOM kill always ends the container with exit 137, so the reason needs no separate field. (best practice) [sources: openspec/changes/archive/2026-11-02-3065-failure-taxonomy-and-action-table/design.md, docs/ROADMAP_WORKFLOW.md:156]- Chosen: Terminated exit status 137.
classify_failurealready reads the exit status, and the Service already passes 143 for a stall. An OOM kill ends the container with exit 137. - Rejected: Terminated reason
OOMKilledin a new evidence field. It widensFailureEvidencefor a value that the exit status already states. An OOM kill gives exit 137. - Rejected: Log text only. A kernel kill can leave the log empty. That is the defect.
- Chosen: Terminated exit status 137.
- Where does the exit status 137 rule go in
classify_failure?: Next to the existing exit status 143 rule, before the rules that match text in the log. (best practice) [sources: openspec/changes/archive/2026-11-02-3065-failure-taxonomy-and-action-table/design.md, docs/ROADMAP_WORKFLOW.md:162]- Chosen: Rule next to the exit status 143 rule. The order runs from the surest cause. An exit status is sure, and the rule runs before the text rules.
- Rejected: Rule after the text rules. A text rule can match first and give a class that hides the kill.
- Rejected: Class passed by the Service at the stop site. The exit status is already an input of
classify_failure, and a rule in the pure function is testable offline with no pod.
- Which container state does the Service read?: The Service reads
state.terminatedof the container whose log it reads, andlastState.terminatedwhenstateholds no terminated state. (best practice) [sources: k8s/README.md:651]- Chosen: The container whose log the Service reads,
statethenlastState. The log and the status must come from one container. A restarted container moves its terminated state tolastState. - Rejected: The first container status. The pod can hold more than one container, and the first is not always the runner.
- Rejected:
state.terminatedonly. A restarted container keeps the kill inlastState, so the Service would miss it.
- Chosen: The container whose log the Service reads,
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-08: in-use.
The item already names this tool.
Tool: kubernetes-client/python (https://github.com/kubernetes-client/python), Apache-2.0, last activity 2026-11-06, maintained.
Owner decision 2026-11-13
The approved pipeline split (tracker #5482, Phase 0) divides a killed attempt into classes. This section replaces the requirement "Class oom from the exit status" and its scenario. Exit status 137 alone does not give a class: a Job deadline and an eviction also end with SIGKILL (137) after the grace period.
Read the class of each ended roadmap pod from these signals:
oom: the containerterminated.reasonisOOMKilled.evicted: the pod has the conditionDisruptionTarget, or the podstatus.reasonisEvicted(rollout, node drain, eviction under node memory pressure).deadline: the Job has a condition with the reasonDeadlineExceeded.- No signal: exit status 137 with no reason stays a typed failure with no kill class.
#5493 and the result lines (#5500) read the class. An oom kill counts against the head, because the attempt spent tokens.
- A table test: exit status 137 with each signal gives its class, and 137 with no signal gives no kill class.
- Live proof: after the merge and the release, the result line of each ended roadmap Job pod of the last 7 days holds its class. A comment gives the count of each class.
Activity
dan-petty commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.The cost is bounded to at most two extra Jobs per item, but it wastes runner time and obscures the real failure class.It stops two wasted Jobs per OOM event and gives the correct failure class for reporting.The change is one field read from the Kubernetes API and one test, about 30000 tokens.Both concern the failure classifier, but #3065 delivered the taxonomy and #3065 is closed; this candidate fixes a gap where the classifier never reads pod status for OOM detection.feat(roadmap): the Service continues a Job that has no result (#3731)
devops-cli-service commentedon Nov 7, 2026
Status set to Ready at 72c52c6 (see proposed design in issue body).
dan-petty commentedon Nov 7, 2026
Answer from project standards: this item stays limited to the pod exit status and the class
oom.The wider fault is that the runner Job returns no typed result to the Service. A Job that leaves the item out exits 0, and the Service guesses from the item status. The issue "feat(roadmap): implement writes a typed result and hands off its log" (part of #3027) owns the typed result
implement.result. Do not add the typed result here.When both merge, put the exit status of this item into the same
FailureEvidencethat the Service uses for a Job with no result.devops-cli-service commentedon Nov 8, 2026
Alternatives check: in-use
Reason: The searches surfaced no dedicated OOM-detection tool; the need is a read of the Kubernetes pod container status plus project-specific classification logic. The
kubernetesPython client already used by the Service supplies exactly the status read (containerStatuses[].state.terminated/lastState.terminatedwithreasonandexitCode), but it carries no rule mapping exit 137 /OOMKilledto the classoom, noFailureEvidencewiring and no continuation policy, so it covers only part of the issue.The item already names this tool.
Tool: kubernetes-client/python (https://github.com/kubernetes-client/python)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 13, 2026
New case on 2026-11-13, release v0.129.0. The kill is now also given a code class, not only
ci_infra.devops-cli-runner-20261113-140739-174d, item fix(roadmap): a claim release leaves the item In Progress #5118. The pod state isterminated,reason: OOMKilled,exitCode: 137, at 14:24:28Z. The memory limit is 8Gi.uv run devops ci --only constructs .... No error line comes after it.job=implement item=#5118 result=stopped success=false class=types infra=false repair_rounds=0 tokens=0 seconds=1008.So the success measure of the implement job counts a memory kill as a type failure of the code, and the run reports
tokens=0although the agent made many model calls. The fix of this issue (readstate.terminatedof the pod) also corrects the measure. Please also check that the token count of a killed run comes from the model usage, not from the result file of the Job.test(roadmap): cover the pod exit status reads (#3727)
test(roadmap): avoid a new type ignore in the pod tests (#3727)
chore(main): release 0.138.0 (#5690)
devops-cli-service commentedon Nov 14, 2026
Released in v0.138.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.138.0
devops-cli-service commentedon Nov 14, 2026
Live since 2026-11-14 15:02 UTC