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

Open
opened 2026-02-16 18:18:41 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11605

State: open
Merged: No


Summary

This PR fixes two issues:

  1. Fixes #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 #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

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11605 **State:** open **Merged:** No --- ## Summary This PR fixes two issues: 1. **Fixes #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 #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
yindo added the pull-request label 2026-02-16 18:18:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13861