Skip to content

Conversation

@gokul-312
Copy link
Contributor

@gokul-312 gokul-312 commented Dec 9, 2025

Summary

Extends MessageType to drop messages with "developer" role, consistent with how "system" messages are handled. Developer messages are filtered out during message casting, as they are replaced by Instructions in the common format.

Changes

  • Modified lib/active_agent/providers/common/messages/_types.rb:

    • Updated the case statement to include "developer" alongside "system" when dropping messages
    • Both roles now return nil during casting
  • Added test in test/providers/common/messages/types_test.rb:

    • New test case: "MessageType drops developer messages"
    • Verifies that developer role messages are properly dropped (return nil)

Behavior

When MessageType#cast receives a hash with role: "developer", it now returns nil, matching the behavior for role: "system". This ensures developer messages are filtered out and replaced by Instructions, maintaining consistency with the common message format.

Closes #285

@TonsOfFun TonsOfFun merged commit 780067d into activeagents:main Dec 9, 2025
9 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.

Bug: "Unknown message role: developer" when using OpenAI provider with instructions

3 participants