Skip to content

改进 OpenCode 注入时的 UI 展现 #553

Description

@Snowy117

Feature Description

OpenCode可以通过 experimental.chat.messages.transform,来做到只修改交给 LLM 的提示词,而完全不影响用户在 TUI/Web 中看到的消息。现在的处理方式太粗糙,用户发送的消息会直接被追加提示词,让用户的 UI 界面很杂乱。特别是 revert 消息之后,还需要手动把注入的提示词删去。

另外,该手段同样可以做到只把提示词注入最新的 user 消息。没有必要注入之前的 user 消息——毕竟之前的消息注入的提示词多半已经过时了,单纯是浪费词元和浪费 LLM 的注意力。

该手段不会修改 OpenCode 落盘的消息记录。

Motivation

No response

Alternatives Considered

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions