opencode icon indicating copy to clipboard operation
opencode copied to clipboard

expose chat message agent to plugin

Open karl-tye opened this issue 4 months ago • 2 comments

After attempting to retrieve the agent for a particular message in my plugin, this seemed like the only available option. I believe this fits under Missing standard behavior for plugins :crossed_fingers:

Looking at the design, I'm sure there's a better place to expose this information. Feedback would be greatly appreciated

karl-tye avatar Aug 26 '25 10:08 karl-tye

i think it's under message.mode - it's still under the old name

thdxr avatar Aug 30 '25 06:08 thdxr

i think it's under message.mode - it's still under the old name

I can see that this is the case for assistantMsg (type AssistantMessage) later on in the chat function. However, this is not propagated via Plugin.trigger. We could extend the "chat.message" hook to be triggered on both user and assistant messages which could be interesting.

karl-tye avatar Aug 31 '25 14:08 karl-tye