fix(opencode): apply message transforms during compaction (#17823)

This commit is contained in:
DS 2026-03-16 12:32:53 -04:00 committed by GitHub
parent e718db624f
commit 4cb29967f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -200,6 +200,8 @@ When constructing the summary, try to stick to this template:
---`
const promptText = compacting.prompt ?? [defaultPrompt, ...compacting.context].join("\n\n")
const msgs = structuredClone(messages)
await Plugin.trigger("experimental.chat.messages.transform", {}, { messages: msgs })
const result = await processor.process({
user: userMessage,
agent,
@ -208,7 +210,7 @@ When constructing the summary, try to stick to this template:
tools: {},
system: [],
messages: [
...MessageV2.toModelMessages(messages, model, { stripMedia: true }),
...MessageV2.toModelMessages(msgs, model, { stripMedia: true }),
{
role: "user",
content: [