Skip to content

Clarify plugin guidance for experimental.chat.system.transform to avoid extra system messages #23660

@zhangdw156

Description

@zhangdw156

Description

A lot of memory/context plugins use experimental.chat.system.transform by doing output.system.push(...) for recalled context or status blocks.

That is a natural reading of the current hook type, but it can make those plugins incompatible with many model backends that only accept a single system message at the start of the conversation, especially vLLM-served Qwen models and similar OpenAI-compatible deployments.

The hook itself is useful and does not need a behavior change here. What seems to be missing is guidance for plugin authors: if they are adding supplemental prompt/context, they should usually merge it into the primary system block instead of pushing a new array entry.

Plugins

Memory and context injection plugins using experimental.chat.system.transform

OpenCode version

Current dev branch as of 2026-04-21

Steps to reproduce

  1. Implement a plugin that injects recalled context with output.system.push(...) inside experimental.chat.system.transform
  2. Use that plugin with an OpenAI-compatible backend that only allows a single system message
  3. Send a request
  4. The backend rejects the request because multiple system messages were produced

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions