Skip to content

fix(emitter): preserve unset group id when cloning - #1583

Open
Diwak4r wants to merge 1 commit into
i-am-bee:mainfrom
Diwak4r:fix/emitter-clone-none-group-id
Open

fix(emitter): preserve unset group id when cloning#1583
Diwak4r wants to merge 1 commit into
i-am-bee:mainfrom
Diwak4r:fix/emitter-clone-none-group-id

Conversation

@Diwak4r

@Diwak4r Diwak4r commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Emitter.clone() built the cloned emitter by passing str(self._group_id). Since group_id is str | None and defaults to None, an unset group id became the literal string "None" — a truthy, meaningless value that changed event semantics after cloning (e.g. EventMeta.group_id would suddenly be "None" instead of None).

The fix passes the group id through unchanged, so a clone of an emitter without a group id keeps None.

Changes

  • python/beeai_framework/emitter/emitter.py: clone() now passes self._group_id directly instead of str(self._group_id).
  • python/tests/test_emitter.py: regression tests — cloning preserves both an unset (None) and a set group id.

Tests

python -m pytest tests/test_emitter.py → 18 passed. Dependent clone consumers (lite agent, token/summarize/sliding memory) → 33 passed. ruff check on changed files → clean.

Fixes #1581

@Diwak4r
Diwak4r requested a review from a team as a code owner August 4, 2026 07:53
Copilot AI lite review requested due to automatic review settings August 4, 2026 07:53
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the python Python related functionality label Aug 4, 2026
Signed-off-by: Diwak4r <diwak4r.comp@gmail.com>
@Diwak4r
Diwak4r force-pushed the fix/emitter-clone-none-group-id branch from deb6763 to 9208e93 Compare August 5, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python related functionality size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emitter.clone() turns an unset group_id into the literal string "None" (Python)

2 participants