mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-06 02:47:56 +00:00
fix: fix type errors - add metadata to ClineMessage, fix getResponseId method name
This commit is contained in:
parent
f988dee5ca
commit
f138361e87
2 changed files with 13 additions and 1 deletions
|
|
@ -279,6 +279,18 @@ export const clineMessageSchema = z.object({
|
|||
isProtected: z.boolean().optional(),
|
||||
apiProtocol: z.union([z.literal("openai"), z.literal("anthropic")]).optional(),
|
||||
isAnswered: z.boolean().optional(),
|
||||
/**
|
||||
* Optional metadata for API request tracking.
|
||||
* Used for background mode status display.
|
||||
*/
|
||||
metadata: z
|
||||
.object({
|
||||
background: z.boolean().optional(),
|
||||
backgroundStatus: z
|
||||
.enum(["queued", "in_progress", "reconnecting", "polling", "completed", "failed", "canceled"])
|
||||
.optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
|
||||
export type ClineMessage = z.infer<typeof clineMessageSchema>
|
||||
|
|
|
|||
|
|
@ -1703,7 +1703,7 @@ describe("OpenAI Native streaming metadata tracking", () => {
|
|||
expect(chunks).toContainEqual({ type: "text", text: "A" })
|
||||
expect(chunks).toContainEqual({ type: "reasoning", text: "B" })
|
||||
expect(handler.getLastSequenceNumber()).toBe(3)
|
||||
expect(handler.getLastResponseId()).toBe("resp_123")
|
||||
expect(handler.getResponseId()).toBe("resp_123")
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue