Skip to content

fix(funcs): reject Docker image pull stream errors - #909

Merged
dosco merged 1 commit into
ax-llm:mainfrom
Elon-Jiang:fix/docker-pull-stream-errors
Nov 18, 2026
Merged

dosco merged 1 commit into
ax-llm:mainfrom
Elon-Jiang:fix/docker-pull-stream-errors

Conversation

@Elon-Jiang

Copy link
Copy Markdown
Contributor
  • What kind of change does this PR introduce?

Bug fix to Docker image-pull result handling.

  • What is the current behavior?

AxDockerSession.pullImage() checks the HTTP status, waits for the body, and discards it. Docker can report a pull failure as an errorDetail record after flushing the response. The method resolves anyway, and createContainer() continues to /containers/create, potentially using an already cached image after the requested pull failed.

The official Docker handler writes a formatted progress error after the output has been flushed. The API schema defines CreateImageInfo.errorDetail and the legacy error field.

  • What is the new behavior?

Inspect each nonblank JSON progress record after receiving the body. Reject with the detailed error message (or legacy fallback) when the stream reports a failure; createContainer() then stops before creating a container. Successful progress, empty-body success and HTTP errors retain their existing behavior.

This is independent of #907's container-list State representation fix. This branch starts from unchanged upstream and contains only the pull-result change and its separate regression suite.

  • AxIR portable behavior check:

Only two handwritten TypeScript files under src/ax/funcs/ change. npm run axir:backlog:check -- --base fa693cd4b94c3bcaeff81ad5d5e327ada4405723 reports no portable TypeScript paths changed. No generated files, AxIR or documentation changes.

  • Other information:

Validation:

  • Public AxDockerSession + native fetch against a local Node HTTP fixture: 4 failing regressions / 3 passing controls before, 7 passing after. Covers detailed/legacy errors, detailed-message priority, stopping container creation after pull failure, successful creation, HTTP failure and empty success. The fixture splits response text across writes.
  • npm run test --workspace=@ax-llm/ax: 4,234 passing / 4 skipped; type-check, type-tests, format and lint commands exit successfully.
  • Lint emits 100 existing warnings. The complete structured diagnostic list is identical to the exact unchanged upstream baseline; zero errors.
  • Package build, changed-file cspell (zero issues), git diff --check, and the actual pre-commit hook pass.

The HTTP fixture supplies protocol-shaped progress/error events; the actual exported session/request/result-handling code runs. No real Docker daemon, registry, image pull or container was used. Prepared with AI assistance.

@dosco
dosco merged commit 4717167 into ax-llm:main Nov 18, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants