Repository navigation
feat: send bridged notifications to the feishu owner dm - #36602
Conversation
The notification bridge already delivers a routed channel's notes, the pending tool-approval note included, to the owner's DM on Discord, Telegram and Webex, but Feishu was in neither of its transport lists, so an owner reachable only on Feishu heard nothing while an approval waited. Feishu joins BRIDGE_TRANSPORTS and TRANSPORT_SINKS and the Deliver to row gets its label. It is served by the same TransportBridgeSink and owner-DM leg as the other transports, so routing, governance, rate limit, redaction and the single allow-listed owner rule are unchanged. It stays out of REPLY_TRANSPORTS: answering from Feishu needs an inbound reply reader and is tracked separately. Closes #32130
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: Feishu already meets both conditions the generic sink and owner-DM leg rely on ( [DESIGN-REVIEWED] 8da6df2 Description read[DESCRIPTION-READ] 880754c2e3302f1875a5765626b5f4256f5602e9dcba648ee6adc868737e7e33 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This adds Feishu as a read-only owner-DM destination that only works when someone picks it, and it reuses the generic What this change shipsInventory (5 items) — 5 justifiedIntent: An owner who can only be reached on Feishu gets routed notifications, including a waiting approval, as a Feishu DM. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 8da6df2 Description read[DESCRIPTION-READ] 9c6ac1a3890cddd319c00ca3b09ecbc64ab75218440257496d5a2e35de4fd272 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The one UI change is a Feishu label in the existing "Deliver to" pattern, and the screenshots show it unticked, ticked, and in light and dark themes. Notes
[UX-REVIEWED] 8da6df2 Description read[DESCRIPTION-READ] 82d056a3c5818a8c63d30fd20e02fccbdf90e24908ef3fb9ce47adfbcb83970d That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head 8da6df2. I traced the Feishu path through the existing bridge pipeline. It is vetted, audited, rate limited and redacted before any sink runs. The owner DM leg then re-checks the channels/feishu governance gate, the live roster and may_send_to before each part. The owner can only come from the configured allowed_open_ids, so a learned peer is never named owner. Feishu stays out of REPLY_TRANSPORTS, so a pending approval note carries no reply prompt and no call detail. Removing feishu from either backend tuple fails a pinned test.
Done well: Feishu is added as data only, so it runs through the shared governed sink instead of new code. The new test drives the real FeishuTransport with only the Lark client faked, and pins the read-only non-goal as a mutation check.
Optional:
- Merging closes #32130, but its title still asks for the expiry notice. Consider filing a follow-up issue for expiry, or retitling #32130 to the narrowed scope, so that request is not lost.
- No test fails if the
feishuentry inBRIDGE_TRANSPORT_LABEL_KEY(NotificationsBridgeRoute.tsx:30) is removed. A small vitest case that checks a Feishu checkbox appears, or a parity check against the Python tuple, would cover the UI half.
The notification bridge already delivers a routed channel's notes, the pending tool-approval note included, to the owner's DM on Discord, Telegram and Webex, but Feishu was in neither of its transport lists, so an owner reachable only on Feishu heard nothing while an approval waited. Feishu joins BRIDGE_TRANSPORTS and TRANSPORT_SINKS and the Deliver to row gets its label. It is served by the same TransportBridgeSink and owner-DM leg as the other transports, so routing, governance, rate limit, redaction and the single allow-listed owner rule are unchanged. It stays out of REPLY_TRANSPORTS: answering from Feishu needs an inbound reply reader and is tracked separately. Closes #32130 (cherry picked from commit 1438766)
The notification bridge already delivers a routed channel's notes, the pending tool-approval note included, to the owner's DM on Discord, Telegram and Webex, but Feishu was in neither of its transport lists, so an owner reachable only on Feishu heard nothing while an approval waited. Feishu joins BRIDGE_TRANSPORTS and TRANSPORT_SINKS and the Deliver to row gets its label. It is served by the same TransportBridgeSink and owner-DM leg as the other transports, so routing, governance, rate limit, redaction and the single allow-listed owner rule are unchanged. It stays out of REPLY_TRANSPORTS: answering from Feishu needs an inbound reply reader and is tracked separately. Closes #32130 (cherry picked from commit 1438766)
Problem / Motivation
Goal: An owner who routes a notification channel to Feishu gets its notes, a waiting tool approval included, as a DM on Feishu, the way Discord, Telegram and Webex owners already do.
The notification bridge sends a routed channel's notes to the owner's DM on Discord, Telegram and Webex, and with the "Send pending approvals to chat apps" preview on it also sends one note when a tool approval opens. Feishu is in neither of its transport lists. So Settings never offers Feishu under "Deliver to", a route naming it is refused as an unknown transport, and an owner who is only reachable on Feishu hears nothing while an approval waits and then auto-declines.
Why it matters
A dashboard turn that needs an approval while the owner is away waits out its whole window and is declined, and a Feishu-only owner has no way to know. Feishu can already send the first message to an allow-listed DM (#31283), so the only thing missing is the bridge using it.
Not a goal
REPLY_TRANSPORTS: that needs an inbound reply reader and is tracked in Feishu: two-way dashboard link and numbered-text tool approval #31448.What changed (motivation → approach → change)
Feishu becomes one more read-only bridge transport. It needs no code of its own: the generic
TransportBridgeSinkand the owner-DM leg already serve any connectedMessagingTransportthat can send first and names exactly one owner DM, and Feishu does both (supports_proactive_send=True, insideCHANNEL_OWNER_DM_NAMESPACES).notifications/bridge.pyBRIDGE_TRANSPORTSfeishuis a known route target, sodeliver_to: ["feishu"]is stored instead of refusednotifications/bridge_transport.pyTRANSPORT_SINKSopen_idwebsite/src/pages/settings/NotificationsBridgeRoute.tsxdocs/system-specs/modules/app-notifications.md,src/kiro_crew/docs/feishu-integration.mdRouting, governance, the rate limit, redaction and the one-owner rule are the shared ones, unchanged. A reply in Feishu is still an ordinary message, never an answer to the approval.
Backwards compatibility
Compatible: one more accepted transport id; every route main accepts is stored and delivered as before, and a route that does not name Feishu behaves the same.
Removes nothing: the diff only adds an id to two tuples and one label.
Tests
test/test_notification_bridge_transport.pyadds a Feishu row (the realFeishuTransport, only its Lark client faked), so every per-transport case runs on Feishu too: a routed critical note lands once as a redacted owner DM, and not connected, two allow-listed people, no proactive send, outside the owner roster and a refused send are each audited as a skip or an error. The roster pins (every sink has a row; every sink can name its owner) cover Feishu.("open_id", owner), and it carries no "Reply approve or deny" prompt and no call detail.test/test_notification_bridge.pypins the known set withfeishu.Determinism (Ubuntu 24.04 host): every node id in
test/test_notification_bridge_transport.pyplustest_the_known_transports_are_pinned, passed 20 of 20 runs at-n0, 10 of 10 at-n 4 --dist loadgroupbesidetest_notification_settings.pyandtest_notification_bridge_approval_note.py, and a shuffled order (seed 21363).Red before, green after:
prove.pyreverted the production hunks andtest_the_known_transports_are_pinnedandtest_every_bridge_transport_but_slack_has_a_test_rowfailed; both pass on this head.Manual verification
Run on a Linux host (Ubuntu 24.04, Python 3.12), on a real isolated gateway built from this branch and from its base. The host has no Feishu tenant, so the delivery itself is driven in-process with the real
FeishuTransportand only its Lark client faked.c22557cd83GET /api/notifications/channelsbridge_transportsfeishufeishuPUT /api/notifications/channels/settings{"channel": "system.approval", "deliver_to": ["feishu"]}400 deliver_to names unknown transports ['feishu']200, route stored("open_id", "ou_owner1"):🚨 **Approval needed**/execute_bash is waiting for approval in Release notes., no reply prompt, no call detail; auditnotification_bridge:feishu completedGates on the host: black, isort, flake8, mypy, semgrep (0 findings), docs-lint, the flake-pattern ratchet,
tsc, the bridge-route vitest files andscripts/local-gate.py(both surfaces) are green, except two backend reds that fail the same way on a clean base checkout of that host (test_find_ui_auto.py::test_the_generated_auto_tier_answers_labels_only_it_carries[continue with github-...]andtest_host_git_repo_exec_neutralization.py::TestCliUpdate::test_up_to_date_diff_runs_no_textconv_planted_during_the_fetch).Screenshots / video
Settings → Notifications → Sources on the isolated gateway. Only
/api/statusis intercepted, to report Feishu as connected (no tenant on the test host);bridge_transportsand the route save are the real gateway's.Before (base): Feishu connected, yet no row offers it.
After: every row offers Feishu under "Deliver to".
Feishu picked on the approval row (the floor picker appears), light and dark
Related Issues
Closes #32130
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.