fix: consolidate timeouts and IntelliJSearch tool safe execution

This commit is contained in:
Carl-Robert Linnupuu 2026-01-19 03:00:12 +00:00
parent 8552f4e634
commit ff5a7784b7
2 changed files with 9 additions and 8 deletions

View file

@ -32,10 +32,7 @@ import kotlin.io.encoding.ExperimentalEncodingApi
public class CustomOpenAIClientSettings(
baseUrl: String,
chatCompletionsPath: String,
timeoutConfig: ConnectionTimeoutConfig = ConnectionTimeoutConfig(
requestTimeoutMillis = 120_000,
socketTimeoutMillis = 120_000
)
timeoutConfig: ConnectionTimeoutConfig
) : OpenAIBaseSettings(baseUrl, chatCompletionsPath, timeoutConfig)
/**

View file

@ -127,10 +127,14 @@ class IntelliJSearchTool(
override suspend fun execute(args: Args): Result {
try {
val searchScope = createSearchScope(args, project)
val effectiveLimit = (args.limit ?: 10).coerceAtLeast(1)
val matches =
withContext(Dispatchers.Default) { runReadAction { searchEverywhere(args.pattern, searchScope, effectiveLimit) } }
val (searchScope, matches) = withContext(Dispatchers.Default) {
runReadAction {
val scope = createSearchScope(args, project)
val effectiveLimit = (args.limit ?: 10).coerceAtLeast(1)
val results = searchEverywhere(args.pattern, scope, effectiveLimit)
scope to results
}
}
val output = formatOutput(matches, args)
return Result(