feat: Enhance model resolution for Cursor models

- Added support for Cursor models in the model resolver, allowing cursor-prefixed models to pass through unchanged.
- Implemented logic to handle bare Cursor model IDs by adding the cursor- prefix.
- Updated logging to provide detailed information on model resolution processes for both Claude and Cursor models.
- Expanded unit tests to cover new Cursor model handling scenarios, ensuring robust validation of model resolution logic.
This commit is contained in:
Shirone
2025-12-28 01:55:40 +01:00
parent 0bcc8fca5d
commit b32eacc913
6 changed files with 134 additions and 10 deletions

View File

@@ -499,8 +499,11 @@ export class CursorProvider extends BaseProvider {
// Extract model from options (strip 'cursor-' prefix if present)
let model = options.model || 'auto';
logger.debug(`CursorProvider.executeQuery called with model: "${model}"`);
if (model.startsWith('cursor-')) {
const originalModel = model;
model = model.substring(7);
logger.debug(`Stripped cursor- prefix: "${originalModel}" -> "${model}"`);
}
const cwd = options.cwd || process.cwd();