Skip to content

fix: demote SystemMessage to UserMessage in HandoffMessage context - #8260

Open
MOHAMMED WASIM KHAN (wasim-builds) wants to merge 2 commits into
microsoft:mainfrom
wasim-builds:fix/8238-handoff-message-role-demotion
Open

MOHAMMED WASIM KHAN (wasim-builds) wants to merge 2 commits into
microsoft:mainfrom
wasim-builds:fix/8238-handoff-message-role-demotion

Conversation

@wasim-builds

Copy link
Copy Markdown

Fixes #8238

Copilot AI lite review requested due to automatic review settings September 19, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread patch_8238.py Outdated
with open(file, "w") as f:
f.write(content)
else:
print(f"Failed to find old code in {file}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is patch_8238.py meant to be part of the repo? It looks like a one-off migration/editing script used to apply the same change to three files, while the actual source edits are already included in this PR. If it is not needed at runtime or for tests, it may be better to drop it from the final change.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks Pramod Ubbala (@upramod)! Good catch — patch_8238.py was indeed a temporary migration helper used during development and is not needed at runtime or in tests. It has been removed from the branch.

@wasim-builds

Copy link
Copy Markdown
Author

Hi maintainers, thank you for the review on this handoff message handling PR! The temporary patch script has been removed and the role demotion logic has been verified with existing test suites.

I'm very enthusiastic about multi-agent workflows in AutoGen and would love to contribute further to the core agent abstractions. I'm also actively open to freelance/contract engagements, full-time roles, or joining as a team contributor. More of my open-source projects can be found at https://github.com/wasim-builds.

This branch has not been deployed

No deployments
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.

HandoffMessage.context splices peer-authored messages into another agent's model context with their declared LLM role intact

3 participants