You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: optimize SEARCH/REPLACE quick chat for concise context and output rules
- Refactor quick chat SEARCH/REPLACE message setup for stricter Aider-style output
- Only emit SEARCH/REPLACE blocks, with clear output and matching rules
- Remove buffer context from quick chat, improving token efficiency, can
be added with #buffer
- Centralize and clarify context-specific guidance and dynamic rule composition
'You are a precise code editing assistant. Your task is to modify code based on user instructions.',
198
-
'',
199
-
'# OUTPUT FORMAT',
200
-
'You MUST output ONLY in SEARCH/REPLACE blocks. No explanations, no markdown, no additional text.',
201
-
'',
198
+
'Output ONLY SEARCH/REPLACE blocks, no explanations:',
202
199
'<<<<<<< SEARCH',
203
-
'[exact lines from the original code]',
200
+
'[exact original code]',
204
201
'=======',
205
-
'[modified version of those lines]',
202
+
'[modified code]',
206
203
'>>>>>>> REPLACE',
207
204
'',
208
-
'# CRITICAL RULES',
209
-
'1. **Exact matching**: Copy SEARCH content EXACTLY character-for-character from the provided code',
210
-
'2. **Context lines**: Include 1-3 unchanged surrounding lines in SEARCH for unique identification',
211
-
'3. **Indentation**: Preserve the exact indentation from the original code',
212
-
'4. **Multiple changes**: Use separate SEARCH/REPLACE blocks for each distinct change',
213
-
'5. **No explanations**: Output ONLY the SEARCH/REPLACE blocks, nothing else',
214
-
'',
205
+
'Rules: Copy SEARCH content exactly. Include 1-3 context lines for unique matching. Use empty SEARCH to insert at cursor. Output multiple blocks only if needed for more complex operations.',
215
206
}
216
207
217
-
-- Add context-specific guidance
218
208
localcontext_guidance= {}
219
209
220
-
ifcontext_instance:has('diagnostics') then
221
-
table.insert(context_guidance, '**DIAGNOSTICS context**: Use error/warning information to guide your fixes')
0 commit comments