You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Strip trailing role=assistant && content=="" messages before request #26320
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Before making a request, automatically strip any trailing messages in the message[] array where role=assistant and content == "".
Reason: These empty assistant messages are useless and possibly left over from message list generation/processing. Stripping them will reduce invalid tokens sent and make the process neater and more robust.
Proposed implementation:
Before making a request (such as to an LLM/conversation service), iterate message[] backwards and remove all consecutive trailing messages matching the condition.
Reference code location: See packages/sdk/js/src/gen/client/client.gen.ts (beforeRequest), likely in the request pre-processing logic.
Activity
github-actions commentedon May 8, 2026
This issue might be a duplicate of existing issues. Please check:
role=assistantmessages before requests, and explicitly proposes "Strip trailing assistant messages innormalizeMessages()" as a fix (Option A).github-actions commentedon Jul 9, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.