This commit is contained in:
Zhejian Zhang 2026-03-15 18:48:47 -04:00 committed by GitHub
commit af541f0a0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -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")

View File

@ -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);