Skip to content

fix(feishu): prevent duplicate delivery when message tool uses generic provider#31538

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
jlgrimes:fix/issue-31526-feishu-duplicate-delivery-mirror
Mar 2, 2026
Merged

fix(feishu): prevent duplicate delivery when message tool uses generic provider#31538
Takhoffman merged 2 commits intoopenclaw:mainfrom
jlgrimes:fix/issue-31526-feishu-duplicate-delivery-mirror

Conversation

@jlgrimes
Copy link
Contributor

@jlgrimes jlgrimes commented Mar 2, 2026

Summary

  • prevent same-target reply duplication when the message tool sends without explicit channel/provider metadata
  • treat generic provider: "message" sends as originating-channel sends for suppression checks
  • normalize lark -> feishu alias in provider comparisons to avoid alias mismatches
  • add regression tests for both generic-provider and alias paths

Change Type

  • Bug fix

Scope

  • Integrations
  • API / contracts

Linked Issue/PR

User-visible / Behavior Changes

Feishu users no longer receive duplicate assistant replies when a run includes a same-target message-tool send that defaults to the current channel.

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Steps

  1. Trigger a Feishu run where the assistant performs a same-target message send without explicit channel.
  2. Observe outbound behavior.

Expected (after fix)

  • only one user-visible reply is delivered

Testing

  • pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts
  • pnpm exec vitest run src/auto-reply/reply/followup-runner.test.ts

…ge sends

Treat generic message tool providers as the originating channel when checking same-target suppression, and normalize lark->feishu alias during provider comparison.

Adds regression tests for generic provider and lark alias paths.

Fixes openclaw#31526
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 2, 2026

Greptile Summary

Fixed duplicate Feishu reply delivery when message tool uses generic provider or channel alias. The implementation correctly normalizes provider aliases (larkfeishu) and treats generic message provider sends as originating-channel sends for suppression checks. Test coverage includes both generic-provider and alias-normalization paths.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a focused bug fix with comprehensive test coverage
  • The implementation correctly handles the duplicate reply issue through proper provider normalization. The logic for treating generic message provider as originating-channel provider is sound, and the alias map defensive fallback is a good practice. Tests cover both new scenarios (generic provider and lark alias). All existing tests pass, and the changes are isolated to the duplication suppression logic.
  • No files require special attention

Last reviewed commit: 015af4a

@Takhoffman Takhoffman merged commit aa5d173 into openclaw:main Mar 2, 2026
9 checks passed
@Takhoffman
Copy link
Contributor

PR #31538 - fix(feishu): prevent duplicate delivery when message tool uses generic provider (#31538)

Merged via squash.

  • Merge commit: aa5d173
  • Verified: pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-runner.test.ts
  • Changes made:
  • Why these changes were made:
    • The PR fixed behavior and tests, but lacked changelog coverage for a direct user-visible Feishu regression.
  • Changelog: CHANGELOG.md updated=true required=true opt_out=false

Thanks @jlgrimes!

hanqizheng pushed a commit to hanqizheng/openclaw that referenced this pull request Mar 2, 2026
…c provider (openclaw#31538) thanks @jlgrimes

Verified:
- pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-runner.test.ts
- pnpm check (fails on unrelated baseline type errors outside PR scope)

Co-authored-by: jlgrimes <8084595+jlgrimes@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
obviyus pushed a commit that referenced this pull request Mar 2, 2026
…c provider (#31538) thanks @jlgrimes

Verified:
- pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-runner.test.ts
- pnpm check (fails on unrelated baseline type errors outside PR scope)

Co-authored-by: jlgrimes <8084595+jlgrimes@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Linux2010 pushed a commit to Linux2010/openclaw that referenced this pull request Mar 2, 2026
…c provider (openclaw#31538) thanks @jlgrimes

Verified:
- pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-runner.test.ts
- pnpm check (fails on unrelated baseline type errors outside PR scope)

Co-authored-by: jlgrimes <8084595+jlgrimes@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…c provider (openclaw#31538) thanks @jlgrimes

Verified:
- pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-runner.test.ts
- pnpm check (fails on unrelated baseline type errors outside PR scope)

Co-authored-by: jlgrimes <8084595+jlgrimes@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
dawi369 pushed a commit to dawi369/davis that referenced this pull request Mar 3, 2026
…c provider (openclaw#31538) thanks @jlgrimes

Verified:
- pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-runner.test.ts
- pnpm check (fails on unrelated baseline type errors outside PR scope)

Co-authored-by: jlgrimes <8084595+jlgrimes@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
OWALabuy pushed a commit to kcinzgg/openclaw that referenced this pull request Mar 4, 2026
…c provider (openclaw#31538) thanks @jlgrimes

Verified:
- pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-runner.test.ts
- pnpm check (fails on unrelated baseline type errors outside PR scope)

Co-authored-by: jlgrimes <8084595+jlgrimes@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…c provider (openclaw#31538) thanks @jlgrimes

Verified:
- pnpm exec vitest run src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-runner.test.ts
- pnpm check (fails on unrelated baseline type errors outside PR scope)

Co-authored-by: jlgrimes <8084595+jlgrimes@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Feishu messages being sent twice - duplicate delivery via delivery-mirror

2 participants