Migrate RefactorCode tool to AIGW
What does this MR do and why?
Related to Migrate Duo Chat Tools: RefactorCode (#475048 - closed)
In this MR, we:
- Add
prompt_migration_refactor_codeFF - Migrate the
RefactorCodetool to use the AIGW - Use
UseAiGatewayAgentPromptconcern with a FF
How to set up and validate locally
- Run AI Gateway with Anthropic debug:
ANTHROPIC_LOG=debug poetry run ai_gateway - Checkout
migrate-refactor-codein the AIGW - Enable
prompt_migration_refactor_codefeature flag on Rails (::Feature.enable(:prompt_migration_refactor_code)) - Perform
/refactorslash command in Duo Chat, eg../refactor "Here is the summary for #{resource_name} ##{resource.iid} comments:" - Verify that
/v1/prompts/chat/refactor_codeendpoint is called in the AIGW - Verify that the correct prompt is sent to Anthropic
Edited by Mohamed Hamda