Performance improvements when embedding files:
- Exit early at MCP boundary if files won't fit within given context of chosen model - Encourage claude to re-run with better context - Check file sizes before embedding - Drop files from older conversations when building continuations and give priority to newer files - List and mention excluded files to Claude on return - Improved tests - Improved precommit prompt - Added a new Low severity to precommit - Improved documentation of file embedding strategy - Refactor
This commit is contained in:
@@ -43,6 +43,7 @@ class ToolOutput(BaseModel):
|
||||
"refactor_analysis_complete",
|
||||
"trace_complete",
|
||||
"resend_prompt",
|
||||
"code_too_large",
|
||||
"continuation_available",
|
||||
] = "success"
|
||||
content: Optional[str] = Field(None, description="The main content/response from the tool")
|
||||
@@ -142,6 +143,15 @@ class RefactorAnalysisComplete(BaseModel):
|
||||
next_actions_for_claude: list[RefactorAction] = Field(..., description="Specific actions for Claude to implement")
|
||||
|
||||
|
||||
class CodeTooLargeRequest(BaseModel):
|
||||
"""Request to reduce file selection due to size constraints"""
|
||||
|
||||
status: Literal["code_too_large"] = "code_too_large"
|
||||
content: str = Field(..., description="Message explaining the size constraint")
|
||||
content_type: Literal["text"] = "text"
|
||||
metadata: dict[str, Any] = Field(default_factory=dict)
|
||||
|
||||
|
||||
class ResendPromptRequest(BaseModel):
|
||||
"""Request to resend prompt via file due to size limits"""
|
||||
|
||||
@@ -284,6 +294,7 @@ SPECIAL_STATUS_MODELS = {
|
||||
"refactor_analysis_complete": RefactorAnalysisComplete,
|
||||
"trace_complete": TraceComplete,
|
||||
"resend_prompt": ResendPromptRequest,
|
||||
"code_too_large": CodeTooLargeRequest,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user