Skip to content

fix(docs): keep README tool count env-independent - #44

Merged
ManSio merged 1 commit into
mainfrom
fix/readme-tool-count-env-independent
Sep 26, 2026
Merged

ManSio merged 1 commit into
mainfrom
fix/readme-tool-count-env-independent

Conversation

@ManSio

@ManSio ManSio commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Root cause

AutoDocUpdater._count_tools added +1 for ExecuteScriptTool when MSCODEBASE_EXECUTE_SCRIPT_ENABLED=true. _update_readme used that runtime count for the public heading, so on a machine with the flag enabled (.env: MSCODEBASE_EXECUTE_SCRIPT_ENABLED=true) every reindex rewrote README.md to:

  • heading -> MCP Tools (66 total), anchor -> #mcp-tools-66-total

while the note right below and AGENTS.md:1 still say 65 registered (with the optional execute_script documented as -> 66). Result: README re-dirtied itself after each reindex and contradicted its own contract.

Fix

_update_readme now uses the deterministic base count via _count_tools(root, include_env_optional=False). _count_tools keeps returning the runtime count by default, so existing callers/tests are unchanged.

Test

  • New guard test_update_readme_tools_count_is_env_independent: with the env flag on, the heading stays at the base count.
  • tests/test_auto_doc_updater.py: 9 passed; ruff check src/ tests/: clean.

_count_tools added +1 for ExecuteScriptTool when
MSCODEBASE_EXECUTE_SCRIPT_ENABLED=true, so a reindex on a machine with
the flag on rewrote the README heading to "MCP Tools (66 total)" while
the note and AGENTS.md still say 65 — and re-dirtied README on every
reindex. _update_readme now uses the deterministic base count via
include_env_optional=False; _count_tools keeps the runtime count for
callers that need it.
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1d50bc62-29c7-4126-bd46-ca1530b45f31


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ManSio
ManSio merged commit c4928fe into main Sep 26, 2026
13 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.

1 participant