Files nested deeper than 8 levels were invisible to the whole app - #65
Merged
Conversation
MAX_DEPTH 가 8 이었다. packages/app/src/features/x/components/y/z.ts 정도면 벌써 8 이고, 그보다 깊은 파일은 트리에도 검색에도 치환에도 나타나지 않았다 — 앱 안에서 찾을 방법이 없었다는 뜻이다. 실제로 깊이 10 에 파일을 묻어 두고 readTree 를 불러 확인했다. 16 으로 올린다. node_modules 류는 IGNORE_DIRS 로 이미 빠지고 트리는 MAX_ENTRIES(4000) 로 따로 묶여 있으므로, 깊이를 올려도 비용은 디렉터리 읽기 몇 번이다. 그리고 상한을 정말 넘겼을 때 조용하지 않게 한다. - 검색은 깊이 때문에 안 걸어 본 곳이 있으면 deepSkipped 로 알린다. 예전엔 그냥 결과 0 이었다 — 검색은 "여기 없다" 의 근거로 쓰이는데, 안 찾아본 것과 없는 것이 같은 답으로 나오고 있었다. 패널에 "일부 미탐색" 을 띄우고, 에이전트에게도 같은 말을 붙인다. - list_files 는 트리가 잘렸다는 사실(ws.truncated)을 모델에게 말하지 않고 있었다. 화면에는 "항목이 많아 일부만 표시합니다" 라고 적어 두면서. 그래서 없는 게 아니라 안 걸어 본 파일을 "없다" 로 읽곤 했다. 실제 앱 검증 5/5 — 깊이 10 파일이 트리와 검색 양쪽에 나오고, 깊이 20 을 묻으면 그때는 미탐색이라고 답한다. 단위 972개 통과.
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.
The bug
MAX_DEPTHwas 8. Every discovery path in the app — the file tree, search, and replace-all — walks with that limit, so a file nested deeper than 8 levels appeared in none of them. There was no way to find it from inside the app.That depth is not exotic:
packages/app/src/features/x/components/y/z.tsis already 8.Verified in the real app — a file at depth 10 was simply absent from
readTree.The fix
Depth is now 16.
IGNORE_DIRSalready excludesnode_modulesand friends, and the tree is separately bounded byMAX_ENTRIES(4000), so the extra cost is a handful ofreaddircalls.And when a limit is genuinely hit, it no longer passes as an answer:
deepSkippedwhen it stopped at the depth limit. Before, that case was indistinguishable from "no matches" — and search is what people (and the model) use as evidence that something is not there. The panel shows "일부 미탐색" with a tooltip; the agent gets the same sentence.list_filesnever told the model that the tree was truncated, even though the sidebar says so on screen. So files that were merely never walked read back as "does not exist" — and the model would go create one that was already there.Verification
Real-app probe (CDP), 5/5:
readTreeand is found bysearchFiles(a/b/c/d/e/f/g/h/i/j/buried.ts),deepSkippedinstead of silently returning nothing.972 unit tests passing.
npm run typecheckclean.main.cjsline endings unchanged (1893 CRLF / 0 LF).