Skip to content

fix(agent-manager): keep new files with non-ASCII names when moving a chat to a worktree - #15045

Merged
WebReflection merged 2 commits into
Kilo-Org:mainfrom
hdcodedev:fix/worktree-unicode-untracked
Oct 16, 2026
Merged

WebReflection merged 2 commits into
Kilo-Org:mainfrom
hdcodedev:fix/worktree-unicode-untracked

Conversation

@hdcodedev

@hdcodedev hdcodedev commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Fixes #15044

Context

Move to Worktree left new, untracked files with accented or non-Latin names, such as résumé.txt, in the source folder. The worktree and the conversation opened with no warning, so the agent kept working without part of the user's files. With this change, those files are copied like any other new file.

Implementation

  • By default, Git prints a name like résumé.txt in an escaped form. The move read that escaped text as the file name, could not find the file, and skipped it. It now asks Git for the real names (git-transfer.ts, capture), the same way services/git/context.ts already does.
  • Added three tests in git-transfer.test.ts: non-ASCII names, a full move into a real worktree, and a name ending in a space. All three fail without the fix.

Not changed here:

  • The Agent Manager diff and the Changes view still show these names in escaped form, and the worktree +/− stats leave them out. Unchanged by this PR; they need their own fix.
  • A file that fails to read is still skipped with only a log line. Unchanged by this PR.
  • On Linux, file names that are not valid UTF-8 still fail. Also happens on main.

Screenshots / Video

Before

worktree-skips-unicode-files-before.mp4

After

worktree-skips-unicode-files-after.mp4

How to Test

Manual/local verification

  • (human) Verified the implementation.
  • (agent) Recorded the reviewer steps below in an isolated VS Code dev window, before and after the fix. Before, git status in the new worktree lists only plain.txt. After, it lists both files, and both files and their contents were checked on disk.
  • (agent) From packages/kilo-vscode/: bun run typecheck, eslint and prettier on the changed files, and bun test tests/unit/git-transfer.test.ts tests/unit/continue-in-worktree.test.ts tests/unit/agent-manager-arch.test.ts (118 pass). The pre-push monorepo typecheck also passed.

Reviewer test steps

Create a disposable Git folder:

mkdir unicode-repro && cd unicode-repro
git init -b main
echo "# Repro" > README.md
git add README.md
git commit -m init

Open it in an isolated VS Code window. From the Kilo repository root, run bun run extension:isolated -- <path to unicode-repro>.

  1. Open the Kilo Code sidebar, click History, and open a previous chat in this folder. If there is none, start one and send Reply with OK.

  2. Open Terminal → New Terminal and run:

    echo "ASCII file" > plain.txt
    echo "Unicode file" > résumé.txt
    git status

    Both files are untracked. Git prints résumé.txt as "r\303\251sum\303\251.txt".

  3. In the Kilo chat, click Move to Worktree above the prompt. Wait for the conversation to open in Agent Manager.

  4. In Agent Manager, click Open Terminal (the terminal icon at the top right).

  5. Run git status. Both plain.txt and "r\303\251sum\303\251.txt" are listed. On main, only plain.txt is listed.

Blocked checks and substitute verification

  • None blocked. All checks ran on macOS; Windows and Linux were not run.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

@github-actions github-actions Bot added area:agent-manager Agent Manager area:vscode VS Code extension community Opened by someone outside the Kilo team needs-triage Waiting for a maintainer to look labels Oct 14, 2026
@hdcodedev
hdcodedev marked this pull request as ready for review October 14, 2026 01:29
@kilo-code-bot

kilo-code-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The fix switches untracked-file discovery from git ls-files via raw() (which trimmed output and split on \n) to git ls-files -z split on \0. This is correct: -z disables core.quotePath escaping and NUL separation preserves trailing spaces and newline-containing names. Tests cover non-ASCII names, trailing-space names, and a real worktree apply. Changeset is present with user-facing wording. No shared upstream opencode files are modified.

Files Reviewed (3 files)
  • .changeset/worktree-unicode-untracked.md
  • packages/kilo-vscode/src/agent-manager/git-transfer.ts
  • packages/kilo-vscode/tests/unit/git-transfer.test.ts

Reviewed by deepseek-v4.1-flash · Input: 41.2K · Output: 4.1K · Cached: 233.1K

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent-manager Agent Manager area:vscode VS Code extension community Opened by someone outside the Kilo team needs-triage Waiting for a maintainer to look

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Move to Worktree silently skips new files with non-ASCII names

2 participants