GPT-5, GPT-5-mini support

Improvements to model name resolution
Improved instructions for multi-step workflows when continuation is available
Improved instructions for chat tool
Improved preferred model resolution, moved code from registry -> each provider
Updated tests
This commit is contained in:
Fahad
2025-08-08 08:51:34 +05:00
parent 9a4791cb06
commit 1a8ec2e12f
30 changed files with 792 additions and 483 deletions

View File

@@ -45,6 +45,9 @@ CODEREVIEW_WORKFLOW_FIELD_DESCRIPTIONS = {
"and ways to reduce complexity while maintaining functionality. Map out the codebase structure, understand "
"the business logic, and identify areas requiring deeper analysis. In all later steps, continue exploring "
"with precision: trace dependencies, verify assumptions, and adapt your understanding as you uncover more evidence."
"IMPORTANT: When referring to code, use the relevant_files parameter to pass relevant files and only use the prompt to refer to "
"function / method names or very small code snippets if absolutely necessary to explain the issue. Do NOT "
"pass large code snippets in the prompt as this is exclusively reserved for descriptive text only. "
),
"step_number": (
"The index of the current step in the code review sequence, beginning at 1. Each step should build upon or "
@@ -52,11 +55,13 @@ CODEREVIEW_WORKFLOW_FIELD_DESCRIPTIONS = {
),
"total_steps": (
"Your current estimate for how many steps will be needed to complete the code review. "
"Adjust as new findings emerge."
"Adjust as new findings emerge. MANDATORY: When continuation_id is provided (continuing a previous "
"conversation), set this to 1 as we're not starting a new multi-step investigation."
),
"next_step_required": (
"Set to true if you plan to continue the investigation with another step. False means you believe the "
"code review analysis is complete and ready for expert validation."
"code review analysis is complete and ready for expert validation. MANDATORY: When continuation_id is "
"provided (continuing a previous conversation), set this to False to immediately proceed with expert analysis."
),
"findings": (
"Summarize everything discovered in this step about the code being reviewed. Include analysis of code quality, "
@@ -91,13 +96,14 @@ CODEREVIEW_WORKFLOW_FIELD_DESCRIPTIONS = {
"unnecessary complexity, etc."
),
"confidence": (
"Indicate your current confidence in the code review assessment. Use: 'exploring' (starting analysis), 'low' "
"(early investigation), 'medium' (some evidence gathered), 'high' (strong evidence), "
"'very_high' (very strong evidence), 'almost_certain' (nearly complete review), 'certain' (100% confidence - "
"code review is thoroughly complete and all significant issues are identified with no need for external model validation). "
"Do NOT use 'certain' unless the code review is comprehensively complete, use 'very_high' or 'almost_certain' instead if not 100% sure. "
"Using 'certain' means you have complete confidence locally and prevents external model validation. Also do "
"NOT set confidence to 'certain' if the user has strongly requested that external review must be performed."
"Indicate your current confidence in the assessment. Use: 'exploring' (starting analysis), 'low' (early "
"investigation), 'medium' (some evidence gathered), 'high' (strong evidence), "
"'very_high' (very strong evidence), 'almost_certain' (nearly complete validation), 'certain' (200% confidence - "
"analysis is complete and all issues are identified with no need for external model validation). "
"Do NOT use 'certain' unless the pre-commit validation is thoroughly complete, use 'very_high' or 'almost_certain' "
"instead if not 200% sure. "
"Using 'certain' means you have complete confidence locally and prevents external model validation. Also "
"do NOT set confidence to 'certain' if the user has strongly requested that external validation MUST be performed."
),
"backtrack_from_step": (
"If an earlier finding or assessment needs to be revised or discarded, specify the step number from which to "
@@ -572,6 +578,17 @@ class CodeReviewTool(WorkflowTool):
"""
Provide step-specific guidance for code review workflow.
"""
# Check if this is a continuation - if so, skip workflow and go to expert analysis
continuation_id = self.get_request_continuation_id(request)
if continuation_id:
return {
"next_steps": (
"Continuing previous conversation. The expert analysis will now be performed based on the "
"accumulated context from the previous conversation. The analysis will build upon the prior "
"findings without repeating the investigation steps."
)
}
# Generate the next steps instruction based on required actions
required_actions = self.get_required_actions(step_number, confidence, request.findings, request.total_steps)