Skip to content

[codex] Add minimal Feishu/Lark support#90

Closed
eeelvn-bot wants to merge 3 commits into
pwrdrvr:mainfrom
eeelvn-bot:codex/feishu-lark-support-minimal-main
Closed

[codex] Add minimal Feishu/Lark support#90
eeelvn-bot wants to merge 3 commits into
pwrdrvr:mainfrom
eeelvn-bot:codex/feishu-lark-support-minimal-main

Conversation

@eeelvn-bot
Copy link
Copy Markdown

@eeelvn-bot eeelvn-bot commented Apr 10, 2026

Summary

This PR adds minimal Feishu/Lark support to the plugin.

It is intentionally scoped to the smallest repository diff needed to make Feishu work end to end:

  • Feishu message dispatch
  • Feishu status cards and button callbacks
  • Feishu DM binding and resume flows
  • Feishu-specific state persistence and typings
  • The minimal Feishu approval-click parsing fix needed so Approve Once works when Feishu sends the full /cas_click <token> command body

This PR intentionally does not include the generic compaction lifecycle fix. That channel-agnostic fix is proposed separately in #89.

This PR supersedes #82.

Why this replaces #82

Compared with the branch behind #82, this PR is materially smaller:

  • Files changed: 20 -> 8 (-60.0%)
  • Insertions: 4206 -> 1372 (-67.4%)
  • Deletions: 1205 -> 36 (-97.0%)

The intent is to preserve only the code that is strictly required for Feishu/Lark support and leave unrelated cleanup or broader refactors out of scope.

Why each changed file is necessary

  • index.ts

    • Registers the Feishu before_dispatch hook and the internal interactive callback command.
    • Without this file change, Feishu messages and card button callbacks never enter the plugin.
  • index.test.ts

    • Locks the plugin registration surface for the new Feishu hook.
    • Without this, the entry-point change is untested.
  • src/controller.ts

    • Implements the Feishu-specific runtime behavior: message routing, status card rendering, button callback handling, DM binding, resume handling, and card fallback behavior.
    • It also contains the minimal Feishu approval-click token parsing fix so /cas_click works whether Feishu passes args or the full commandBody.
    • This is the core of Feishu/Lark support.
  • src/controller.test.ts

    • Covers Feishu dispatch, status cards, callbacks, skills/MCP pickers, DM resume flows, and callback edge cases.
    • It also adds regression coverage for the Feishu approval-click body form.
    • Without these tests, the Feishu-specific controller behavior would regress easily.
  • src/openclaw-plugin-sdk.d.ts

    • Adds the Feishu runtime and before_dispatch typings used by the implementation.
    • Without this, the TypeScript surface does not describe the host capabilities the code now relies on.
  • src/state.ts

    • Persists Feishu DM mappings and callback-related state needed across interactions.
    • Without this, Feishu private-chat routing and resume behavior do not survive across requests.
  • src/state.test.ts

    • Verifies the Feishu DM mapping persistence behavior.
    • Without this, the new state shape is unprotected by tests.
  • src/types.ts

    • Adds the Feishu-specific types needed by controller and state.
    • Without this, the state and controller changes are not type-safe.

What is intentionally excluded

To keep this PR minimal, the following was intentionally split out:

  • Generic compaction stop/detach cleanup
  • Abortable compactThread client support
  • Compaction lifecycle regression tests

Those changes affect Telegram, Discord, and Feishu equally, so they are proposed separately in #89.

Validation

Local verification completed on a clean worktree:

  • pnpm typecheck
  • pnpm test (237 tests passed)
  • Manual Feishu/Lark end-to-end validation with lark-cli as a user, including status cards, button callbacks, resume flows, DM binding, and approval-click parsing

@eeelvn-bot
Copy link
Copy Markdown
Author

@huntharo Hi, pls check the new version. I asked my agent to rebuild it with target of Minimal PR only for adding Feishu/Lark and no other changes.
I redo all the user tests including buttons manually with this version.
there's another issue about compaction is isolated to 89#.

Actually I have few experiences in Github. But I really want to contribute to the community because I benefit from it a lot. So pls help me to do it right. Thanks a lot!

@huntharo
Copy link
Copy Markdown
Contributor

Thank you for your contribution!

Unfortunately there are still changes needed to support such an ambitious plugin in OpenClaw. Some of this functionality is now being included directly in OpenClaw.

Additionally, I have made a new project, https://github.com/pwrdrvr/PwrAgent, that gives you a Codex Desktop replacement app (uses Codex) but also integrates with messaging with openclaw-codex-app-server-like functionality, and Feishu/Lark is included!

Please give it a try!

@huntharo huntharo closed this May 17, 2026
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