Skip to content

fix: correct publish_message return value when no recipients#2094

Open
lxcxjxhx wants to merge 1 commit into
FoundationAgents:mainfrom
lxcxjxhx:fix-issue-2082-publish-message-v3
Open

fix: correct publish_message return value when no recipients#2094
lxcxjxhx wants to merge 1 commit into
FoundationAgents:mainfrom
lxcxjxhx:fix-issue-2082-publish-message-v3

Conversation

@lxcxjxhx

@lxcxjxhx lxcxjxhx commented Jul 8, 2026

Copy link
Copy Markdown

Fixes #2082

Problem

Environment.publish_message drops messages addressed to unregistered roles and unconditionally returns True, giving the caller no signal that the delivery failed. When send_to matches no registered address, the function logs a warning but still reports success — a producer Role performing a handoff has no machine-readable way to detect the lost message.

Solution

Return False when no recipients match, so callers can detect delivery failures.

Changes

  • Changed the return value from True to False when no recipients are found
  • Preserves backward compatibility for successful delivery (still returns True)

Fixes FoundationAgents#2082

Environment.publish_message drops messages to unregistered roles but returns True.
This fix returns False when message cannot be delivered to any recipient.

Changes:
- Changed return value from True to False when no recipients found
- Maintains backward compatibility for successful deliveries
@lxcxjxhx

lxcxjxhx commented Jul 9, 2026

Copy link
Copy Markdown
Author

Hi @better629 @cmodi-meta @Ruyuan37, this PR fixes #2082 by returning False when publish_message has no matching recipients, instead of silently returning True. The Unit Tests CI has passed. Could you please review and approve the Full Tests workflow? Thanks!

@lxcxjxhx

lxcxjxhx commented Jul 9, 2026

Copy link
Copy Markdown
Author

Hi @better629 @cmodi-meta @Ruyuan37,

This is a gentle follow-up on PR #2094 which fixes issue #2082. The Unit Tests have passed successfully, but the Full Tests workflow is still waiting for approval.

Could you please review and approve the Full Tests workflow when you have a moment? This is a small but important fix that improves error handling in the publish_message function by returning False when no recipients match, so callers can detect delivery failures.

Thank you for your time!

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.

Bug: Environment.publish_message drops messages addressed to unregistered roles and returns True

1 participant