Skip to content

fix: extract tuple file arrays in multipart uploads - #1881

Open
jstar0 wants to merge 1 commit into
anthropics:mainfrom
jstar0:fix/skill-file-tuple-arrays
Open

fix: extract tuple file arrays in multipart uploads#1881
jstar0 wants to merge 1 commit into
anthropics:mainfrom
jstar0:fix/skill-file-tuple-arrays

Conversation

@jstar0

@jstar0 jstar0 commented Aug 24, 2026

Copy link
Copy Markdown

Summary

Multipart file extraction accepts a sequence of file tuples, but tuple arrays can be silently skipped because the generic sequence branch only recognizes individual file-like values. This change normalizes tuple entries before the generic file-content path so tuple arrays are extracted consistently for both sync and async uploads.

The change also preserves tuple deepcopy isolation for nested extraction. Existing filename and content-type handling remains unchanged.

Testing

  • uv run pytest tests/test_extract_files.py tests/test_files.py -q - 29 passed.
  • uv run ruff check src/anthropic/_files.py src/anthropic/_utils/_utils.py tests/test_extract_files.py tests/test_files.py - passed.
  • uv run ruff format --check src/anthropic/_files.py src/anthropic/_utils/_utils.py tests/test_extract_files.py tests/test_files.py - passed.
  • uv run pyright src/anthropic/_files.py src/anthropic/_utils/_utils.py tests/test_extract_files.py tests/test_files.py - 0 errors, 0 warnings, 0 informations.
  • git diff --check origin/main...HEAD - passed.

The repository scripts/lint ruff and dependency-cap stages passed. Its full-repository pyright stage still reports existing optional-extra/provider typing and missing-import errors outside the changed files; the changed-file pyright run above is the relevant type evidence for this patch. No network calls or live credentials are required for the regression.

The submitted commit is SSH-signed and GitHub exposes the required verified signature on the exact head.

Compatibility

This is backward compatible. It changes only which already-supported tuple-array inputs are extracted for multipart uploads; existing individual file values, filenames, content types, and async behavior retain their prior contracts.

@jstar0
jstar0 requested a review from a team as a code owner August 24, 2026 12:51
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.

1 participant