Exclude .kilocodeignore files from file limit in environment details
Description
Currently, the file limit is used to gather environment details files before file ignore/filtering is applied. This can prevent relevant (i.e. not ignored files) from being listed in the environment. See here.
Proposed Solution
- List more/all files
- apply filtering and ignore
- limit size of filtered list of files
Judging by reading the code this conclusion seems to be sound.
The logic for workspace files inclusion is from the superset, i.e. roo code. It is better that we keep it unless we want to optimize the context management.
Personally, I don't think the tweak on workspace files inclusion logic will be significant as showRooIgnoredFiles flag is defaulted as true and will be likely so. This way the workspace files included will almost always the first maxFiles (200) files listed by listFiles function.
As for the concern of "relevant files being excluded", it will likely to be gathered from somewhere else, e.g. visible files, recently modified files, opened tabs, as well as explicitly mentioned files in the prompt.
TLDR: we should keep the current logic.
Great point! Agreed this is not a major impact to default behavior.
Although if showRooIgnoredFiles flag is set to false there is a bug whereby the workspace files included for context may simply be empty, which can be misleading/confusing. Granted the system should be able to overcome this by listing the files of the workspace manually, this requires additional API calls and is not guaranteed.