mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 07:04:32 +00:00
fix(outbound): unify resolved cfg threading across send paths (#33987)
This commit is contained in:
@@ -3,11 +3,13 @@
|
||||
*/
|
||||
|
||||
import { loadConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveSignalAccount } from "./accounts.js";
|
||||
import { signalRpcRequest } from "./client.js";
|
||||
import { resolveSignalRpcContext } from "./rpc-context.js";
|
||||
|
||||
export type SignalReactionOpts = {
|
||||
cfg?: OpenClawConfig;
|
||||
baseUrl?: string;
|
||||
account?: string;
|
||||
accountId?: string;
|
||||
@@ -75,8 +77,9 @@ async function sendReactionSignalCore(params: {
|
||||
opts: SignalReactionOpts;
|
||||
errors: SignalReactionErrorMessages;
|
||||
}): Promise<SignalReactionResult> {
|
||||
const cfg = params.opts.cfg ?? loadConfig();
|
||||
const accountInfo = resolveSignalAccount({
|
||||
cfg: loadConfig(),
|
||||
cfg,
|
||||
accountId: params.opts.accountId,
|
||||
});
|
||||
const { baseUrl, account } = resolveSignalRpcContext(params.opts, accountInfo);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { loadConfig } from "../config/config.js";
|
||||
import { loadConfig, type OpenClawConfig } from "../config/config.js";
|
||||
import { resolveMarkdownTableMode } from "../config/markdown-tables.js";
|
||||
import { kindFromMime } from "../media/mime.js";
|
||||
import { resolveOutboundAttachmentFromUrl } from "../media/outbound-attachment.js";
|
||||
@@ -8,6 +8,7 @@ import { markdownToSignalText, type SignalTextStyleRange } from "./format.js";
|
||||
import { resolveSignalRpcContext } from "./rpc-context.js";
|
||||
|
||||
export type SignalSendOpts = {
|
||||
cfg?: OpenClawConfig;
|
||||
baseUrl?: string;
|
||||
account?: string;
|
||||
accountId?: string;
|
||||
@@ -100,7 +101,7 @@ export async function sendMessageSignal(
|
||||
text: string,
|
||||
opts: SignalSendOpts = {},
|
||||
): Promise<SignalSendResult> {
|
||||
const cfg = loadConfig();
|
||||
const cfg = opts.cfg ?? loadConfig();
|
||||
const accountInfo = resolveSignalAccount({
|
||||
cfg,
|
||||
accountId: opts.accountId,
|
||||
|
||||
Reference in New Issue
Block a user