instructions entries silently deduplicated by basename — a second file sharing a loaded file's basename never reaches context (OpenCode loads both)
What: entries in the instructions array (project kilo.json / global ~/.config/kilo/kilo.json) are deduplicated by basename: an entry whose file name matches an already-loaded instruction file is silently dropped — no warning, no log line. Upstream OpenCode (which this CLI forked from) loads both.
Measured on @kilocode/[email protected], macOS, 2026-11-14:
- Global
instructionsalready loads…/.agents/memory/MEMORY.md. - Project
instructionsadds a different path that also ends inMEMORY.md(a second project memory index, real file, different directory). kilo debug configresolves the entry fine. A run asked to list every receivedMEMORY.mdnames exactly one and quotes the global one's content — the project-scope file never reaches the prompt.- Rename the same file to any other basename (e.g.
OMNIX-MEMORY-INDEX.md) → it loads and quotes verbatim. Different real paths, same basename → dropped, so the dedup keys on basename.
Also observed on 7.8.27 (all silent): symlinked instruction files are skipped (regular files load); a missing/broken entry is skipped gracefully. The silence is what makes the dedup invisible — context loss with a green debug output.
History: on a pre-7.8 build (2026-09-15) a differently-named instruction file hung the run entirely (provider request never returned, 4/4 reproductions, project and global scope). That hang is fixed in 7.8.27 — the same repro now answers in 25–55 s. Only the basename dedup remains.
Ask: either load same-basename entries (match OpenCode's behaviour) or log a loud warning whenever an instructions entry is dropped or skipped, so silent context loss is diagnosable from kilo debug.
I'd like to take this one. I couldn't reproduce basename dedup on 7.8.27 or current main. Two MEMORY.md files at different paths both load. What I do see is that a project kilo.json entry pointing outside the project root is dropped silently, whatever its name. That's an intentional security block, but it gives no warning. Was your second MEMORY.md outside the project directory? I have a PR ready that logs a warning whenever an instruction file is skipped.
Yes — our second MEMORY.md lives under ~/.claude/projects/<project>/memory/, outside the project root. Your explanation matches a fresh measurement on our side: a file named MEMORY.md placed INSIDE the project root (same basename as the loaded global one) loads fine — the run quoted both verbatim. So the drop we reported was the outside-root block, not basename dedup; our original title was wrong and our docs are now corrected. The silent skip is exactly what made this hard to diagnose — thanks for the warning PRs.
Thanks for confirming. Since the drop was the outside-root block, #16203 (warning when an instruction file is skipped) covers this, so I've switched it to close this issue on merge. Would you mind updating the issue title to something like "instruction file outside the project root is skipped silently" so it matches?