diff --git a/CHANGELOG.md b/CHANGELOG.md index feab363b..75063d1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Configurable subagent runtimes with per-subagent model selection and ACP-specific runtime options - Diagnostics tool call rendering in the agent UI - Custom OpenAI Responses API support with configurable context window and output size +- New Mercury Edit 2 Model ### Fixed diff --git a/src/main/kotlin/ee/carlrobert/codegpt/settings/migration/LegacySettingsMigration.kt b/src/main/kotlin/ee/carlrobert/codegpt/settings/migration/LegacySettingsMigration.kt index d22a03e1..ed6af4c0 100644 --- a/src/main/kotlin/ee/carlrobert/codegpt/settings/migration/LegacySettingsMigration.kt +++ b/src/main/kotlin/ee/carlrobert/codegpt/settings/migration/LegacySettingsMigration.kt @@ -63,7 +63,7 @@ object LegacySettingsMigration { setModelSelection(FeatureType.CODE_COMPLETION, codeModel, selectedService) val nextEditModel = if (selectedService == ServiceType.PROXYAI) { - ModelCatalog.MERCURY_CODER + ModelCatalog.MERCURY_EDIT2 } else { resolveAvailableModel( serviceType = selectedService, @@ -190,7 +190,7 @@ object LegacySettingsMigration { serviceType = serviceType, featureType = FeatureType.CODE_COMPLETION, preferredModel = service().state.codeCompletionSettings.model, - fallbackModel = ModelCatalog.MERCURY_CODER + fallbackModel = ModelCatalog.MERCURY_EDIT2 ) } @@ -246,7 +246,7 @@ object LegacySettingsMigration { resolveAvailableModel( serviceType = serviceType, featureType = FeatureType.CODE_COMPLETION, - fallbackModel = ModelCatalog.MERCURY_CODER + fallbackModel = ModelCatalog.MERCURY_EDIT2 ) } } diff --git a/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelCatalog.kt b/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelCatalog.kt index 672a474e..3e9704d7 100644 --- a/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelCatalog.kt +++ b/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelCatalog.kt @@ -43,12 +43,12 @@ class ModelCatalog { private val defaultModelRefs = mapOf( FeatureType.AGENT to DefaultModelRef(ServiceType.PROXYAI, PROXYAI_AUTO), FeatureType.CHAT to DefaultModelRef(ServiceType.PROXYAI, PROXYAI_AUTO), - FeatureType.AUTO_APPLY to DefaultModelRef(ServiceType.PROXYAI, MERCURY_CODER), + FeatureType.AUTO_APPLY to DefaultModelRef(ServiceType.PROXYAI, MERCURY_EDIT2), FeatureType.COMMIT_MESSAGE to DefaultModelRef(ServiceType.PROXYAI, Haiku_4_5.id), FeatureType.INLINE_EDIT to DefaultModelRef(ServiceType.PROXYAI, Haiku_4_5.id), FeatureType.LOOKUP to DefaultModelRef(ServiceType.PROXYAI, Haiku_4_5.id), - FeatureType.CODE_COMPLETION to DefaultModelRef(ServiceType.PROXYAI, MERCURY_CODER), - FeatureType.NEXT_EDIT to DefaultModelRef(ServiceType.PROXYAI, MERCURY_CODER), + FeatureType.CODE_COMPLETION to DefaultModelRef(ServiceType.PROXYAI, MERCURY_EDIT2), + FeatureType.NEXT_EDIT to DefaultModelRef(ServiceType.PROXYAI, MERCURY_EDIT2), ) fun getAllModelsForFeature(featureType: FeatureType): List { @@ -106,6 +106,6 @@ class ModelCatalog { const val LLAMA_3_2 = "llama3.2" const val MERCURY2 = "mercury-2" - const val MERCURY_CODER = "mercury-edit-2" + const val MERCURY_EDIT2 = "mercury-edit-2" } } diff --git a/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelProvider.kt b/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelProvider.kt index f08f3a8d..5d774fe2 100644 --- a/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelProvider.kt +++ b/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelProvider.kt @@ -19,7 +19,7 @@ import ee.carlrobert.codegpt.agent.clients.InceptionAILLMClient import ee.carlrobert.codegpt.agent.clients.ProxyAILLMClient import ee.carlrobert.codegpt.completions.llama.LlamaModel import ee.carlrobert.codegpt.settings.models.ModelCatalog.Companion.MERCURY2 -import ee.carlrobert.codegpt.settings.models.ModelCatalog.Companion.MERCURY_CODER +import ee.carlrobert.codegpt.settings.models.ModelCatalog.Companion.MERCURY_EDIT2 import ee.carlrobert.codegpt.settings.service.FeatureType import ee.carlrobert.codegpt.settings.service.ServiceType import ee.carlrobert.codegpt.settings.service.custom.DEFAULT_CUSTOM_OPENAI_MAX_OUTPUT_TOKENS @@ -189,8 +189,7 @@ private fun defaultModelDisplayName(modelId: String): String { // Inception Mercury2.id, MERCURY2 -> "Mercury 2" - MERCURY_CODER -> "Mercury Coder 2" - LEGACY_MERCURY_CODER -> "Mercury Coder" + MERCURY_EDIT2 -> "Mercury Edit 2" else -> modelId } @@ -384,15 +383,15 @@ private class ProxyAIModelProvider : ModelProvider { ) FeatureType.AUTO_APPLY -> listOf( - defaultModel(MERCURY_CODER, Icons.Inception), + defaultModel(MERCURY_EDIT2, Icons.Inception), ) FeatureType.CODE_COMPLETION -> listOf( - defaultModel(MERCURY_CODER, Icons.Inception) + defaultModel(MERCURY_EDIT2, Icons.Inception) ) FeatureType.NEXT_EDIT -> listOf( - defaultModel(MERCURY_CODER) + defaultModel(MERCURY_EDIT2) ) else -> emptyList() @@ -628,10 +627,10 @@ private class InceptionModelProvider : ModelProvider { provider = serviceType, llmModel = virtualModel( InceptionAILLMClient.Inception, - MERCURY_CODER, + MERCURY_EDIT2, OPENAI_CAPABILITIES ), - displayName = defaultModelDisplayName(MERCURY_CODER), + displayName = defaultModelDisplayName(MERCURY_EDIT2), ) } } diff --git a/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelSettings.kt b/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelSettings.kt index fc73dcf3..9b8a4f59 100644 --- a/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelSettings.kt +++ b/src/main/kotlin/ee/carlrobert/codegpt/settings/models/ModelSettings.kt @@ -228,8 +228,8 @@ class ModelSettings : SimplePersistentStateComponent(ModelSe private fun migrateProxyAIModels() { listOf(FeatureType.AUTO_APPLY, FeatureType.CODE_COMPLETION, FeatureType.NEXT_EDIT).forEach { val modelSelection = state.getModelSelection(it) - if (modelSelection?.provider == PROXYAI && modelSelection.model != ModelCatalog.MERCURY_CODER) { - setModelWithProvider(it, ModelCatalog.MERCURY_CODER, PROXYAI) + if (modelSelection?.provider == PROXYAI && modelSelection.model != ModelCatalog.MERCURY_EDIT2) { + setModelWithProvider(it, ModelCatalog.MERCURY_EDIT2, PROXYAI) } } listOf( diff --git a/src/main/kotlin/ee/carlrobert/codegpt/settings/service/codegpt/CodeGPTServiceSettings.kt b/src/main/kotlin/ee/carlrobert/codegpt/settings/service/codegpt/CodeGPTServiceSettings.kt index 63cb6b2b..709b2ec0 100644 --- a/src/main/kotlin/ee/carlrobert/codegpt/settings/service/codegpt/CodeGPTServiceSettings.kt +++ b/src/main/kotlin/ee/carlrobert/codegpt/settings/service/codegpt/CodeGPTServiceSettings.kt @@ -23,5 +23,5 @@ class CodeGPTServiceChatCompletionSettingsState : BaseState() { class CodeGPTServiceCodeCompletionSettingsState : BaseState() { var codeCompletionsEnabled by property(true) - var model by string(ModelCatalog.MERCURY_CODER) + var model by string(ModelCatalog.MERCURY_EDIT2) } diff --git a/src/test/kotlin/ee/carlrobert/codegpt/settings/models/ModelSettingsTest.kt b/src/test/kotlin/ee/carlrobert/codegpt/settings/models/ModelSettingsTest.kt index edf18d4b..8e9d5cca 100644 --- a/src/test/kotlin/ee/carlrobert/codegpt/settings/models/ModelSettingsTest.kt +++ b/src/test/kotlin/ee/carlrobert/codegpt/settings/models/ModelSettingsTest.kt @@ -227,13 +227,13 @@ class ModelSettingsTest : IntegrationTest() { modelSettings.setModelWithProvider( FeatureType.NEXT_EDIT, - ModelCatalog.MERCURY_CODER, + ModelCatalog.MERCURY_EDIT2, ServiceType.PROXYAI ) val notification = lastNotification.get() assertThat(notification!!.featureType).isEqualTo(FeatureType.NEXT_EDIT) - assertThat(notification.model).isEqualTo(ModelCatalog.MERCURY_CODER) + assertThat(notification.model).isEqualTo(ModelCatalog.MERCURY_EDIT2) assertThat(notification.serviceType).isEqualTo(ServiceType.PROXYAI) } diff --git a/src/test/kotlin/testsupport/mixin/ShortcutsTestMixin.kt b/src/test/kotlin/testsupport/mixin/ShortcutsTestMixin.kt index c98f0cc2..61f298d7 100644 --- a/src/test/kotlin/testsupport/mixin/ShortcutsTestMixin.kt +++ b/src/test/kotlin/testsupport/mixin/ShortcutsTestMixin.kt @@ -25,7 +25,7 @@ interface ShortcutsTestMixin { modelSettings.setModel(FeatureType.CHAT, "gpt-5-mini", ServiceType.PROXYAI) modelSettings.setModel( FeatureType.CODE_COMPLETION, - ModelCatalog.MERCURY_CODER, + ModelCatalog.MERCURY_EDIT2, ServiceType.PROXYAI ) service().state.run { @@ -185,7 +185,7 @@ interface ShortcutsTestMixin { FeatureType.CODE_COMPLETION -> { modelSettings.setModel( FeatureType.CODE_COMPLETION, - ModelCatalog.MERCURY_CODER, + ModelCatalog.MERCURY_EDIT2, ServiceType.INCEPTION ) } @@ -194,7 +194,7 @@ interface ShortcutsTestMixin { modelSettings.setModel(role, ModelCatalog.MERCURY2, ServiceType.INCEPTION) modelSettings.setModel( FeatureType.CODE_COMPLETION, - ModelCatalog.MERCURY_CODER, + ModelCatalog.MERCURY_EDIT2, ServiceType.INCEPTION ) }