Skip to content

fix(status): count nested rule files recursively - #437

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
kongdayan:fix/status-count-nested-rules
Sep 8, 2026
Merged

fix(status): count nested rule files recursively#437
jeff-r2026 merged 1 commit into
Tencent:mainfrom
kongdayan:fix/status-count-nested-rules

Conversation

@kongdayan

@kongdayan kongdayan commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

teamai status called listFiles() for the rules directory, which only scans direct children. Rules organized in subdirectories (e.g. rules/common/*.md) were silently counted as zero. Switch to listFilesRecursive() to match the logic already used in RulesHandler. Fixes #436.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Test Plan

  • npx tsc --noEmit passes
  • npx vitest run passes
  • Added/updated tests for the change

Added regression test in src/__tests__/status-list.test.ts: creates
rules/common/example.md in a temp repo, calls status(), and asserts
the output contains rules: 1.

Related Issues

Fixes #436

Notes for Reviewers

One-line change in src/status.ts. The recursive helper listFilesRecursive
was already imported and used throughout RulesHandler — this PR simply
applies the same function to the status count.

  `teamai status` was calling `listFiles()` for the rules directory,
  which only scans direct children. Rules organized in subdirectories
  (e.g. `rules/common/*.md`) were silently reported as zero.

  Switch to `listFilesRecursive()` to match the counting logic already
  used in `RulesHandler`. Add a regression test that places a rule under
  `rules/common/` and asserts `rules: 1` in the status output.
@jeff-r2026
jeff-r2026 merged commit cb51ebc into Tencent:main Sep 8, 2026
7 checks passed
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.

[bug] teamai status reports rules: 0 when rules are organized in subdirectories

2 participants