Skip to content

fix: prevent Windows reserved device names from being added to directory checks and simplify bash description parameter#11605

Open
01luyicheng wants to merge 2 commits intoanomalyco:devfrom
01luyicheng:fix/windows-reserved-device-names-and-kimi-schema
Open

fix: prevent Windows reserved device names from being added to directory checks and simplify bash description parameter#11605
01luyicheng wants to merge 2 commits intoanomalyco:devfrom
01luyicheng:fix/windows-reserved-device-names-and-kimi-schema

Conversation

@01luyicheng
Copy link
Contributor

Summary

This PR fixes two issues:

  1. Fixes nul file generate #11586: Prevents Windows reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9) from being added to directory permission checks in bash tool. Previously, when running commands with output redirection to these device names (e.g., echo "test" > nul), bash tool would attempt to resolve these paths and add them to directory checks, causing issues on Windows.

  2. Fixes Kimi K2.5 Free OpenCode Zen throws an error #11591: Simplifies bash tool's description parameter to avoid JSON Schema validation errors with Kimi K2.5 model in Zen mode. The previous multi-line description with examples caused validation failures.

Changes

  • Added WINDOWS_RESERVED_DEVICE_NAMES constant with all Windows reserved device names
  • Added isWindowsReservedDeviceName() function to check if a path is a reserved device name
  • Modified path resolution logic to skip reserved device names when processing command arguments
  • Simplified description parameter from multi-line text with examples to a single concise description
  • Added comprehensive file header comment with file purpose, author, creation date, input/output signatures, dependencies, and interaction with other modules
  • Added implementation explanation for Windows reserved device name checking logic

Testing

  • Tested on Windows with commands that redirect output to nul device
  • Verified that reserved device names are properly skipped during path resolution
  • Confirmed that simplified description parameter works with Kimi K2.5 model in Zen mode

Related Issues

Fixes #11586
Fixes #11591

…ory checks and simplify bash description parameter
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
opencode-agent bot added a commit that referenced this pull request Feb 1, 2026
…g added to directory checks and simplify bash description parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kimi K2.5 Free OpenCode Zen throws an error nul file generate

1 participant