Skip to content

fix(feishu): checked receipt for a saved private-chat target - #36

Merged
DoodleBears merged 1 commit into
mainfrom
claude/project-thread-389uxz
Nov 9, 2026
Merged

DoodleBears merged 1 commit into
mainfrom
claude/project-thread-389uxz

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Vain · project thread

Why

Part of BotHarness/DeepSeekBot#3842. A Bot's proactive post always asks for a checked receipt, but Feishu only gave receipts for group targets, so a Bot could never proactively DM its owner (capability-unavailable).

Change

  • delivery-service.sendChecked: a Feishu user target that names its private chat (openId + chatId, already accepted by normalizeRoute) has chatId as its receipt conversation.
  • FeishuRuntime.sendProactiveText: allows receipt: true for such a target. It still sends by open_id and requires the response chat_id to equal that exact chatId, otherwise send-result-unknown.
  • An open_id-only user target still refuses with capability-unavailable before sending.

Verification

  • New tests: runtime (proactive-markdown.test.mjs) and service (delivery-service.test.mjs) cover the matched receipt, the mismatched chat (send-result-unknown) and the open_id-only refusal.
  • node --test test/delivery-service.test.mjs test/channels/feishu/*.test.mjs: 803 pass, 0 fail.
  • Full npm test shows the same timing failures (device auth, stream stop, Discord API) on clean main in this container. They are unrelated to this change.
  • Not run against a live Feishu app.

Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Receipt-enabled Feishu messages can now be sent to saved private-chat targets with a chat ID. Receipts are accepted only when their conversation ID matches the target; mismatches are reported as unknown send results.

A Feishu user target that names its private chat (openId + chatId) can
now be posted with receipt: true. The receipt must match that exact
chat id; an open_id-only user target still refuses with
capability-unavailable. Needed by BotHarness/DeepSeekBot#3842 so a Bot's
proactive DM to its owner is delivered with a checked receipt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lpx6qoDVkpmp8Trm3GtaAJ
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Feishu receipt-enabled sending now supports saved user targets with a private-chat chatId. The runtime checks that the response conversation ID matches the expected conversation. Tests cover matching and mismatched IDs and targets without a chatId.

Changes: Feishu delivery receipts

Layer / File(s) Summary
Resolve and validate receipt conversation
plugin-src/host/delivery-service.mjs, src/channels/feishu/feishu-runtime.mjs, test/channels/feishu/proactive-markdown.test.mjs, test/delivery-service.test.mjs
Checked sending accepts user targets with a route chatId. The runtime validates the returned conversation ID against the expected ID. Tests cover matching IDs, mismatches, and user targets without a chatId.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: xmanrui, alpacchen

Merge Risk: Minimal · up to 03523

Saved Feishu private-chat targets can request checked receipts while mismatched conversations remain rejected. No concrete merge-blocking issue is identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: support checked receipts for saved Feishu private-chat targets.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a650fad-65c4-4a51-b062-0c79f5711282
Commits

Reviewing files that changed from the base of the PR and between bde1cac and 03523c6.

Files selected for processing: 4

  • plugin-src/host/delivery-service.mjs
  • src/channels/feishu/feishu-runtime.mjs
  • test/channels/feishu/proactive-markdown.test.mjs
  • test/delivery-service.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@DoodleBears DoodleBears self-assigned this Nov 9, 2026
@DoodleBears
DoodleBears merged commit d3a39c2 into main Nov 9, 2026
1 check passed
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