mirror of
https://github.com/NanmiCoder/claude-code-haha.git
synced 2026-10-10 11:53:10 +08:00
feat: make IM permission approval mobile-friendly
Text-only IM channels forced users to copy long permission request IDs from mobile chat, which made approval slow and error-prone. This keeps the requestId-based authorization protocol intact while adding short replies for the single-pending-request case and preserving full command fallbacks for ambiguous cases. Constraint: IM authorization must still resolve through the existing requestId permission_response path Rejected: Replace request IDs with global numeric IDs | concurrent permission prompts would make numeric IDs ambiguous across chats Confidence: high Scope-risk: moderate Directive: Do not allow short numeric replies when more than one permission request is pending in the chat Tested: cd adapters && bun test common/ telegram/ feishu/ dingtalk/ wechat/ Tested: cd adapters && bunx tsc --noEmit Tested: bun run check:adapters Not-tested: Real WeChat or Telegram account end-to-end message delivery
This commit is contained in:
@@ -502,7 +502,7 @@ async function routeUserMessage(message: WechatMessage): Promise<void> {
|
||||
await sendText(chatId, sent ? '已清空当前会话上下文。' : '无法发送 /clear,请先发送 /new 重新连接会话。')
|
||||
return
|
||||
}
|
||||
const permissionDecision = !hasAttachments ? parsePermissionCommand(text) : null
|
||||
const permissionDecision = !hasAttachments ? parsePermissionCommand(text, pendingPermissions.get(chatId)) : null
|
||||
if (permissionDecision) {
|
||||
const { requestId, allowed, rule } = permissionDecision
|
||||
const pending = pendingPermissions.get(chatId)
|
||||
|
||||
Reference in New Issue
Block a user