fix(docs): keep README tool count env-independent - #44
Merged
Merged
Conversation
_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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
AutoDocUpdater._count_toolsadded+1forExecuteScriptToolwhenMSCODEBASE_EXECUTE_SCRIPT_ENABLED=true._update_readmeused that runtime count for the public heading, so on a machine with the flag enabled (.env: MSCODEBASE_EXECUTE_SCRIPT_ENABLED=true) every reindex rewroteREADME.mdto:MCP Tools (66 total), anchor ->#mcp-tools-66-totalwhile the note right below and
AGENTS.md:1still say 65 registered (with the optionalexecute_scriptdocumented as-> 66). Result: README re-dirtied itself after each reindex and contradicted its own contract.Fix
_update_readmenow uses the deterministic base count via_count_tools(root, include_env_optional=False)._count_toolskeeps returning the runtime count by default, so existing callers/tests are unchanged.Test
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.