Repository navigation
fix(funcs): reject Docker image pull stream errors - #909
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix to Docker image-pull result handling.
AxDockerSession.pullImage()checks the HTTP status, waits for the body, and discards it. Docker can report a pull failure as anerrorDetailrecord after flushing the response. The method resolves anyway, andcreateContainer()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.errorDetailand the legacyerrorfield.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.
Only two handwritten TypeScript files under
src/ax/funcs/change.npm run axir:backlog:check -- --base fa693cd4b94c3bcaeff81ad5d5e327ada4405723reports no portable TypeScript paths changed. No generated files, AxIR or documentation changes.Validation:
AxDockerSession+ nativefetchagainst 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.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.