Skip to content

feishu org sync fixed to root department#294

Open
bigbearcool wants to merge 5 commits intodataelement:mainfrom
bigbearcool:main
Open

feishu org sync fixed to root department#294
bigbearcool wants to merge 5 commits intodataelement:mainfrom
bigbearcool:main

Conversation

@bigbearcool
Copy link
Copy Markdown

Summary

Checklist

  • Tested locally
  • No unrelated changes included

YuanZhang and others added 5 commits March 29, 2026 09:36
- Add AgentGroup model for managing group relationships
- Add agent_groups API for CRUD operations
- Modify gateway send-message to support group targets
- Add group relationships UI in AgentDetail page
- Add broadcast_groups UI in ChannelConfig (feishu)
- Check if target is a group in AgentGroup before looking up members
- Send directly to group chat_id via feishu_service for group targets
- Works with existing send_channel_message tool call pattern
…tion

The original per-department fetch fails because the root department (id=0)
returns 'no dept authority error' - the app lacks permission to access it.

Solution: override sync_org_structure to use contact/v3/users (global list)
instead of find_by_department. This fetches all users regardless of
their department hierarchy position, ensuring root-department users are included.

Changes:
- Add _fetch_all_users() using global /contact/v3/users API
- Override sync_org_structure to use global user fetch
- Keep dummy fetch_users() to satisfy abstract base class
@wisdomqin
Copy link
Copy Markdown
Contributor

Thanks for building this — the idea of letting agents broadcast messages directly to chat groups (Feishu/WeCom/DingTalk) is a genuinely useful feature and something we want to support.

However, this PR mixes the group broadcast feature with the Feishu org sync refactor (same change as PR #295, which we've reviewed separately). The org sync change has issues that prevent us from merging it right now.

Rather than asking you to refactor and resubmit, we'd like to plan both features properly into a future release. Could you describe your use cases in a bit more detail?

For group broadcast:

  • What does a typical workflow look like? (e.g., agent monitors something → sends alert to a Feishu group)
  • Do you need agents to receive messages FROM groups, or only send to them?
  • Which channels are highest priority for you — Feishu only, or WeCom/DingTalk as well?

For the Feishu org sync issue (from PR #295):

  • What specific constraint is blocking the current sync for your setup?

We'll incorporate well-designed solutions for both in an upcoming version. Closing this PR for now.

@wisdomqin wisdomqin mentioned this pull request Apr 5, 2026
2 tasks
@bigbearcool
Copy link
Copy Markdown
Author

Hi wisdomqin, thanks for the detailed questions!
Group Broadcast workflow:
Agent monitors some condition (e.g., system alert, task completion, scheduled check)
When condition is met, Agent sends notification to configured Feishu group
Typical use case: "Server CPU > 80%" → Alert bot posts to #ops-channel
Message direction:
Currently only send to group (one-way)
Receiving group messages is not required for our use case
Channel priority:
Feishu (highest) - most of our enterprise customers use Feishu
WeCom/钉钉 - secondary interest
Hope this helps with the design!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants