Skip to content

Conversation

xersion22
Copy link

Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #434
License MIT

This PR introduces the getSystemMessage() method to AgentInterface and implements it in the Agent class.
It also uses this method in ChatCommand to display the system message at the start of the chat session.

Tests were added to verify the new behaviour.

@carsonbot carsonbot added Agent Issues & PRs about the AI Agent component Bug Something isn't working Status: Needs Review labels Sep 9, 2025
@OskarStark
Copy link
Contributor

Thanks for your PR here, much appreciated.
I think this is not needed, we have the input processors in place, but somehow they are not executed when injecting the $agent via DI, can you maybe dig a little deeper? or check if it is registered in a correct way?

While this PR might work, its the wrong direction to me

…mpt-before-first-call

# Conflicts:
#	src/agent/src/AgentInterface.php
#	src/agent/tests/AgentTest.php
@xersion22
Copy link
Author

xersion22 commented Sep 23, 2025

ot needed, we have the input processors in place, but somehow they are not executed when injecting the $agent via DI, can you maybe dig a little de

@OskarStark
I am a bit confused with the comment. The code to display the system message appears in ChatCommand from lines 159 to 163.
The prompt is fetched and displayed after the first successful call to the agent.
Inside the agent call, processInput is called inside an array_map which in turn populates the system message.

So in the chat command it is only possible to fetch the message once the agent call is executed (or processInput executed). The input processor is in place, no doubt. But are you hinting at calling the processor before/outside of the agent call ?

@chr-hertel
Copy link
Member

i guess the issue is with the processor adding that on the fly without mutating the original MessageBag but cloning it. i would favor to use some kind of platform decorator maybe to solve this - if even possible.

but i'm not convinced to extend the AgentInterface based on some debugging use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agent Issues & PRs about the AI Agent component Bug Something isn't working Status: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AI Bundle] ai:chat command does not show system prompt
4 participants