Skip to content

fix(plugin): support long inventory output filenames - #1214

Merged
mldangelo-oai merged 1 commit into
openai:mainfrom
LittleYier:fix/long-inventory-output-filenames
Oct 4, 2026
Merged

mldangelo-oai merged 1 commit into
openai:mainfrom
LittleYier:fix/long-inventory-output-filenames

Conversation

@LittleYier

Copy link
Copy Markdown
Contributor

Summary

write_inventory() names its temp file .{output.name}.<random>.tmp, so a long output name pushes the temp name past the 255-byte limit and the write fails with ENAMETOOLONG.

Changes

Use a fixed . prefix for the temp file. Added a regression test with long ASCII and UTF-8 names.

Testing

Tests pass.

Risk and rollout

Only the temp file name changes.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

The inventory writer named its temporary file after the output, so a
valid output name near the 255-byte filename limit overflowed once the
prefix, random part, and suffix were added, and the update failed with
ENAMETOOLONG.
Copilot AI balanced review requested due to automatic review settings October 3, 2026 20:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the bug Something isn't working label Oct 3, 2026

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused fix. I reproduced the failure on Linux using the actual inventory CLI: a valid 242-byte destination name fails with ENAMETOOLONG before this change. With the patch, both repository and diff inventories succeed with filenames up to 255 bytes, including multibyte names, for new files and replacements.

The shorter prefix preserves same-directory atomic replacement, exclusive temporary-file creation, and cleanup. I found no consumers relying on the old temporary naming scheme. The normal scan path uses a short fixed filename, so this is a useful edge-case fix for custom output paths, with no added API or complexity.

All 78 inventory tests and all five portable source checks passed. Concurrent-write checks also passed with correct contents and no leftover temporary files. Looks good to me.

@mldangelo-oai
mldangelo-oai merged commit 1fb0e5f into openai:main Oct 4, 2026
53 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 4, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants