Skip to content

Commit 43c021e

Browse files
spoons-and-mirrorsactions-useropencode-agent[bot]rekram1-node
authored
feat: add field to allow user only messages (anomalyco#4554)
Co-authored-by: GitHub Action <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <[email protected]>
1 parent 3b005d2 commit 43c021e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/opencode/src/session/message-v2.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export namespace MessageV2 {
5858
type: z.literal("text"),
5959
text: z.string(),
6060
synthetic: z.boolean().optional(),
61+
ignored: z.boolean().optional(),
6162
time: z
6263
.object({
6364
start: z.number(),
@@ -566,7 +567,7 @@ export namespace MessageV2 {
566567
}
567568
result.push(userMessage)
568569
for (const part of msg.parts) {
569-
if (part.type === "text")
570+
if (part.type === "text" && !part.ignored)
570571
userMessage.parts.push({
571572
type: "text",
572573
text: part.text,

packages/sdk/js/src/gen/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export type TextPart = {
150150
type: "text"
151151
text: string
152152
synthetic?: boolean
153+
ignored?: boolean
153154
time?: {
154155
start: number
155156
end?: number
@@ -1233,6 +1234,7 @@ export type TextPartInput = {
12331234
type: "text"
12341235
text: string
12351236
synthetic?: boolean
1237+
ignored?: boolean
12361238
time?: {
12371239
start: number
12381240
end?: number

0 commit comments

Comments
 (0)