mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:40:42 +00:00
refactor: dedupe provider and channel string helpers
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { resolveEffectiveMessagesConfig, resolveIdentityName } from "../agents/identity.js";
|
||||
import { resolveAgentIdentity, resolveEffectiveMessagesConfig } from "../agents/identity.js";
|
||||
import {
|
||||
extractShortModelName,
|
||||
type ResponsePrefixContext,
|
||||
} from "../auto-reply/reply/response-prefix-template.js";
|
||||
import type { GetReplyOptions } from "../auto-reply/types.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { normalizeOptionalString } from "../shared/string-coerce.js";
|
||||
|
||||
type ModelSelectionContext = Parameters<NonNullable<GetReplyOptions["onModelSelected"]>>[0];
|
||||
|
||||
@@ -28,7 +29,7 @@ export function createReplyPrefixContext(params: {
|
||||
}): ReplyPrefixContextBundle {
|
||||
const { cfg, agentId } = params;
|
||||
const prefixContext: ResponsePrefixContext = {
|
||||
identityName: resolveIdentityName(cfg, agentId),
|
||||
identityName: normalizeOptionalString(resolveAgentIdentity(cfg, agentId)?.name),
|
||||
};
|
||||
|
||||
const onModelSelected = (ctx: ModelSelectionContext) => {
|
||||
|
||||
Reference in New Issue
Block a user