mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 16:00:22 +00:00
fix(slack): trim DM reply overhead and restore Codex auto transport (#53957)
* perf(slack): instrument runtime and trim DM overhead * perf(slack): lazy-init draft previews * perf(slack): add turn summary diagnostics * perf(core): trim repeated runtime setup noise * perf(core): preselect default web search providers * perf(agent): restore OpenAI auto transport defaults * refactor(slack): drop temporary perf wiring * fix(slack): address follow-up review notes * fix(security): tighten slack and runtime defaults * style(web-search): fix import ordering * style(agent): remove useless spread fallback * docs(changelog): note slack runtime hardening
This commit is contained in:
@@ -10,6 +10,7 @@ import { resolvePluginWebSearchProviders } from "../plugins/web-search-providers
|
||||
import { resolveRuntimeWebSearchProviders } from "../plugins/web-search-providers.runtime.js";
|
||||
import { sortWebSearchProvidersForAutoDetect } from "../plugins/web-search-providers.shared.js";
|
||||
import type { RuntimeWebSearchMetadata } from "../secrets/runtime-web-tools.types.js";
|
||||
import { getActiveRuntimeWebToolsMetadata } from "../secrets/runtime.js";
|
||||
import { normalizeSecretInput } from "../utils/normalize-secret-input.js";
|
||||
|
||||
type WebSearchConfig = NonNullable<OpenClawConfig["tools"]>["web"] extends infer Web
|
||||
@@ -166,6 +167,7 @@ export function resolveWebSearchDefinition(
|
||||
options?: ResolveWebSearchDefinitionParams,
|
||||
): { provider: PluginWebSearchProviderEntry; definition: WebSearchProviderToolDefinition } | null {
|
||||
const search = resolveSearchConfig(options?.config);
|
||||
const runtimeWebSearch = options?.runtimeWebSearch ?? getActiveRuntimeWebToolsMetadata()?.search;
|
||||
if (!resolveWebSearchEnabled({ search, sandboxed: options?.sandboxed })) {
|
||||
return null;
|
||||
}
|
||||
@@ -187,8 +189,8 @@ export function resolveWebSearchDefinition(
|
||||
|
||||
const providerId =
|
||||
options?.providerId ??
|
||||
options?.runtimeWebSearch?.selectedProvider ??
|
||||
options?.runtimeWebSearch?.providerConfigured ??
|
||||
runtimeWebSearch?.selectedProvider ??
|
||||
runtimeWebSearch?.providerConfigured ??
|
||||
resolveWebSearchProviderId({ config: options?.config, search, providers });
|
||||
const provider =
|
||||
providers.find((entry) => entry.id === providerId) ??
|
||||
@@ -204,7 +206,7 @@ export function resolveWebSearchDefinition(
|
||||
const definition = provider.createTool({
|
||||
config: options?.config,
|
||||
searchConfig: search as Record<string, unknown> | undefined,
|
||||
runtimeMetadata: options?.runtimeWebSearch,
|
||||
runtimeMetadata: runtimeWebSearch,
|
||||
});
|
||||
if (!definition) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user