mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 20:05:46 -06:00
092bd16b79
* fix(tools): preserve resolved search credentials Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com> Co-authored-by: Karol Zalewski <karol.zalewski@4zal.net> * test(agents): isolate Tool Search runtime config coverage * test(agents): isolate Tool Search runtime config coverage * test(agents): isolate Tool Search runtime config coverage * test(agents): isolate Tool Search runtime config coverage * fix(tools): restore reviewed search credential delta * docs(changelog): defer release-owned entry --------- Co-authored-by: Peter Steinberger <steipete@gmail.com> Co-authored-by: Karol Zalewski <karol.zalewski@4zal.net>
30 lines
923 B
TypeScript
30 lines
923 B
TypeScript
// Selects the resolved runtime snapshot for agent tool surfaces.
|
|
import {
|
|
getRuntimeConfigSnapshot,
|
|
getRuntimeConfigSourceSnapshot,
|
|
selectApplicableRuntimeConfig,
|
|
} from "../config/config.js";
|
|
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
|
|
|
export function resolveAgentRuntimeToolConfig(
|
|
inputConfig?: OpenClawConfig,
|
|
): OpenClawConfig | undefined {
|
|
const runtimeConfig = getRuntimeConfigSnapshot() ?? undefined;
|
|
if (!runtimeConfig) {
|
|
return inputConfig;
|
|
}
|
|
if (!inputConfig || inputConfig === runtimeConfig) {
|
|
return runtimeConfig;
|
|
}
|
|
const runtimeSourceConfig = getRuntimeConfigSourceSnapshot() ?? undefined;
|
|
// Without source identity, a process-global snapshot must not replace an explicit run config.
|
|
if (!runtimeSourceConfig) {
|
|
return inputConfig;
|
|
}
|
|
return selectApplicableRuntimeConfig({
|
|
inputConfig,
|
|
runtimeConfig,
|
|
runtimeSourceConfig,
|
|
});
|
|
}
|