Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(im): 使用浅肤色女士工作表情并对齐 Telegram 回应

Dashaa9433463e0c
diff --git a/apps/desktop/src/main/hook-control/__tests__/ackReactions.test.ts b/apps/desktop/src/main/hook-control/__tests__/ackReactions.test.ts
index e5498df201..d87bf2f256 100644
--- a/apps/desktop/src/main/hook-control/__tests__/ackReactions.test.ts
+++ b/apps/desktop/src/main/hook-control/__tests__/ackReactions.test.ts
@@ -92,7 +92,7 @@ describe('官方 bot ack 表情', () => {
it.each(PROCESSING_REACTION_POOL)('processing uses %s and completion clears it', (emoji) => {
const index = PROCESSING_REACTION_POOL.indexOf(emoji);
- const h = harness([HOOK_FEATURE_MESSAGE_OPS], 'minimal', () => index / 4);
+ const h = harness([HOOK_FEATURE_MESSAGE_OPS], 'minimal', () => index / PROCESSING_REACTION_POOL.length);
h.reactions.onAccepted(TASK, h.send);
h.reactions.onStarted(TASK, h.send);
h.reactions.onFinished(TASK, 'ok', h.send);
@@ -180,7 +180,7 @@ describe('官方 bot ack 表情', () => {
h.reactions.onAccepted(TASK, h.send);
h.reactions.onStarted(TASK, h.send);
h.reactions.onResult({ opId: 'req-1:processing', ok: false, error: 'REACTION_INVALID' }, () => h.send);
- expect(h.sent.map(m => opOf(m).action.emoji)).toEqual(['👀', '🤓', '👨‍💻']);
+ expect(h.sent.map(m => opOf(m).action.emoji)).toEqual(['👀', '🤓', '🤔']);
expect(opOf(h.sent[2]).opId).toBe('req-1:processing-fallback');
h.reactions.onResult({ opId: 'req-1:processing', ok: false, error: 'REACTION_INVALID' }, () => h.send);
h.reactions.onResult({ opId: 'req-1:processing-fallback', ok: false, error: 'REACTION_INVALID' }, () => h.send);
diff --git a/apps/desktop/src/main/hook-control/__tests__/dispatcher.test.ts b/apps/desktop/src/main/hook-control/__tests__/dispatcher.test.ts
index 927e6b3522..e321f1d15d 100644
--- a/apps/desktop/src/main/hook-control/__tests__/dispatcher.test.ts
+++ b/apps/desktop/src/main/hook-control/__tests__/dispatcher.test.ts
@@ -5014,7 +5014,7 @@ describe('官方 bot ack 表情(msg.op)', () => {
expect(c.last('task.ack')?.payload).toMatchObject({ result: 'queued' });
// 第一条已经处理中,第二条仍显示排队。
- expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(👨‍💻|🤔|🤓|✍)$/), '👀']);
+ expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(🤔|🤓|✍)$/), '👀']);
});
it('排队中被取消 → 👀 换成终态, 不永远挂着「在做」', async () => {
@@ -5033,7 +5033,7 @@ describe('官方 bot ack 表情(msg.op)', () => {
await tick();
// 取消排队任务时清掉它的状态,不影响正在执行的任务。
- expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(👨‍💻|🤔|🤓|✍)$/), '👀', '']);
+ expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(🤔|🤓|✍)$/), '👀', '']);
});
it('账号停用: 已打 👀 而终态没人发的任务, 停用时撤销那个 👀', async () => {
@@ -5052,7 +5052,7 @@ describe('官方 bot ack 表情(msg.op)', () => {
await tick();
d.handleDispatch('conn-1', telegramDispatch({ requestId: 'queued' }), c.send);
await tick();
- expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(👨‍💻|🤔|🤓|✍)$/), '👀']); // 两条各一个在册
+ expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(🤔|🤓|✍)$/), '👀']); // 两条各一个在册
const draining = d.deactivateAccount();
await tick();
@@ -5074,7 +5074,7 @@ describe('官方 bot ack 表情(msg.op)', () => {
d.setEmojiReactionsMode('minimal');
d.handleDispatch('conn-1', telegramDispatch({ requestId: 'offline-final' }), online.send);
await tick();
- expect(reactionEmojis(online.sent)).toEqual(['👀', expect.stringMatching(/^(👨‍💻|🤔|🤓|✍)$/)]);
+ expect(reactionEmojis(online.sent)).toEqual(['👀', expect.stringMatching(/^(🤔|🤓|✍)$/)]);
d.onDisconnected('conn-1');
fr.finish({ status: 'ok' });
@@ -5128,7 +5128,7 @@ describe('官方 bot ack 表情(msg.op)', () => {
d.setEmojiReactionsMode('minimal');
d.handleDispatch('conn-1', telegramDispatch({ requestId: 'hydrated' }), c.send);
await tick();
- expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(👨‍💻|🤔|🤓|✍)$/)]);
+ expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(🤔|🤓|✍)$/)]);
});
it('账号切换后档位打回未知 —— 不拿上一位主人的选择顶上', async () => {
@@ -5139,7 +5139,7 @@ describe('官方 bot ack 表情(msg.op)', () => {
d.setEmojiReactionsMode('minimal');
d.handleDispatch('conn-1', telegramDispatch({ requestId: 'first-owner' }), c.send);
await tick();
- expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(👨‍💻|🤔|🤓|✍)$/)]);
+ expect(reactionEmojis(c.sent)).toEqual(['👀', expect.stringMatching(/^(🤔|🤓|✍)$/)]);
const draining = d.deactivateAccount();
fr.finish({ status: 'ok' });
diff --git a/apps/desktop/src/main/hook-control/ackReactions.ts b/apps/desktop/src/main/hook-control/ackReactions.ts
index 2b8bf14489..19c097eb47 100644
--- a/apps/desktop/src/main/hook-control/ackReactions.ts
+++ b/apps/desktop/src/main/hook-control/ackReactions.ts
@@ -19,7 +19,7 @@ import {
/** minimal 档 —— 与个人 bot 逐个对齐, 两个 bot 的表情语义不该各说各话。 */
const ACK_EMOJI = '👀';
-const PROCESSING_EMOJI = '👨‍💻';
+const PROCESSING_EMOJI = '🤔';
const FAIL_EMOJI = '👎';
export interface AckReactionTask {
diff --git a/apps/desktop/src/main/im/discord/__tests__/discordAdapter.test.ts b/apps/desktop/src/main/im/discord/__tests__/discordAdapter.test.ts
index d37ef4e0c1..49c6cbb009 100644
--- a/apps/desktop/src/main/im/discord/__tests__/discordAdapter.test.ts
+++ b/apps/desktop/src/main/im/discord/__tests__/discordAdapter.test.ts
@@ -84,7 +84,7 @@ describe('discord ImChannelAdapter characterization', () => {
it('title, generated title prefix, and processing emoji match Discord contract', () => {
expect(adapter.sessions.defaultTitle('9876543210')).toBe('Discord · 543210');
expect(adapter.sessions.generatedTitlePrefix).toBe('Discord · ');
- expect(adapter.processingEmoji).toBe('👨‍💻');
+ expect(adapter.processingEmoji).toBe('👩🏻‍💻');
expect(adapter.queuedEmoji).toBe('👀');
});
diff --git a/apps/desktop/src/main/im/discord/uiText.ts b/apps/desktop/src/main/im/discord/uiText.ts
index 6da61a4ab2..cfb9a0b682 100644
--- a/apps/desktop/src/main/im/discord/uiText.ts
+++ b/apps/desktop/src/main/im/discord/uiText.ts
@@ -191,4 +191,4 @@ export const ui = {
},
} satisfies ImUiTextPack;
-export const PROCESSING_EMOJI = '👨‍💻';
+export const PROCESSING_EMOJI = '👩🏻‍💻';
diff --git a/apps/desktop/src/main/im/shared/__tests__/turnRunnerSendOutcome.test.ts b/apps/desktop/src/main/im/shared/__tests__/turnRunnerSendOutcome.test.ts
index 27a54ad9d4..887577d616 100644
--- a/apps/desktop/src/main/im/shared/__tests__/turnRunnerSendOutcome.test.ts
+++ b/apps/desktop/src/main/im/shared/__tests__/turnRunnerSendOutcome.test.ts
@@ -2556,7 +2556,7 @@ describe('turnRunner send outcome policy (feishu adapter characterization)', ()
runner = createTurnRunner(
{
...fakeAdapter,
- processingEmoji: '👨‍💻',
+ processingEmoji: '👩🏻‍💻',
queuedEmoji: '👀',
terminalReactionEmoji: (kind) => (kind === 'error' ? '👎' : null),
},
@@ -2580,14 +2580,14 @@ describe('turnRunner send outcome policy (feishu adapter characterization)', ()
h.emit({ type: 'done', data: {} });
await waitForAssertion(() => {
expect(h.send).toHaveBeenCalledTimes(1);
- expect(mocks.feishuIm.reactToMessage).toHaveBeenLastCalledWith('msg-user', '👨‍💻');
+ expect(mocks.feishuIm.reactToMessage).toHaveBeenLastCalledWith('msg-user', '👩🏻‍💻');
});
expect(mocks.feishuIm.removeMessageReaction).toHaveBeenCalledWith('msg-user', '👀');
mocks.feishuIm.removeMessageReaction.mockClear();
h.emit({ type: 'done', data: {} });
await waitForAssertion(() => {
- expect(mocks.feishuIm.removeMessageReaction).toHaveBeenCalledWith('msg-user', '👨‍💻');
+ expect(mocks.feishuIm.removeMessageReaction).toHaveBeenCalledWith('msg-user', '👩🏻‍💻');
});
expect(mocks.feishuIm.reactToMessage).not.toHaveBeenCalledWith('msg-user', '👍');
});
@@ -2659,9 +2659,9 @@ describe('turnRunner send outcome policy (feishu adapter characterization)', ()
await waitForAssertion(() => expect(h.send).toHaveBeenCalledTimes(1));
h.emit({ type: 'done', data: {} });
await waitForAssertion(() => expect(completed).toHaveBeenCalledTimes(1));
- ack.resolve('👨‍💻');
+ ack.resolve('👩🏻‍💻');
await waitForAssertion(() => {
- expect(mocks.feishuIm.removeMessageReaction).toHaveBeenCalledWith('msg-user', '👨‍💻');
+ expect(mocks.feishuIm.removeMessageReaction).toHaveBeenCalledWith('msg-user', '👩🏻‍💻');
});
expect(mocks.feishuIm.reactToMessage).not.toHaveBeenCalledWith('msg-user', '👍');
expect(mocks.feishuIm.reactToMessage).not.toHaveBeenCalledWith('msg-user', '👀');
diff --git a/apps/desktop/src/main/im/telegram/uiText.ts b/apps/desktop/src/main/im/telegram/uiText.ts
index f8866ba636..4cf9e6c400 100644
--- a/apps/desktop/src/main/im/telegram/uiText.ts
+++ b/apps/desktop/src/main/im/telegram/uiText.ts
@@ -237,4 +237,4 @@ export const ui = {
},
} satisfies ImUiTextPack;
-export const PROCESSING_EMOJI = '👨‍💻';
+export const PROCESSING_EMOJI = '🤔';
diff --git a/docs/product-rules/telegram-bot-parity.md b/docs/product-rules/telegram-bot-parity.md
index e2bf7c55ba..f179c65e6a 100644
--- a/docs/product-rules/telegram-bot-parity.md
+++ b/docs/product-rules/telegram-bot-parity.md
@@ -303,10 +303,15 @@ hook 侧既有的逐轮 `[渠道说明]`,两者措辞不同但都向模型说
| 4 | 受保护群内容的隐私边界 | 个人侧已做(出站回流 fail-closed,任一分片带保护标即整条不回流)。官方侧是否等价**待核** | 待核 |
| 5 | 相册失败逐张回落 | 两侧都有实现,判据是否等价**待核** | 待核 |
| 7 | **Bot API 更新类型两侧都只订阅一部分** | 个人:`allowed_updates = ['message', 'callback_query', 'my_chat_member']`(2026-10-17 补 `my_chat_member`:被拉进群 / 移出群进群窗口并私聊告知主人;群内升降管理员、私聊拉黑不产生动作)。仍没订阅:`edited_message`(用户改消息)、`message_reaction`(用户给 bot 消息点表情,群里还要 bot 是管理员)、`chat_member`(群成员进出)、`chat_join_request`、`channel_post`、inline / Web App / 支付 / 商业账号。出站也没有 inline 模式、Web App、支付。官方侧订阅集合**待核** | 两侧共同缺口,按需补;`message_reaction` 与 `chat_member` 对群场景价值最大,先补这两个 |
-| 6 | ack / 排队 / 结果表情 | 个人与官方 bot 都用 👀 表示排队;开始处理时从 👨‍💻 / 🤔 / 🤓 / ✍ 中随机选一个,两种开启档位均生效,不随进度轮换。正常完成和取消清除状态、不另加 👍;失败保留 👎(生动档沿用失败变体)。个人侧复用 `im/shared/turnRunner.ts` 的 ack 句柄,迟到回应由终态接管;官方新版 server 统一管理状态,鉴权后确认但不执行 Desktop 的自动 `:ack` / `:final` / `:final-fallback` 表情,`:processing` 只触发一次处理中状态,避免旧客户端重新加上 👍。表情关闭、ambient 或群不允许时静默;两种传输均为尽力反馈。 | 两仓配套实现。新版 server 可先发,旧 Desktop 的 accepted/首帧 progress 触发处理中;新版 Desktop 连旧 server 仍兼容 msg.op,但旧 server 的独立成功表情须升级 server 才能彻底消除。无协议字段、数据库或平台配置变更。 |
+| 6 | ack / 排队 / 结果表情 | 个人与官方 bot 都用 👀 表示排队;开始处理时从 🤔 / 🤓 / ✍ 中随机选一个,两种开启档位均生效,不随进度轮换。正常完成和取消清除状态、不另加 👍;失败保留 👎(生动档沿用失败变体)。个人侧复用 `im/shared/turnRunner.ts` 的 ack 句柄,迟到回应由终态接管;官方新版 server 统一管理状态,鉴权后确认但不执行 Desktop 的自动 `:ack` / `:final` / `:final-fallback` 表情,`:processing` 只触发一次处理中状态,避免旧客户端重新加上 👍。表情关闭、ambient 或群不允许时静默;两种传输均为尽力反馈。 | 两仓配套实现。新版 server 可先发,旧 Desktop 的 accepted/首帧 progress 触发处理中;新版 Desktop 连旧 server 仍兼容 msg.op,但旧 server 的独立成功表情须升级 server 才能彻底消除。无协议字段、数据库或平台配置变更。 |
+
+处理中人物表情优先使用浅肤色女士:Slack 用 `female-technologist::skin-tone-2`,Discord 用 👩🏻‍💻,均保留原有
+思考、书写变体。Telegram 标准 reaction 不支持 👩‍💻,因此个人与官方 bot 均只用
+🤔 / 🤓 / ✍,基础回落为 🤔。飞书 / Lark 继续使用平台原生 `Typing` / `THINKING` /
+`SMART` / `OnIt`,不传不受支持的 Unicode 表情。
官方 Desktop 连旧 `msg-op-v1` server 时,处理中变体被拒后复用既有回落表,使用独立
-`:processing-fallback` 幂等键尝试基础款 👨‍💻 一次;完成、取消或账号收口后丢弃迟到的
+`:processing-fallback` 幂等键尝试基础款 🤔 一次;完成、取消或账号收口后丢弃迟到的
处理中回执,不在重连时补发处理中状态。新 server 成功确认 `:processing` 后不会触发此回落。
个人渠道切换表情时,删除失败向共享 turn runner 返回错误,保留旧 token 给终态再清理,
避免飞书/Discord 同时遗留旧排队表情和新处理中表情;最终清理仍是尽力而为。
diff --git a/packages/lizi-im/src/__tests__/processingReactions.test.ts b/packages/lizi-im/src/__tests__/processingReactions.test.ts
index 5ec649216f..d358d71897 100644
--- a/packages/lizi-im/src/__tests__/processingReactions.test.ts
+++ b/packages/lizi-im/src/__tests__/processingReactions.test.ts
@@ -21,10 +21,10 @@ describe('processing reaction transport tokens', () => {
await expect(TelegramIM.prototype.removeMessageReaction.call(telegram, '123|456')).rejects.toBe(error);
});
- it.each(['👨‍💻', '🤔', '🤓', '✍'])(
+ it.each(['👩🏻‍💻', '🤔', '🤓', '✍'])(
'Discord removes the selected %s rather than the requested base emoji',
async (emoji) => {
- const variants = ['👨‍💻', '🤔', '🤓', '✍'];
+ const variants = ['👩🏻‍💻', '🤔', '🤓', '✍'];
vi.spyOn(Math, 'random').mockReturnValue(variants.indexOf(emoji) / 4);
const remove = vi.fn();
const resolve = vi.fn(() => ({ users: { remove } }));
@@ -35,7 +35,7 @@ describe('processing reaction transport tokens', () => {
})),
gateway: { client: { user: { id: 'bot' } } },
} as unknown as DiscordIM;
- const token = await DiscordIM.prototype.reactToMessage.call(im, '123|456', '👨‍💻');
+ const token = await DiscordIM.prototype.reactToMessage.call(im, '123|456', '👩🏻‍💻');
expect(react).toHaveBeenCalledWith(emoji);
expect(token).toBe(emoji);
await DiscordIM.prototype.removeMessageReaction.call(im, '123|456', token!);
diff --git a/packages/lizi-im/src/processingReactions.ts b/packages/lizi-im/src/processingReactions.ts
index 19436a22a8..c9b4df6013 100644
--- a/packages/lizi-im/src/processingReactions.ts
+++ b/packages/lizi-im/src/processingReactions.ts
@@ -1,11 +1,11 @@
/** Processing variants shared by transports; select once when entering processing. */
-export const PROCESSING_REACTION_POOL = ['👨‍💻', '🤔', '🤓', '✍'] as const;
+export const PROCESSING_REACTION_POOL = ['👩🏻‍💻', '🤔', '🤓', '✍'] as const;
// Feishu requires native emoji_type names rather than Unicode reactions.
const FEISHU_PROCESSING_REACTION_POOL = ['Typing', 'THINKING', 'SMART', 'OnIt'] as const;
export function processingReaction(emoji: string, random: () => number = Math.random): string {
const pool =
- emoji === '👨‍💻'
+ emoji === '👩🏻‍💻'
? PROCESSING_REACTION_POOL
: emoji === 'Typing'
? FEISHU_PROCESSING_REACTION_POOL
diff --git a/packages/lizi-im/src/telegram/__tests__/telegramIM.test.ts b/packages/lizi-im/src/telegram/__tests__/telegramIM.test.ts
index 8e8d07e282..ae4488cb1f 100644
--- a/packages/lizi-im/src/telegram/__tests__/telegramIM.test.ts
+++ b/packages/lizi-im/src/telegram/__tests__/telegramIM.test.ts
@@ -1634,7 +1634,7 @@ describe('TelegramIM', () => {
try {
for (const [index, emoji] of PROCESSING_REACTION_POOL.entries()) {
random.mockReturnValue((index + 0.5) / PROCESSING_REACTION_POOL.length);
- expect(await im.reactToMessage('111|5', '👨‍💻')).toBe(emoji);
+ expect(await im.reactToMessage('111|5', '🤔')).toBe(emoji);
const sent = api.calls.filter((call) => call.method === 'setMessageReaction').at(-1)!;
expect(sent.params.reaction).toEqual([{ type: 'emoji', emoji }]);
expect(sent.params.is_big).toBeUndefined();
@@ -1657,12 +1657,12 @@ describe('TelegramIM', () => {
'setMessageReaction',
new TelegramApiError('setMessageReaction', 400, 'REACTION_INVALID'),
);
- expect(await im.reactToMessage('111|5', '👨‍💻')).toBe('👨‍💻');
+ expect(await im.reactToMessage('111|5', '🤔')).toBe('🤔');
expect(
api.calls
.filter((call) => call.method === 'setMessageReaction')
.map((call) => call.params.reaction),
- ).toEqual([[{ type: 'emoji', emoji: '✍' }], [{ type: 'emoji', emoji: '👨‍💻' }]]);
+ ).toEqual([[{ type: 'emoji', emoji: '✍' }], [{ type: 'emoji', emoji: '🤔' }]]);
} finally {
random.mockRestore();
}
@@ -1680,7 +1680,7 @@ describe('TelegramIM', () => {
await connect();
// emoji off: reactToMessage 直接返回 null, 不发 setMessageReaction
expect(await im.reactToMessage('111|5', '👍')).toBeNull();
- expect(await im.reactToMessage('111|5', '👨‍💻')).toBeNull();
+ expect(await im.reactToMessage('111|5', '🤔')).toBeNull();
expect(await im.reactToMessage('111|5', '👀')).toBeNull();
expect(api.calls.some((c) => c.method === 'setMessageReaction')).toBe(false);
// DM replyQuote=first: 首条回复挂回触发消息, 第二条不挂
diff --git a/packages/lizi-im/src/telegram/index.ts b/packages/lizi-im/src/telegram/index.ts
index deeb61eda4..2d191586b9 100644
--- a/packages/lizi-im/src/telegram/index.ts
+++ b/packages/lizi-im/src/telegram/index.ts
@@ -1231,7 +1231,7 @@ export class TelegramIM extends BaseIM implements ChannelIM {
if (behavior.emojiReactions === 'off') return null;
if (this.ambientTriggerIds.has(messageId)) return null; // ambient 全静默
let effective = emoji;
- if (emoji === '👨‍💻') {
+ if (emoji === '🤔') {
// 每次开始处理选择一次,不随进度反复切换;排队 👀 保持固定。
effective = pickExpressiveReaction(PROCESSING_REACTION_POOL);
} else if (behavior.emojiReactions === 'expressive') {
diff --git a/packages/lizi-im/src/telegram/reactionPool.ts b/packages/lizi-im/src/telegram/reactionPool.ts
index e7d66568d3..59832d9144 100644
--- a/packages/lizi-im/src/telegram/reactionPool.ts
+++ b/packages/lizi-im/src/telegram/reactionPool.ts
@@ -4,15 +4,15 @@
* 生动档变体池的**单一客户端出处** — Telegram bot 可用标准 reaction 全集按语义
* 分池(Chris: 能用的都随便用)。正/负分开是底线: 成功不能随机出 💩/🤡。选中
* 表情在该群被限制时(available_reactions), setMessageReaction 会 400 — 调用方
- * 回落基础款(👨‍💻/👍/👎)重试一次。
+ * 回落基础款(🤔/👍/👎)重试一次。
*
* emoji 档本身继续由各车道的 TelegramBehaviorConfig.emojiReactions 三字段直接
* 供给, L1 不为其带默认(#1855 replyQuote 勘误同源纪律): 本模块只提供
* **变体池数据 + 选取原语**, 不做策略判定。
*/
-/** 处理中随机选择工作、思考类表情;不混入排队、成功或失败信号。 */
-export { PROCESSING_REACTION_POOL } from '../processingReactions.js';
+/** Telegram 标准回应不支持 👩‍💻,只选择无性别的思考、书写表情。 */
+export const PROCESSING_REACTION_POOL = ['🤔', '🤓', '✍'] as const;
/** expressive 终态(成功)变体池 — 35 款正向表情。 */
export const EXPRESSIVE_DONE_POOL = [