Feature/default messenger delivery target (openclaw#16985) thanks @KirillShchetinin

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: KirillShchetinin <13061871+KirillShchetinin@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Kirill Shchetynin
2026-02-19 23:37:19 -05:00
committed by GitHub
parent 59e58bf81c
commit ee519086f6
27 changed files with 289 additions and 6 deletions

View File

@@ -169,20 +169,29 @@ export function resolveOutboundTarget(params: {
})
: undefined);
// Fall back to per-channel defaultTo when no explicit target is provided.
const effectiveTo =
params.to?.trim() ||
(params.cfg && plugin.config.resolveDefaultTo
? plugin.config.resolveDefaultTo({
cfg: params.cfg,
accountId: params.accountId ?? undefined,
})
: undefined);
const resolveTarget = plugin.outbound?.resolveTarget;
if (resolveTarget) {
return resolveTarget({
cfg: params.cfg,
to: params.to,
to: effectiveTo,
allowFrom,
accountId: params.accountId ?? undefined,
mode: params.mode ?? "explicit",
});
}
const trimmed = params.to?.trim();
if (trimmed) {
return { ok: true, to: trimmed };
if (effectiveTo) {
return { ok: true, to: effectiveTo };
}
const hint = plugin.messaging?.targetResolver?.hint;
return {