Skip to content

task: append environment details into existing blocks #11200

@hannesrudolph

Description

@hannesrudolph

Problem

Task messages currently append <environment_details> as a standalone trailing text block. Some interleaved-thinking models are sensitive to message content “shape” and can fail when an extra trailing block is introduced.

Desired behavior

Append <environment_details> into the final existing user text block (or tool result block) rather than adding a new standalone block.

Acceptance criteria

  • If the last user content item is a text block, append <environment_details> to that block.
  • If the last item is a tool result, append <environment_details> to that tool result text.
  • If there is no suitable final block (empty content), create a single text block containing <environment_details>.
  • Preserve existing non-text blocks (e.g. images) and keep original content immutable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions