Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

fix(agent-runtime): fix doubled path in VSCode.applyEdit.spec.ts#5880

Merged
kevinvandijk merged 2 commits intoKilo-Org:mainfrom
jeremylongshore:fix/test-maintenance
Feb 15, 2026
Merged

fix(agent-runtime): fix doubled path in VSCode.applyEdit.spec.ts#5880
kevinvandijk merged 2 commits intoKilo-Org:mainfrom
jeremylongshore:fix/test-maintenance

Conversation

@jeremylongshore
Copy link

Summary

Fixes 2 test failures in @kilocode/agent-runtime caused by a doubled directory path in VSCode.applyEdit.spec.ts.

Problem

The test constructs a temp directory path using process.cwd() + a relative path that includes the package directory:

const tempDir = path.join(process.cwd(), "packages/agent-runtime/src/host/__tests__/__tmp__")

When vitest runs from the package root (/workspaces/kilocode/packages/agent-runtime), this produces a doubled path:

.../packages/agent-runtime/packages/agent-runtime/src/host/__tests__/__tmp__/apply-edit.txt

Two tests fail with ENOENT:

  • handles multi-line replacements without duplicating tail lines
  • handles mixed line endings correctly

Fix

One-line change — use __dirname (resolves to the test file's directory) instead of process.cwd() + relative path:

- const tempDir = path.join(process.cwd(), "packages/agent-runtime/src/host/__tests__/__tmp__")
+ const tempDir = path.join(__dirname, "__tmp__")

Test Results

Test Before After
VSCode.applyEdit.spec.ts (src) 2 FAIL 4 PASS
VSCode.applyEdit.spec.js (dist) 2 FAIL 4 PASS
@kilocode/agent-runtime total 110 pass, 2 fail 112 pass, 0 fail

Verified on both source (.ts) and compiled (.js) test files after rebuild.

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.
@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2026

⚠️ No Changeset found

Latest commit: 3821c5a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Collaborator

@kevinvandijk kevinvandijk left a comment

Choose a reason for hiding this comment

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

Thanks!

@kevinvandijk kevinvandijk merged commit b710afb into Kilo-Org:main Feb 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants