mirror of https://github.com/openclaw/openclaw.git
Merge 4134d275ec into 392ddb56e2
This commit is contained in:
commit
af541f0a0f
|
|
@ -26,6 +26,7 @@ export function registerAgentCommands(program: Command, args: { agentChannelOpti
|
|||
.requiredOption("-m, --message <text>", "Message body for the agent")
|
||||
.option("-t, --to <number>", "Recipient number in E.164 used to derive the session key")
|
||||
.option("--session-id <id>", "Use an explicit session id")
|
||||
.option("--session-key <key>", "Use an explicit session key")
|
||||
.option("--agent <id>", "Agent id (overrides routing bindings)")
|
||||
.option("--thinking <level>", "Thinking level: off | minimal | low | medium | high | xhigh")
|
||||
.option("--verbose <on|off>", "Persist agent verbose level for the session")
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ export type AgentCliOpts = {
|
|||
agent?: string;
|
||||
to?: string;
|
||||
sessionId?: string;
|
||||
sessionKey?: string;
|
||||
thinking?: string;
|
||||
verbose?: string;
|
||||
json?: boolean;
|
||||
|
|
@ -89,8 +90,10 @@ export async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: Runtim
|
|||
if (!body) {
|
||||
throw new Error("Message (--message) is required");
|
||||
}
|
||||
if (!opts.to && !opts.sessionId && !opts.agent) {
|
||||
throw new Error("Pass --to <E.164>, --session-id, or --agent to choose a session");
|
||||
if (!opts.to && !opts.sessionId && !opts.sessionKey && !opts.agent) {
|
||||
throw new Error(
|
||||
"Pass --to <E.164>, --session-id, --session-key, or --agent to choose a session",
|
||||
);
|
||||
}
|
||||
|
||||
const cfg = loadConfig();
|
||||
|
|
@ -115,6 +118,7 @@ export async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: Runtim
|
|||
agentId,
|
||||
to: opts.to,
|
||||
sessionId: opts.sessionId,
|
||||
sessionKey: opts.sessionKey,
|
||||
}).sessionKey;
|
||||
|
||||
const channel = normalizeMessageChannel(opts.channel);
|
||||
|
|
|
|||
Loading…
Reference in New Issue