From 74273d62d0dd5e535e18755719689db45b878a26 Mon Sep 17 00:00:00 2001 From: 0xRain Date: Wed, 11 Feb 2026 08:45:16 +0800 Subject: [PATCH] fix(pairing): show actual code in approval command instead of placeholder (#13723) * fix(pairing): show actual code in approval command instead of placeholder The pairing reply shown to new users included the approval command with a literal '' placeholder. Users had to manually copy the code from one line and substitute it into the command. Now shows the ready-to-copy command with the real pairing code: Before: openclaw pairing approve telegram After: openclaw pairing approve telegram abc123 Fixed in both the shared pairing message builder and the Telegram inline pairing reply. * test(pairing): update test to expect actual code instead of placeholder --------- Co-authored-by: Echo Ito --- src/pairing/pairing-messages.test.ts | 2 +- src/pairing/pairing-messages.ts | 2 +- src/telegram/bot-message-context.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pairing/pairing-messages.test.ts b/src/pairing/pairing-messages.test.ts index d8994e88c9c..d12be19c3af 100644 --- a/src/pairing/pairing-messages.test.ts +++ b/src/pairing/pairing-messages.test.ts @@ -52,7 +52,7 @@ describe("buildPairingReply", () => { expect(text).toContain(`Pairing code: ${testCase.code}`); // CLI commands should respect OPENCLAW_PROFILE when set (most tests run with isolated profile) const commandRe = new RegExp( - `(?:openclaw|openclaw) --profile isolated pairing approve ${testCase.channel} `, + `(?:openclaw|openclaw) --profile isolated pairing approve ${testCase.channel} ${testCase.code}`, ); expect(text).toMatch(commandRe); }); diff --git a/src/pairing/pairing-messages.ts b/src/pairing/pairing-messages.ts index 86e3b471a74..bff3384ac49 100644 --- a/src/pairing/pairing-messages.ts +++ b/src/pairing/pairing-messages.ts @@ -15,6 +15,6 @@ export function buildPairingReply(params: { `Pairing code: ${code}`, "", "Ask the bot owner to approve with:", - formatCliCommand(`openclaw pairing approve ${channel} `), + formatCliCommand(`openclaw pairing approve ${channel} ${code}`), ].join("\n"); } diff --git a/src/telegram/bot-message-context.ts b/src/telegram/bot-message-context.ts index 456ae0523d9..8f52c6b5137 100644 --- a/src/telegram/bot-message-context.ts +++ b/src/telegram/bot-message-context.ts @@ -289,7 +289,7 @@ export const buildTelegramMessageContext = async ({ `Pairing code: ${code}`, "", "Ask the bot owner to approve with:", - formatCliCommand("openclaw pairing approve telegram "), + formatCliCommand(`openclaw pairing approve telegram ${code}`), ].join("\n"), ), });