feat: add field to allow user only messages (#4554)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
Spoon 2025-11-21 02:13:42 +01:00 committed by GitHub
parent 3b005d29d7
commit 43c021ed80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -58,6 +58,7 @@ export namespace MessageV2 {
type: z.literal("text"),
text: z.string(),
synthetic: z.boolean().optional(),
ignored: z.boolean().optional(),
time: z
.object({
start: z.number(),
@ -566,7 +567,7 @@ export namespace MessageV2 {
}
result.push(userMessage)
for (const part of msg.parts) {
if (part.type === "text")
if (part.type === "text" && !part.ignored)
userMessage.parts.push({
type: "text",
text: part.text,

View file

@ -150,6 +150,7 @@ export type TextPart = {
type: "text"
text: string
synthetic?: boolean
ignored?: boolean
time?: {
start: number
end?: number
@ -1233,6 +1234,7 @@ export type TextPartInput = {
type: "text"
text: string
synthetic?: boolean
ignored?: boolean
time?: {
start: number
end?: number