Commit 29feb03
fix(inference): report a probe image-pull failure as its own diagnostic (#9311)
<!-- markdownlint-disable MD041 -->
## Summary
When the container reachability probe image was absent from the local
Docker cache and Docker could not pull it, onboarding reported the
failure as a provider networking problem: "the Docker container
reachability check failed for http://host.openshell.internal:11434" with
the lumped diagnostic "Docker command failed (image pull error or
runtime failure)". On WSL2 reached over a remote Windows OpenSSH
session, Docker Desktop's `desktop.exe` credential helper has no logon
session, blocks the pull of the public probe image, and hits exactly
this path. After this change that case is reported as a Docker
image-pull failure with the reporter-verified recovery, and networking
is not blamed for a check that never ran.
## Related Issue
Closes #9308
## Changes
- `src/lib/inference/local.ts`: when all reachability retries and both
diagnostic re-probes produce empty output, classify before reporting.
`classifyContainerRunFailure` uses data the existing stdout-only capture
seam already provides: `docker version` answers (daemon is up) while
`docker image inspect` finds no local copy of `curlimages/curl:8.10.1`
(the probe image was never available). In that case:
- The message states the check could not run and names the failure
class: "This is a Docker image-pull failure, not an Ollama networking
failure." (vLLM wording for `vllm-local`.)
- The diagnostic names the credential-helper cause (`credsStore` in
`~/.docker/config.json` failing in a remote login session) and prints
the recovery the reporter verified: `DOCKER_CONFIG=$(mktemp -d) docker
pull curlimages/curl:8.10.1` followed by `nemoclaw onboard --resume`.
- Every other failure keeps the existing messages: daemon not answering,
probe image present, partial diagnostic output, and the invalid-command
guard all report exactly as before.
- `src/lib/inference/local.test.ts`: three cases — image-pull
classification for `ollama-local` and `vllm-local` (message,
remediation, and absence of the networking misreport), and a
present-image case pinning the unchanged runtime-failure report.
## Design notes for reviewers
- **Classification never parses Docker error text.** Docker writes pull
progress to stderr on success and its error wording varies across
versions and platforms, so matching stderr signatures is fragile — the
daemon-answers + image-absent probe is stable across Docker Desktop,
rootless, and remote contexts, and it reuses the same injected
`RunCaptureFn` seam as every other probe in this file. No new
dependency-injection parameter, no stderr capture, and
`src/lib/inference/local.ts` gains no new imports (its fan-out is pinned
at exactly 21 in `ci/source-architecture-budget.json`).
- **The two extra `docker` invocations run only on the already-failed
path**, after three failed probe attempts and two empty diagnostic
re-probes. The success path is untouched.
- **The hard stop is retained deliberately.** The same broken credential
helper would block later sandbox image pulls, so warn-and-continue would
only defer the failure to a worse place. The printed pre-pull repairs
both. If maintainers prefer the warn-and-continue carveout that
`vllm-local.ts` and the auth-proxy path already use for host-responding
cases, that is a small follow-up.
- **Out of scope:** a pre-pull or image-presence gate before the probe
runs (an onboarding flow change), and capturing stderr in the retry loop
(any non-empty output would false-positive the health acceptor).
## Type of Change
- [x] Code change (feature, bug fix, or refactor)
## Quality Gates
- [x] Tests added or updated for changed behavior
- [x] Docs not applicable — justification: no documentation quotes the
previous message or diagnostic (verified by repo-wide grep); the changed
text is a CLI error surface only.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
Validation on `7d4f96ae63`:
- `npx vitest run src/lib/inference/local.test.ts` — 86 passed (3 new).
- `npx vitest run src/lib/actions/inference-set.test.ts
src/lib/onboard/inference-providers` — 46 passed (consumers of
`validateLocalProvider`).
- `npm run typecheck:cli` — clean.
- `npx oxlint` on both changed files — clean.
- `npm run test-size:check` — passed (`local.test.ts` is 1429 lines
against the 1500 budget).
- `npm run source-shape:check` — `source_shape_cases=0`.
- Changed-test-file `if` count unchanged (21 at head, 21 at base) — new
mocks dispatch on command content with ternaries.
| Case | Asserts |
|---|---|
| Daemon up, probe image absent (`ollama-local`) | image-pull message,
no networking misreport, `DOCKER_CONFIG` pre-pull + `onboard --resume`
remediation |
| Daemon up, probe image absent (`vllm-local`) | image-pull message with
vLLM wording |
| Daemon up, probe image present | unchanged "reachability check failed"
+ runtime-failure diagnostic |
| All probes empty, daemon not answering | covered by the existing
tests, unchanged |
## Documentation Writer Review
- [ ] Documentation writer subagent reviewed the completed changes
- Result: `no-docs-needed`
- Evidence: repo-wide grep shows no documentation references the changed
message or diagnostic text; `docs/inference/set-up-ollama.mdx` and the
WSL pages describe onboarding behavior at a level this change does not
alter.
- Agent: Claude Code
Signed-off-by: Dongni Yang <dongniy@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved local provider diagnostics when Docker probe images are
unavailable.
* Added clear image-pull guidance for missing Ollama and vLLM probe
images.
* Preserved existing container-runtime error details when the required
image is available but the runtime cannot be reached.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Dongni Yang <dongniy@nvidia.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 3606cb4 commit 29feb03
3 files changed
Lines changed: 139 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
302 | 356 | | |
303 | 357 | | |
304 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1168 | 1172 | | |
1169 | 1173 | | |
1170 | 1174 | | |
1171 | 1175 | | |
1172 | 1176 | | |
1173 | | - | |
| 1177 | + | |
1174 | 1178 | | |
1175 | 1179 | | |
1176 | 1180 | | |
1177 | 1181 | | |
1178 | 1182 | | |
1179 | | - | |
| 1183 | + | |
1180 | 1184 | | |
1181 | 1185 | | |
1182 | 1186 | | |
1183 | 1187 | | |
1184 | 1188 | | |
1185 | | - | |
| 1189 | + | |
1186 | 1190 | | |
1187 | 1191 | | |
1188 | 1192 | | |
1189 | 1193 | | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
1190 | 1213 | | |
1191 | 1214 | | |
1192 | 1215 | | |
| |||
1204 | 1227 | | |
1205 | 1228 | | |
1206 | 1229 | | |
1207 | | - | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
1208 | 1278 | | |
1209 | 1279 | | |
1210 | 1280 | | |
1211 | 1281 | | |
1212 | 1282 | | |
1213 | | - | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1214 | 1286 | | |
1215 | 1287 | | |
1216 | 1288 | | |
| |||
1253 | 1325 | | |
1254 | 1326 | | |
1255 | 1327 | | |
1256 | | - | |
| 1328 | + | |
1257 | 1329 | | |
1258 | 1330 | | |
1259 | 1331 | | |
| |||
1271 | 1343 | | |
1272 | 1344 | | |
1273 | 1345 | | |
1274 | | - | |
| 1346 | + | |
1275 | 1347 | | |
1276 | | - | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1277 | 1351 | | |
1278 | 1352 | | |
1279 | 1353 | | |
| |||
0 commit comments