Skip to content

[FEATURE]: Strip trailing role=assistant && content=="" messages before request #26320

Closed as not planned

Description

@gxpisme

Feature hasn't been suggested before.

  • 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

  1. github-actions commented on May 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. github-actions commented on Jul 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions