Skip to content

Python: skip empty and whitespace-only instructions in prepend - #8524

Open
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/prepend-empty-instructions
Open

Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/prepend-empty-instructions

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Fixes #8523.

Drops empty and whitespace-only instruction entries before building messages, so an unset instructions default adds no message. Real instructions are prepended verbatim, including their own surrounding whitespace.

3 tests (empty string adds nothing, whitespace-only adds nothing, real instruction verbatim); the first two fail on main. Types suite green.

Only None short-circuited before; an instructions value of "" (the
usual unset-options default) still injected a system message with empty
content ahead of the conversation. Empty and all-whitespace entries are
dropped, and a real instruction prepends verbatim.

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>

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.

@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: empty-string instructions inject a contentless system message

2 participants