Skip to content

An open-source, faster Devin alternative

TypeScript

fix(web): session `head` is a string in /v3 — coerce to number

Igor Zalutski77538728fb1d
diff --git a/web/src/api/schemas.ts b/web/src/api/schemas.ts
index 8d1c46d4..bacf9beb 100644
--- a/web/src/api/schemas.ts
+++ b/web/src/api/schemas.ts
@@ -266,7 +266,7 @@ export const SessionSchema = z.object({
status: z.string(),
agent_id: z.string().nullable().optional(),
credential_id: z.string().nullable().optional(),
- head: z.number().optional(), // current event seq (the API calls it `head`)
+ head: z.coerce.number().optional(), // current event seq; API returns it as a string ("0")
last_turn: record.nullish(),
usage: record.nullish(),
limits: record.nullish(),