Skip to content

fix(feishu): infer receive_id_type from chat_id prefix - #7769

Open
dalianmao000 wants to merge 1 commit into
NousResearch:mainfrom
dalianmao000:fix/feishu-pr
Open

fix(feishu): infer receive_id_type from chat_id prefix#7769
dalianmao000 wants to merge 1 commit into
NousResearch:mainfrom
dalianmao000:fix/feishu-pr

Conversation

@dalianmao000

Copy link
Copy Markdown
Contributor

Summary

  • Infer receive_id_type from chat_id prefix to support all Feishu ID types:
    • ou_ prefix → open_id
    • on_ prefix → union_id
    • default → chat_id
  • Previously hardcoded receive_id_type="chat_id" which caused Feishu API error [230001] invalid receive_id for open_id targets

Fixes

Fixes #7685

Test plan

  • Create cron job with deliver: "feishu:ou_xxxxx" and verify delivery succeeds
  • Verify chat_id (oc_) and union_id (on_) targets still work

🤖 Generated with Claude Code

Support open_id (ou_*) and union_id (on_*) targets in addition to
chat_id (oc_*). Previously hardcoded receive_id_type="chat_id"
which caused API rejection 230001 for open_id targets.

Fixes NousResearch#7685

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter comp/gateway Gateway runner, session dispatch, delivery labels Apr 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #7694 — same fix (infer receive_id_type from chat_id prefix in Feishu adapter). Both fix #7685. Also overlaps with #10040.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying the Feishu recipient-type gap. The union-ID portion remains valid on current main.

Problems

  • The PR targets gateway/platforms/feishu.py, but commit 5600105478ffde29d7566b45421b100eaa29c4ef moved the live adapter to plugins/platforms/feishu/adapter.py; the submitted patch cannot apply.
  • Current main already maps ou_ to open_id at plugins/platforms/feishu/adapter.py:4641-4642. However, on_ still falls through from the chat_id default at :4637 to request construction at :4650.
  • The PR contains no regression test. tests/gateway/test_stream_consumer_thread_routing.py:176-280 already exercises this plugin adapter path.

Suggested changes

  • Salvage only an on_union_id branch into plugins/platforms/feishu/adapter.py, retaining the existing feishu_user_id:, ou_, and thread handling.
  • Add a plugin-adapter regression test for on_ delivery using the existing _run_blocking test pattern.

Automated hermes-sweeper review.

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

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(feishu): _send_raw_message hardcodes receive_id_type="chat_id", breaks delivery to open_id (ou_) targets

3 participants