test(tools): trim aijson re-tests, keep docker-agent integration#2905
Open
trungutt wants to merge 2 commits into
Open
test(tools): trim aijson re-tests, keep docker-agent integration#2905trungutt wants to merge 2 commits into
trungutt wants to merge 2 commits into
Conversation
Follow-up to docker#2899. The repair_test.go suite shipped in that PR duplicates github.com/docker/aijson's own test cases through the NewHandler facade. Per rumpl's review comment, the docker-agent-specific surface area worth pinning is narrower: - NewHandler delegates to aijson.Unmarshal (wiring canary) - the OnRepair hook emits tool_input_repaired with tool + repairs fields - the hot path stays quiet for well-formed calls Drop pkg/tools/repair_test.go and add those three tests to the existing tools_test.go. aijson covers the repair semantics themselves.
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The three stated contracts (aijson wiring, tool_input_repaired telemetry, hot-path quiet) are all covered by the new tests and the removal of the duplicate aijson re-tests is well-motivated. Two low-severity observations are left as inline comments.
Track the exported Kind constant rather than its underlying string value so the assertion follows the library if aijson ever renames the symbol. Addresses bot review on PR docker#2905.
dgageot
approved these changes
May 27, 2026
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.
Follow-up to #2899 addressing @rumpl's review comment on
pkg/tools/repair_test.go("Why do we still need this?").Why
After #2899 swapped the in-tree shape-repair layer for
github.com/docker/aijson, most ofpkg/tools/repair_test.gobecame a thin re-test of aijson's own test suite through theNewHandlerfacade. EveryTestNewHandler_*case in that file had a directTestUnmarshal_*counterpart in aijson.Keeping both copies means every aijson behavior change has to be mirrored in two places, and the docker-agent suite slowly turns into a brittle snapshot of an external library.
Those three concerns live in
pkg/tools/tools_test.gonow alongside the otherNewHandlertests; the standalonerepair_test.gois removed.