before_message_write fires for both user (incoming) and assistant (outgoing) messages. Without a role check, end symbols from other agents' incoming messages incorrectly trigger turn advances. Add role check to skip non-assistant messages early.
before_message_write fires for both user (incoming) and assistant (outgoing) messages. Without a role check, end symbols from other agents' incoming messages incorrectly trigger turn advances. Add role check to skip non-assistant messages early.