Skip to content

fix: pass file filters to the wiki structure step by keyword - #627

Closed
yeonjin-roh wants to merge 1 commit into
AsyncFuncAI:mainfrom
yeonjin-roh:fix/wiki-structure-filter-args
Closed

yeonjin-roh wants to merge 1 commit into
AsyncFuncAI:mainfrom
yeonjin-roh:fix/wiki-structure-filter-args

Conversation

@yeonjin-roh

Copy link
Copy Markdown

Problem

_determine_structure (api/services/wiki/tasks.py) passes the file filters to read_repo_file_tree positionally:

read_repo_file_tree(repo.save_path, r.excluded_dirs, r.excluded_files, r.included_dirs, r.included_files)

but the signature is:

def read_repo_file_tree(path, included_files=None, included_dirs=None, excluded_files=None, excluded_dirs=None)

So when building the file tree sent to the LLM for the wiki structure, excluded_dirs is treated as included_files, included_files as excluded_dirs, and so on. For example, excluding node_modules puts the structure step into inclusion mode, and the LLM only sees files matching that pattern. Indexing and page generation are not affected; they get the filters by keyword through ChatCompletionRequest.

Fix

Pass the filters by keyword.

Test

Added test_determine_structure_passes_file_filters, which checks that each filter reaches read_repo_file_tree under the right name. It fails before the fix and passes after. pytest tests/backend: 54 passed.

Not related to #593, which changes how the filters are matched in api/config.py.

🤖 Generated with Claude Code

_determine_structure called read_repo_file_tree with the filters in
(excluded_dirs, excluded_files, included_dirs, included_files) order,
but the function takes (included_files, included_dirs, excluded_files,
excluded_dirs). Exclusions were applied as inclusions and vice versa
when building the file tree sent to the LLM.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@yeonjin-roh yeonjin-roh closed this Nov 9, 2026
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.

1 participant