test(filesystem): extend structured-content integration coverage to all 14 tools - #4046
Closed
yakuphanycl wants to merge 1 commit into
Closed
Conversation
…ll 14 tools The existing test file only covered 5 of 14 tools (directory_tree, list_directory_with_sizes, move_file, list_directory, search_files). This commit adds integration tests for the remaining 9 tools: - read_text_file, read_file (deprecated back-compat), read_multiple_files - write_file (with on-disk verification) - edit_file (live edit + dryRun variant) - create_directory (with idempotency check) - get_file_info, list_allowed_directories - read_media_file (array outputSchema, minimal PNG fixture) Each test asserts that structuredContent.content matches the declared outputSchema type (string for 13 tools, array for read_media_file), closing the regression class identified in #3110, #3106, #3093 for the full tool surface. Coverage: 5/14 → 14/14 tools, 5 → 16 test cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
The existing
structured-content.test.tsonly covered 5 of 14 registered tools. This PR extends integration coverage to all 14 tools (16 test cases), closing the regression class for the full tool surface.New test coverage
read_text_filestringread_file(deprecated)stringread_text_fileread_multiple_filesstringwrite_filestringedit_filestringedit_file(dryRun)stringcreate_directorystringfs.stat+ idempotencyget_file_infostringsizelist_allowed_directoriesstringread_media_filearrayimagetype,image/pngmime, base64 dataPreviously covered (preserved)
directory_tree,list_directory_with_sizes,move_file,list_directory,search_filesMotivation
Issues #3110, #3106, #3093 identified a structuredContent shape bug (
contentwas an array instead of a string). The original test file verified the fix for 5 tools; the remaining 9 tools had no regression coverage. This PR ensures any future schema drift is caught at test time for the entire tool surface.read_media_filenoteread_media_fileis the only tool whoseoutputSchemadeclarescontentas an array (of{ type, data, mimeType }objects). The test asserts the current shape. A TODO comment references a pending envelope reconciliation tracked separately.Test plan
npx vitest run __tests__/structured-content.test.ts— 16/16 passnpx vitest run— full suite: 156 pass, 1 pre-existing Windows-specific failure inpath-validation.test.ts(unrelated,isPathWithinAllowedDirectories('D:\other', ['/']))npm run build— tsc clean (test files excluded via tsconfig)index.ts,lib.ts, etc.) — test-only PR