refactor: Bypass codemcp.main.codemcp in tests#295
Closed
ezyang wants to merge 3 commits intogh/ezyang/219/basefrom
Closed
refactor: Bypass codemcp.main.codemcp in tests#295ezyang wants to merge 3 commits intogh/ezyang/219/basefrom
ezyang wants to merge 3 commits intogh/ezyang/219/basefrom
Conversation
ezyang
added a commit
that referenced
this pull request
May 6, 2025
We recently refactored all codemcp/tools to have uniform naming convention according to subtool. Now I want all testing code to bypass codemcp.main.codemcp and instead directly call the function in main. We mostly need to update call_tool_assert_success. For BC, let's not change the signature; instead, we'll lookup the correct module.function using the passed subtool argument, and otherwise call the function with the same kwargs that codemcp would have been called with (we also recently updated all of the subtools to have exactly the same kwargs). Make this change and then run tests. ```git-revs 74f6121 (Base revision) 44aa7b8 Refactor call_tool_assert_success to bypass codemcp.main.codemcp and directly call subtool functions 0420dfe Refactor call_tool_assert_error to bypass codemcp.main.codemcp and directly call subtool functions db323cc Update get_chat_id to directly call init_project instead of codemcp.main.codemcp 370d10f Snapshot before auto-test 2102f1f Fix parameter name for init_project (using 'directory' instead of 'path') 395a8a9 Fix InitProject parameter handling to convert 'path' to 'directory' addb355 Fix InitProject parameter handling in call_tool_assert_error 334373d Fix RunCommand parameter handling in call_tool_assert_error 5503501 Fix RunCommand parameter handling in call_tool_assert_success 54063b6 Fix InitProject to ensure reuse_head_chat_id parameter is provided HEAD Fix InitProject to ensure reuse_head_chat_id parameter is provided in call_tool_assert_error ``` codemcp-id: 295-refactor-bypass-codemcp-main-codemcp-in-tests ghstack-source-id: 6b71e6e Pull-Request-resolved: #295
This was referenced May 6, 2025
ezyang
added a commit
that referenced
this pull request
May 6, 2025
We recently refactored all codemcp/tools to have uniform naming convention according to subtool. Now I want all testing code to bypass codemcp.main.codemcp and instead directly call the function in main. We mostly need to update call_tool_assert_success. For BC, let's not change the signature; instead, we'll lookup the correct module.function using the passed subtool argument, and otherwise call the function with the same kwargs that codemcp would have been called with (we also recently updated all of the subtools to have exactly the same kwargs). Make this change and then run tests. ```git-revs 74f6121 (Base revision) 44aa7b8 Refactor call_tool_assert_success to bypass codemcp.main.codemcp and directly call subtool functions 0420dfe Refactor call_tool_assert_error to bypass codemcp.main.codemcp and directly call subtool functions db323cc Update get_chat_id to directly call init_project instead of codemcp.main.codemcp 370d10f Snapshot before auto-test 2102f1f Fix parameter name for init_project (using 'directory' instead of 'path') 395a8a9 Fix InitProject parameter handling to convert 'path' to 'directory' addb355 Fix InitProject parameter handling in call_tool_assert_error 334373d Fix RunCommand parameter handling in call_tool_assert_error 5503501 Fix RunCommand parameter handling in call_tool_assert_success 54063b6 Fix InitProject to ensure reuse_head_chat_id parameter is provided b0b57ee Fix InitProject to ensure reuse_head_chat_id parameter is provided in call_tool_assert_error 4808e13 Add _dispatch_to_subtool helper method to deduplicate subtool dispatcher logic fd771ae Update call_tool_assert_error to use the _dispatch_to_subtool helper method HEAD Update call_tool_assert_success to use the _dispatch_to_subtool helper method ``` codemcp-id: 295-refactor-bypass-codemcp-main-codemcp-in-tests ghstack-source-id: 3803302 Pull-Request-resolved: #295
This was referenced May 6, 2025
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.
Stack from ghstack (oldest at bottom):
We recently refactored all codemcp/tools to have uniform naming convention according to subtool. Now I want all testing code to bypass codemcp.main.codemcp and instead directly call the function in main. We mostly need to update call_tool_assert_success. For BC, let's not change the signature; instead, we'll lookup the correct module.function using the passed subtool argument, and otherwise call the function with the same kwargs that codemcp would have been called with (we also recently updated all of the subtools to have exactly the same kwargs). Make this change and then run tests.
codemcp-id: 295-refactor-bypass-codemcp-main-codemcp-in-tests