fix(companion): accept view:null in turn schema (rail sends null when no active entity)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-01 22:49:08 +10:00
parent 02efff83ce
commit f8beff8702
2 changed files with 3 additions and 2 deletions

View File

@@ -43,7 +43,8 @@ spacesScopedRouter.get('/', asyncWrap(async (req, res) => {
const turnSchema = z.object({
text: z.string().min(1),
view: z.object({ entityType: z.string(), entityId: z.string() }).partial().optional()
// nullish: the rail sends `view: null` when not on a specific entity.
view: z.object({ entityType: z.string(), entityId: z.string() }).partial().nullish()
});
spacesScopedRouter.post('/turn',