Skip to content

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

Merged
sng-asyncfunc merged 1 commit into
AsyncFuncAI:mainfrom
nyjin:fix/wiki-structure-filter-args
Nov 10, 2026
Merged

sng-asyncfunc merged 1 commit into
AsyncFuncAI:mainfrom
nyjin:fix/wiki-structure-filter-args

Conversation

@nyjin

@nyjin nyjin commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

_determine_structure passes the file filters to read_repo_file_tree by position, in the order excluded_dirs, excluded_files, included_dirs, included_files:

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

The function takes them in a different order:

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

So the file tree sent to the LLM for the wiki structure swaps each exclusion with an inclusion. For example, excluded_dirs=["node_modules"] arrives as included_files=["node_modules"]. That switches iterate_files into inclusion mode, and the structure prompt ends up with an empty or wrong file tree. With included_dirs=["src"], the value lands in excluded_files and nothing is restricted.

Indexing and page generation are not affected. prepare_repo_index and ChatCompletionRequest already pass the filters by keyword, so only the structure step disagrees with them.

Fix

  • api/services/wiki/tasks.py: pass the four filters by keyword.

Tests

Added test_determine_structure_passes_file_filters to tests/backend/services/test_wiki_task.py. It runs _determine_structure with a stubbed Repo, file tree reader and research_chat, and checks that each filter reaches read_repo_file_tree under its own name.

  • on main: 1 failed (the filters arrive by position)
  • with the change: passes; pytest tests/test_config.py tests/backend: 64 passed
  • ruff check reports the same 3 pre-existing issues in these two files as on main, and nothing on the changed lines.

_determine_structure passed the filters to read_repo_file_tree in
(excluded_dirs, excluded_files, included_dirs, included_files) order,
but the function takes (included_files, included_dirs, excluded_files,
excluded_dirs). The file tree sent to the LLM for the wiki structure
applied exclusions as inclusions and the other way around. Pass them
by keyword.
@sng-asyncfunc
sng-asyncfunc merged commit e7fd468 into AsyncFuncAI:main Nov 10, 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.

2 participants