refactor(setup): drop CLI-bonus wiring from init-first-agent
init-first-agent used to double-wire the CLI channel to every new DM agent as a convenience for `pnpm run chat`, gated by --no-cli-bonus. With the /new-setup-2 flow gone and a dedicated scratch CLI agent created earlier in setup:auto, that bonus just stomps on CLI routing the user already set up. Remove the CLI_CHANNEL/CLI_PLATFORM_ID constants, ensureCliMessagingGroup, the --no-cli-bonus flag, and the cli-bonus wiring block. Pass the paired user's identity through to the welcome delivery so the sender resolver sees the real owner (e.g. telegram:<id>) instead of cli:local. Extend the CLI channel's admin-transport payload to accept optional sender/senderId overrides — falls back to the old cli/cli:local defaults when omitted, so existing callers are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -183,6 +183,8 @@ function createAdapter(): ChannelAdapter {
|
||||
text?: unknown;
|
||||
to?: unknown;
|
||||
reply_to?: unknown;
|
||||
sender?: unknown;
|
||||
senderId?: unknown;
|
||||
};
|
||||
try {
|
||||
payload = JSON.parse(line);
|
||||
@@ -209,8 +211,8 @@ function createAdapter(): ChannelAdapter {
|
||||
timestamp: new Date().toISOString(),
|
||||
content: JSON.stringify({
|
||||
text: payload.text,
|
||||
sender: 'cli',
|
||||
senderId: `cli:${PLATFORM_ID}`,
|
||||
sender: typeof payload.sender === 'string' ? payload.sender : 'cli',
|
||||
senderId: typeof payload.senderId === 'string' ? payload.senderId : `cli:${PLATFORM_ID}`,
|
||||
}),
|
||||
},
|
||||
replyTo: replyTo ?? undefined,
|
||||
|
||||
Reference in New Issue
Block a user