Skip to content

Commit f435049

Browse files
committed
sync
1 parent 1f80de2 commit f435049

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/opencode/src/session/summary.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import z from "zod"
44
import { Session } from "."
55
import { generateText } from "ai"
66
import { MessageV2 } from "./message-v2"
7-
import SUMMARIZE_TURN from "./prompt/summarize-turn.txt"
87
import { Flag } from "@/flag/flag"
98

109
export namespace MessageSummary {
@@ -26,12 +25,17 @@ export namespace MessageSummary {
2625

2726
const result = await generateText({
2827
model: small.language,
28+
maxOutputTokens: 100,
2929
messages: [
3030
{
31-
role: "system",
32-
content: SUMMARIZE_TURN,
31+
role: "user",
32+
content: `
33+
Summarize the following conversation into 2 sentences MAX explaining what happened and why
34+
<conversation>
35+
${JSON.stringify(MessageV2.toModelMessage(messages))}
36+
</conversation>
37+
`,
3338
},
34-
...MessageV2.toModelMessage(messages),
3539
],
3640
})
3741

0 commit comments

Comments
 (0)