-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Problem
zUsageUpdate in schema/zod.gen.js defines:
export const zUsageUpdate = z.object({
_meta: z.record(z.string(), z.unknown()).nullish(),
cost: zCost.nullish(),
size: z.number(),
used: z.number(), // <-- does not accept null
});But @zed-industries/claude-agent-acp@0.21.0 sends used: null in session/update notifications (e.g. at the start of a session before any tokens are used).
This causes the client-side notification handler to throw:
Error handling notification {
method: 'session/update',
params: { update: { sessionUpdate: 'usage_update', used: null, size: 200000, cost: {...} } }
} { code: -32602, message: 'Invalid params', data: { _errors: ['Invalid input: expected object, received undefined', ...] } }
Suggested Fix
Change used to accept null/undefined, consistent with other optional fields:
- used: z.number(),
+ used: z.number().nullish(),Environment
@agentclientprotocol/sdk@0.15.0@zed-industries/claude-agent-acp@0.21.0acpx@0.1.16
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels