You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(status,exec): surface container termination causes (OOMKilled)
An OOMKilled container previously showed up as ready=1/2 with reason "-"
in status, and as a bare `container not found` from exec/jobs — every
diagnosis required kubectl and hand-digging containerStatuses.
- PodSummary now carries ContainerIssues (reason/exitCode/finishedAt,
current-vs-before-restart) extracted from containerStatuses; the pod
Reason falls back to the termination reason when no waiting reason
applies.
- `status --details` prints one line per abnormal termination, e.g.
`container pytorch: OOMKilled (exit 137, finished ...)`, and JSON gains
a containerIssues array.
- exec FAILED summaries, single-pod exec errors, and jobs list/logs
errors append the termination cause when the target container is gone,
via GetContainerRestartInfo (now also reads the current terminated
state — restartPolicy Never leaves LastTerminationState empty — and
records FinishedAt).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* style: gofmt podSummaryFromPod literal alignment
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/command-reference.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,8 @@ agents can react without launching a diagnostic chain on every blip:
58
58
- Shows session status for the current or selected session.
59
59
- When `session` is provided, `okdev` can resolve the saved config from session metadata even outside the repo.
60
60
-`--details`: prints a single-session diagnostic view with target selection, pod list, pod IP and node placement, mount persistence, sync path semantics, managed SSH state, key local paths, and target pod details.
61
-
- Detailed JSON output includes per-pod mount metadata and a `pathSemantics` section describing which configured sync paths are shared via the workspace sync and which are expected to survive a session restart.
61
+
- Abnormally terminated containers are surfaced per pod, e.g. `container pytorch: OOMKilled (exit 137, finished 2026-07-05T06:32:11Z)` — both the current state (container stayed down) and the last termination before a restart (suffixed `before last restart`). The pod `reason` column also falls back to the termination reason when no waiting reason applies.
62
+
- Detailed JSON output includes per-pod mount metadata, a `containerIssues` array (`container`, `reason`, `exitCode`, `finishedAt`, `current`), and a `pathSemantics` section describing which configured sync paths are shared via the workspace sync and which are expected to survive a session restart.
62
63
-`--details` is only valid when exactly one session is selected.
63
64
64
65
### `okdev target show`
@@ -130,6 +131,7 @@ agents can react without launching a diagnostic chain on every blip:
130
131
- Lists detached `okdev exec --detach` jobs across the session's running pods.
131
132
- Reads job metadata from `/var/okdev/exec/*.json` in the target container (plus the legacy `/tmp/okdev-exec/` location for jobs launched by older okdev versions).
132
133
- If the target container is gone (e.g. OOMKilled), listing and `jobs logs` automatically retry through the `okdev-sidecar` container, which mounts the same runtime volume.
134
+
- When a command fails because the container is gone, the error carries the termination cause when it can be determined, e.g. `container "pytorch" terminated: OOMKilled (exit 137, finished 2026-07-05T06:32:11Z)`. The same hint is appended to `okdev exec` FAILED lines and single-pod exec errors.
133
135
- Text output is grouped by logical job id, with one row per detached launch showing job id, summarized state, pod count, earliest start time, and original command.
134
136
- JSON output includes both the logical job summary and the per-pod `podStates` records.
135
137
- State values: `running` (wrapper alive and user command in flight), `exited` (user command finished; exit code is recorded in `podStates` / JSON), and `orphaned` (metadata still says `running` but the pid has exited or been recycled - typically the wrapper was `SIGKILL`ed or the container was restarted before the completion metadata could be written). Grouped text summaries render forms such as `running(1/2)`, `exited(2/2)`, and `failed(1/2)`.
0 commit comments