Skip to content

fix(feishu): reject empty send responses instead of reporting success - #4323

Merged
jujn merged 1 commit into
agentscope-ai:mainfrom
c020627:fix-feishu-send-empty-response
Nov 22, 2026
Merged

jujn merged 1 commit into
agentscope-ai:mainfrom
c020627:fix-feishu-send-empty-response

Conversation

@c020627

@c020627 c020627 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Problem

FeishuOutboundClient.send() treats an HTTP 200 response with an empty body as a successful delivery.

bodyToMono(String.class) completes empty when the response body is empty, so the downstream map(this::checkSendResponse) is skipped entirely. The returned Mono completes without ever validating the Feishu response envelope:

  • send() reports delivery success for a response that carries no code at all.
  • sendWithReceipt() completes empty, so callers never obtain a receipt.

The sibling WeComOutboundClient already guards this case with .defaultIfEmpty("").

Fix

Add .defaultIfEmpty("") before validation so an empty 200 body flows into checkSendResponse and is rejected as a malformed response (code missing) instead of being silently reported as delivered.

Test

FeishuOutboundClientTest starts a local HttpServer that returns an empty 200 body for the send endpoint. Before the fix, send() completes; after the fix it errors with IllegalStateException: code missing.

Verification

  • Targeted test: pass
  • Module full test suite: pass
  • Spotless: pass

@jujn
jujn merged commit b515982 into agentscope-ai:main Nov 22, 2026
5 checks 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