Repository navigation
feat(feishu): add Feishu approval bridge + deepcode feishu CLI - #277
raymondginger2018-sudo wants to merge 1 commit into
Conversation
Wire integrations/feishu_approver as an approval bridge: risky ops raise an approval.requested event, the bridge pushes an interactive card over the Feishu long-lived websocket, and an allowlisted open_id click submits approval/respond. Config, card, and bridge modules are env-gated and lazy-import lark_oapi so the core install stays lean. Optional [feishu] extra declares lark-oapi; deepcode feishu start/status/stop is the CLI entry point. Approval-bridge scope only (phone remote control is a follow-up PR).
|
Thanks a lot for this, @raymondginger2018-sudo! The bridge is cleanly separated: it only talks to the service over the authenticated RPC, the We'd prefer not to carry it in core, though. It adds an SDK and a Feishu setup we can't exercise in CI, and since it needs nothing from core beyond the app server RPC, it works just as well as a standalone package with its own console script. If you publish it, we'll gladly link it from the docs. A few things worth fixing before anyone relies on it:
Thanks again! |
|
Thank you for the thorough review, @Zongwei9888 — and for the kind words about the separation of the bridge. Agreed on the direction: since the bridge needs nothing from core beyond the app-server RPC, it belongs as a standalone package with its own console script rather than in core. I'm closing this PR and keeping the All six fixes you listed are captured and will land before any publish: no auto-resolution timeout actions (pending, never self-approved), leave approval pending when a card can't be delivered, reconnect on If/when the package is published I'll open a docs-only PR to link it, as you offered. Thanks again! |
|
Thanks @raymondginger2018-sudo, that sounds like a good plan. Looking forward to the package; the docs link offer stands. |
Summary
Add a Feishu (Lark) approval bridge: risky operations raise an
approval.requestedevent, the bridge pushes an interactive card over Feishu's long-lived websocket, and an allowlistedopen_idclick submitsapproval/respond. Entry point:deepcode feishu start|status|stop.Changes
integrations/feishu_approver/—config.py/feishu_card.py/bridge.py/__main__.py(all new). Env-gated;lark_oapiis lazy-imported only when the bridge actually runs, so the core install stays lean.cli/feishu_cli.py(new) —deepcode feishu start|status|stopCLI.deepcode.py— CLI dispatch forfeishu+ one help-table row (the runtime call point).setup.py— optionalfeishuextra:lark-oapi>=1.4.0(pip install .[feishu]).tests/test_feishu_approver.py(new) — 8 tests covering config allowlist, card payload, and bridge respond flow.Tests
tests/test_feishu_approver.py: 8 passed (Windows, py3.12 / 3.13 / 3.14 legs of the local CI replay).preflight, 10 jobs / 30 checks):PREFLIGHT: KNOWN-RED | new=0 | known=1— zero new failures; the one known red is a pre-existing Windows-lifecycle baseline entry, unrelated to this diff (this PR touches no lifecycle code).Dependency note
lark-oapi>=1.4.0lives only in the optionalfeishuextra and is lazily imported; a core install without the extra is unaffected.main:app_server.native_client.NativeRpcClient,app_server.service_state.ServiceFiles,core.persistence.database.default_database_path(verified viagit greponupstream/main).Scope
Approval-bridge only. Phone remote control is intentionally deferred to a follow-up PR.
Local verification