Feishu: normalize group announce targets to chat ids#31546
Feishu: normalize group announce targets to chat ids#31546Takhoffman merged 1 commit intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47c9c0e8b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (lowered.startsWith("group:")) { | ||
| return withoutProvider.slice("group:".length).trim() || null; | ||
| } | ||
| if (lowered.startsWith("channel:")) { | ||
| return withoutProvider.slice("channel:".length).trim() || null; |
There was a problem hiding this comment.
Keep prefixed
* from becoming wildcard entries
Stripping group:/channel: unconditionally here turns inputs like group:* and channel:* into bare *, which resolveFeishuAllowlistMatch treats as a global wildcard (extensions/feishu/src/policy.ts:36). That means a misconfigured groupAllowFrom/sender allowlist entry can now silently flip from deny-all (previous behavior) to allow-all for every group or sender, which is a security-sensitive regression in allowlist enforcement.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR fixes a bug where Feishu group announcements routed as Key changes:
Impact: The implementation correctly routes Confidence Score: 5/5
Last reviewed commit: 47c9c0e |
47c9c0e to
04ca26f
Compare
|
PR #31546 - Feishu: normalize group announce targets to chat ids (#31546) Merged after verification.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04ca26fc4e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (lowered.startsWith("channel:")) { | ||
| return withoutProvider.slice("channel:".length).trim() || null; |
There was a problem hiding this comment.
Treat
channel: targets as chat IDs in receive type resolution
Adding channel: normalization here makes normalizeFeishuTarget("channel:oc_...") return a chat ID, but resolveReceiveIdType still does not recognize the channel: prefix and falls back to user_id. In the send path (extensions/feishu/src/send-target.ts), that combination sends receive_id=oc_... with receive_id_type=user_id, which causes Feishu API failures for channel-targeted sends instead of routing as chat_id.
Useful? React with 👍 / 👎.
… thanks @liuxiaopai-ai Verified: - pnpm build - pnpm check (fails on unrelated existing main-branch lint violations in ui/src/ui/views/agents-utils.ts and src/pairing/pairing-store.ts) - pnpm test:macmini Co-authored-by: liuxiaopai-ai <73659136+liuxiaopai-ai@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
… thanks @liuxiaopai-ai Verified: - pnpm build - pnpm check (fails on unrelated existing main-branch lint violations in ui/src/ui/views/agents-utils.ts and src/pairing/pairing-store.ts) - pnpm test:macmini Co-authored-by: liuxiaopai-ai <73659136+liuxiaopai-ai@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
… thanks @liuxiaopai-ai Verified: - pnpm build - pnpm check (fails on unrelated existing main-branch lint violations in ui/src/ui/views/agents-utils.ts and src/pairing/pairing-store.ts) - pnpm test:macmini Co-authored-by: liuxiaopai-ai <73659136+liuxiaopai-ai@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Summary
group:andchannel:prefixes to chat IDschat:/user:/open_id:behavior unchangedgroup:oc_*andchannel:oc_*resolve aschat_idProblem
sessions_sendannounce can route Feishu group targets asgroup:oc_*.Feishu target normalization previously left that prefix intact, so send path defaulted to
user_id, causing API 400 errors for group announce delivery.Validation
pnpm test extensions/feishu/src/targets.test.tspnpm exec oxlint extensions/feishu/src/targets.ts extensions/feishu/src/targets.test.tsFixes #31426