Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [1.2.3] - 2026-02-24

### Fixed

- **set_current_directory metadata bug**: Fixed `previousDirectory` field returning the requested path instead of the actual previous working directory
- Corrected state consistency when `process.chdir()` fails - `serverActiveCwd` is no longer updated on failed directory changes

### Added

- Comprehensive test coverage (20 tests) for `set_current_directory` tool
- Tests cover path validation, normalization, state management, metadata verification, and edge cases
- New test file: `tests/setCurrentDirectory.test.ts`

## [1.2.2] - 2026-02-14

### New Features
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wcli0",
"version": "1.2.2",
"version": "1.2.3",
"description": "Enhanced MCP server for Windows CLI interactions with advanced configuration and security features",
"type": "module",
"bin": {
Expand Down
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1028,18 +1028,21 @@ class CLIServer {
}
}

// Store the actual previous directory for metadata
const actualPreviousDir = this.serverActiveCwd;

// Change directory and update server state
process.chdir(newDir);
this.serverActiveCwd = newDir;

return {
content: [{
type: "text",
text: `Current directory changed to: ${newDir}`
}],
isError: false,
metadata: {
previousDirectory: args.path,
previousDirectory: actualPreviousDir || undefined,
newDirectory: newDir
}
};
Expand Down
Loading