Matrix-js: add legacy config migration and bind integration coverage

This commit is contained in:
Gustavo Madeira Santana
2026-02-25 19:29:53 -05:00
parent 6405871a9d
commit 1a2d446788
6 changed files with 173 additions and 4 deletions

View File

@@ -189,6 +189,15 @@ describe("registerAgentCommands", () => {
);
});
it("documents bind accountId resolution behavior in help text", () => {
const program = new Command();
registerAgentCommands(program, { agentChannelOptions: "last|telegram|discord" });
const agents = program.commands.find((command) => command.name() === "agents");
const bind = agents?.commands.find((command) => command.name() === "bind");
const help = bind?.helpInformation() ?? "";
expect(help).toContain("accountId is resolved by channel defaults/hooks");
});
it("forwards agents unbind options", async () => {
await runCli(["agents", "unbind", "--agent", "ops", "--all", "--json"]);
expect(agentsUnbindCommandMock).toHaveBeenCalledWith(

View File

@@ -126,7 +126,12 @@ ${theme.muted("Docs:")} ${formatDocsLink("/cli/agent", "docs.openclaw.ai/cli/age
.command("bind")
.description("Add routing bindings for an agent")
.option("--agent <id>", "Agent id (defaults to current default agent)")
.option("--bind <channel[:accountId]>", "Binding to add (repeatable)", collectOption, [])
.option(
"--bind <channel[:accountId]>",
"Binding to add (repeatable). If omitted, accountId is resolved by channel defaults/hooks.",
collectOption,
[],
)
.option("--json", "Output JSON summary", false)
.action(async (opts) => {
await runCommandWithRuntime(defaultRuntime, async () => {