You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat(handoff): route assignee notifications by channel (#200)
* feat(handoff): route assignee notifications by channel
- SOP handoff nodes and channel bindings gain assignee_notify_channel:
None keeps default delivery, "web" limits to the web inbox, and a bound
channel (e.g. feishu) forwards the handoff via that channel
- validate the assignee is an internal member and, when a channel is
requested, that a non-group channel identity is bound in the binding
scope; skills API rejects unreachable channel specs
- surface channel-labelled assignee options in the channels page and the
SOP editor (source and flow views), sharing the new handoff-assignee
helpers
- restrict the SOP editor: the assignee picker and handoff action now
appear only on handoff-type nodes, and switching a node away from
handoff strips its handoff action and assignee
- resume handoff turns as the session owner so harness user fencing
passes after channel-identity rebinding migrates session.user_id
* fix(channels): clean up mounts when deleting an employee
Deleting an agent left orphan rows in channel_binding_agents, so the
Feishu/DingTalk /员工 command listed a bare agent_id for a deleted
employee and /切换 could route a conversation to it. delete_agent now
removes the agent's channel mounts, promotes the first remaining mount
to default (syncing binding.agent_id) when the default mount is deleted.
mounted_agents additionally filters mounts whose agent no longer exists,
so legacy orphan rows self-heal across listing, switching, autorouting,
and the channels page; conversation pointers keep resetting through the
existing resolve_current_agent fallback.
* feat(channels): list full Feishu permission set
The Feishu setup page now lists all twelve permissions the integration
needs: three contact-reading scopes (contact:contact.base:readonly,
contact:user.base:readonly, contact:user.id:readonly), the group
message scopes (group_at_msg, group_at_msg.include_bot, group_msg,
group_msg.include_bot:read, im:message:readonly) alongside the existing
p2p/send/reaction scopes. Directory and sensitive group-read entries
move out of the "usually removable" list since they are now required,
and the tooltip copy plus English translations follow suit.
* fix(skills): record SOP call events in harness v2
The SOP call count in the admin console was stuck at zero: skill stats
count skill_started/skill_resumed agent events, which only the removed
legacy agent loop used to emit. Harness v2 now records the events when
an SOP task frame is activated — start_new_task emits skill_started,
switch_to_pending emits skill_resumed, continuing the active SOP stays
uncounted — with the legacy payload shape so the stats reader, trace
consumers, and Feishu traces keep working.
Also fix a fallout from the mount cleanup: adopt_orphan_channel_sessions
must claim sessions using raw mount rows instead of the user-facing
filtered mount set, since historical sessions can belong to deleted
employees and still need to migrate to the new binding.
* fix(handoff): restrict assignee notify channel to feishu
* fix(channels): dedupe feishu identity bindings display
* fix(teams): purge team chat sessions on team delete
删除团队此前只清理成员/任务等表,带 team_id 的会话残留并在对话端
全局列表可见。抽出共享清理助手 session/cleanup.py(消息/事件/反馈/
Harness 记录同事务删除,commit 后清 Harness 工作区),delete_team 与
delete_chat_session 端点统一复用。
* fix(agents): cascade session cleanup on agent delete
删除员工此前会话全部残留,且发消息会由租户默认 persona 静默接管
回复。现在删除员工时级联清空其全部会话(含 Harness 工作区),同步
清理团队成员关系,active 定时任务立即 paused,pending 人工转接
标记 cancelled。
* fix(db): purge orphaned chat sessions on startup
级联清理上线前删除团队/员工残留的孤儿会话,init_db 启动时幂等清理,
复用与删除时相同的 purge 逻辑。
* feat(channels): humanize feishu trace card step, status and tool labels
* refactor(handoff): route assignee notify via generic outbox with scope-level validation
* feat(channels): compact SOP progress with flip animation on feishu trace card
* feat(channels): allow feishu quote replies to handoff notices
Assignees can now answer human handoff notices by replying (quoting)
the notification message directly in feishu, without the /回复反馈
prefix. Replies quoting already-answered notices or ack messages are
consumed with a hint instead of starting a new agent conversation.
- match quote replies against delivered handoff_notice/handoff_ack
message ids with strict receive_id sender validation
- persist message_id for handoff_ack deliveries so follow-up quote
replies are consumed too
- bound problem description to keep notices single-message for
reliable quote matching
- update notice and usage text to advertise direct quote reply
* feat(channels): 支持渠道接入命名与重命名
* feat(channels): 成员选择下拉框支持搜索过滤
---------
Co-authored-by: Wang He <wanghe@WangdeMacBook-Pro.local>
Co-authored-by: Wang He <wanghe@192.168.1.205>