← Back to PRs

#13285: feat(pairing): add pairingAnonymous option to hide platform branding

by thebtf open 2026-02-10 08:53 View on GitHub →
agents size: XS
## Summary When `pairingAnonymous: true` is set in channel config, pairing replies sent to unauthorized DM users omit the "OpenClaw" platform name and CLI commands. Bot operators can keep their platform choice private. **Before** (default, unchanged): ``` OpenClaw: access not configured. Your Telegram user id: 121243274 Pairing code: U8Q5UCYJ Ask the bot owner to approve with: openclaw pairing approve telegram <code> ``` **After** (`pairingAnonymous: true`): ``` Access not configured. Your Telegram user id: 121243274 Pairing code: U8Q5UCYJ Share this code with the bot administrator to get access. ``` ### Changes - `buildPairingReply()`: add `anonymous` param for generic message variant (no "OpenClaw", no CLI) - `TelegramAccountConfig`: add `pairingAnonymous?: boolean` + Zod schema entry - `bot-message-context.ts`: refactor inline Telegram pairing message to use shared `buildPairingReply` (eliminates code duplication between Telegram and other channels) ### Config ```jsonc // channels.telegram (top-level or per-account) { "dmPolicy": "pairing", "pairingAnonymous": true } ``` Default: `false` — current behavior preserved. ## Test plan - [x] 7 tests pass (5 existing + 2 new: anonymous mode, branded mode) - [x] Build passes - [ ] CI <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a `pairingAnonymous` Telegram config option to emit a generic pairing DM reply (no platform branding / CLI command), refactors Telegram pairing replies to use the shared `buildPairingReply()` helper, and introduces additional embedded-runner compaction controls (timeout + optional compaction model override) with accompanying tests. The changes touch Telegram’s inbound DM pairing flow (`src/telegram/bot-message-context.ts`), config typing + Zod schemas for Telegram and agent defaults, and compaction behavior in the embedded runner (timeout handling, model override, and reasoning disabling). <h3>Confidence Score: 3/5</h3> - This PR has a couple of correctness issues that should be fixed before merging. - Main risk is configuration resolution and model-shape correctness: Telegram pairing reads `pairingAnonymous` only from the global telegram config (ignoring per-account overrides), and compaction mutates the model `reasoning` field in a way that may not match provider expectations if it’s not a boolean. The rest of the changes look localized and are covered by tests. - src/telegram/bot-message-context.ts, src/agents/pi-embedded-runner/compact.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment --> --- ## Validation - [x] `pnpm build` — passes - [x] `pnpm check` — passes - [x] `pnpm test` — 7 tests pass (5 existing + 2 new) ## Contribution checklist - [x] **Focused scope**: Add pairingAnonymous config option for privacy - [x] **What + why**: described above - [x] **AI-assisted**: Yes, Claude Code was used for implementation. Testing level: fully tested (7 tests)

Most Similar PRs