fix(agent-runtime): fix doubled path in VSCode.applyEdit.spec.ts#5880
Merged
kevinvandijk merged 2 commits intoKilo-Org:mainfrom Feb 15, 2026
Merged
fix(agent-runtime): fix doubled path in VSCode.applyEdit.spec.ts#5880kevinvandijk merged 2 commits intoKilo-Org:mainfrom
kevinvandijk merged 2 commits intoKilo-Org:mainfrom
Conversation
process.cwd() returns the package root (/workspaces/kilocode/packages/agent-runtime) but the relative path also includes packages/agent-runtime/, doubling it: .../packages/agent-runtime/packages/agent-runtime/src/host/__tests__/__tmp__/ Fix: use __dirname (resolves to the test directory) instead of process.cwd() + relative path.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 2 test failures in
@kilocode/agent-runtimecaused by a doubled directory path inVSCode.applyEdit.spec.ts.Problem
The test constructs a temp directory path using
process.cwd()+ a relative path that includes the package directory:When vitest runs from the package root (
/workspaces/kilocode/packages/agent-runtime), this produces a doubled path:Two tests fail with
ENOENT:handles multi-line replacements without duplicating tail lineshandles mixed line endings correctlyFix
One-line change — use
__dirname(resolves to the test file's directory) instead ofprocess.cwd()+ relative path:Test Results
VSCode.applyEdit.spec.ts(src)VSCode.applyEdit.spec.js(dist)@kilocode/agent-runtimetotalVerified on both source (
.ts) and compiled (.js) test files after rebuild.