Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data class LlmSettings(
val endpoint: String? = null,
val template: TemplateRequestConfig? = null,
val auth: LlmAuthConfig? = null,
val httpDisableTlsVerification: Boolean = false,
val httpDisableTlsVerification: Boolean = true,
val maxTokens: Int = 8192
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data class AiTestSettingsModel(
val llmTimeoutSeconds: String = "60",
val llmApiKey: String = "",
val llmApiKeyEnv: String = "",
val httpDisableTlsVerification: Boolean = false,
val httpDisableTlsVerification: Boolean = true,
val showLogTab: Boolean = true,
val llmTemplateEnabled: Boolean = false,
val llmTemplateMethod: String = "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,12 +1060,10 @@ class ContextBoxToolWindowFactory : ToolWindowFactory, DumbAware {
Notifications.error(project, "Prompt Manager", status.message)
return
}
val message = promptUpdateMessage(status)
if (status.hasUpdates) {
val choice = Messages.showYesNoDialog(project, "$message\n\nUpdate prompts now?", "Prompt Manager", "Update", "Later", null)
if (choice == Messages.YES) performPullUpdate() else Notifications.info(project, "Prompt Manager", message)
performPullUpdate()
} else {
Notifications.info(project, "Prompt Manager", message)
Notifications.info(project, "Prompt Manager", promptUpdateMessage(status))
}
}

Expand Down Expand Up @@ -1586,9 +1584,7 @@ class ContextBoxToolWindowFactory : ToolWindowFactory, DumbAware {
return
}
if (status.hasUpdates) {
val choice = Messages.showYesNoDialog(project,
"${status.message}\n\nUpdate skills now?", "Skill Manager", "Update", "Later", null)
if (choice == Messages.YES) performPullSkillUpdate() else Notifications.info(project, "Skill Manager", status.message)
performPullSkillUpdate()
} else {
Notifications.info(project, "Skill Manager", status.message)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ object LlmSettingsLoader {
llmTimeoutSeconds = llm.string("timeoutSeconds").ifBlank { "60" },
llmApiKey = llm.string("apiKey"),
llmApiKeyEnv = llm.string("apiKeyEnv"),
httpDisableTlsVerification = http?.get("disableTlsVerification") as? Boolean ?: false,
httpDisableTlsVerification = http?.get("disableTlsVerification") as? Boolean ?: true,
showLogTab = ui["showLogTab"] as? Boolean ?: true,
llmTemplateEnabled = template != null,
llmTemplateMethod = template.string("method").ifBlank { "POST" },
Expand Down Expand Up @@ -762,7 +762,7 @@ object LlmSettingsLoader {
}

val httpMap = llm["http"] as? Map<*, *>
val disableTlsVerification = httpMap?.get("disableTlsVerification") as? Boolean ?: false
val disableTlsVerification = httpMap?.get("disableTlsVerification") as? Boolean ?: true

val maxTokens = when (val v = llm["maxTokens"]) {
is Number -> v.toInt()
Expand Down Expand Up @@ -1072,6 +1072,17 @@ object LlmSettingsLoader {
}
}

fun stripPromptMetadata(content: String): String {
val lines = content.trim().lines()
val metadataKeys = setOf("name", "type", "time", "updatedAt", "pulledAt")
val bodyStart = lines.indexOfFirst { line ->
val key = line.substringBefore(":").trim().lowercase()
key !in metadataKeys && line.isNotBlank()
}
if (bodyStart < 0) return content
return lines.drop(bodyStart).joinToString("\n").trim()
}

private fun extractSkillBody(content: String): String {
val lines = content.trim().lines()
val metadataKeys = setOf("name", "type", "time", "updatedAt", "pulledAt", "description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ object PromptProfileResolver {

fun resolve(profileSet: PromptProfileSet, fallbackTemplate: String): String {
val selectedName = profileSet.selected.trim().ifBlank { PromptProfileSet.DEFAULT_NAME }
return profileSet.items[selectedName]
val raw = profileSet.items[selectedName]
?.takeIf { it.isNotBlank() }
?: profileSet.items[PromptProfileSet.DEFAULT_NAME]
?.takeIf { it.isNotBlank() }
?: fallbackTemplate
return LlmSettingsLoader.stripPromptMetadata(raw)
}
}
Loading