Skip to content

V2: subagent completion concatenates independent text blocks #53039

Closed

Description

@mlimarenko

Description

V2 removes the boundary between independent text blocks when delivering a subagent's final message to its parent. SubagentCompletion.text joins them with an empty string.

For example, two saved text blocks ending in production is unchanged. and starting with ## Result reach the parent as production is unchanged.## Result. The Markdown heading is already malformed before rendering.

Plugins

Reproduced in a Core test without plugins.

OpenCode version

2.0.22; also present in 2.0.18 and the current v2 branch.

Steps to reproduce

  1. Complete a subagent message with two text parts: The files are unchanged. and ## Result\n\nDone.
  2. Deliver that completion through the foreground subagent tool.
  3. Observe The files are unchanged.## Result in the parent result, rather than two paragraphs.

The proposed fix inserts a blank line between independent nonempty text parts. Single-part content and the empty-result fallback remain unchanged.

Screenshot and/or share link

The regression is reproduced by packages/core/test/tool-subagent.test.ts; no session containing private data is shared.

Operating System

Linux x64.

Terminal

OpenCode Desktop 2.0.22; the defect also reproduces directly in Core.

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