fix: model association page throws Invalid input for channels without endpoints#1746
Conversation
- prevents Zod validation error when backend returns endpoints: null for legacy channels that have no custom endpoints configured Closes looplj#1746
Greptile SummaryAdds
Confidence Score: 5/5Safe to merge — a one-line targeted fix that unblocks the settings page for legacy channels. The change is a minimal, focused schema relaxation that mirrors an identical pattern already used for the No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Backend
participant ZodParser as Zod Parser (channelSummarySchema)
participant Component as React Component
Backend->>ZodParser: "{ endpoints: null } (legacy channel)"
Note over ZodParser: Before: validation error – null not accepted
Note over ZodParser: After: .nullable() accepts null, passes through
ZodParser->>Component: "{ endpoints: null }"
Component->>Component: channel.endpoints ?? [] → []
Component->>Component: channel?.endpoints?.find(...) → undefined
Reviews (1): Last reviewed commit: "fix(frontend): allow null endpoints in c..." | Re-trigger Greptile |
) - prevents Zod validation error when backend returns endpoints: null for legacy channels that have no custom endpoints configured Closes looplj#1746
Summary
Allows
nullforendpointsfield inchannelSummarySchemato fix Zod validation error when backend returnsendpoints: nullfor legacy channels without custom endpoints configured.Background
Where it was introduced
Commit
74d223c6("feat(llm): support responses websocket sessions #1730") added theendpointsfield to theallChannelSummarysGraphQL query. This query returns channel summaries for the model association settings page.What error it caused
When loading the model association page (
/settings/models), the frontend queriesallChannelSummaryswhich includes theendpointsfield. For legacy channels that have no custom endpoint overrides configured, the backend returns:{ "endpoints": null }The Zod schema previously defined:
This doesn't allow
null, causing Zod to throw "Invalid input" for each channel in the list:Solution
Added
.nullable()to the schema:This allows the field to be
null(from backend) while still defaulting to[]for new channels.Testing
endpoints: null