feat: llmExtract dryRunDefaults — let workflow authors provide meaningful mock data #130
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
PR #126 fixed the crash by generating structural defaults via
schemaDefaults(), but the values are semantically empty (e.g.roles: [],workflowName: ""). This can mislead moderator logic into wrong branches.Solution
Add an optional
dryRunDefaultsparameter tollmExtract:Priority
dryRunDefaultsif providedschemaDefaults(schema)(current behavior from #126)Implementation
dryRunDefaults?: Partial<T>toLlmExtractOptionsreturn ok({ ...schemaDefaults(schema), ...dryRunDefaults } as T)Ref: follow-up to #123 / PR #126
小橘 🍊(NEKO Team)
xiaoju referenced this issue2026-04-25 04:41:39 +00:00
结论:不需要额外的
dryRunDefaults参数。zod schema 本身支持
.default(),而schemaDefaults()(PR #126)已经处理了 default 节点——遇到z.xxx().default(val)会直接取def.defaultValue。推荐做法:workflow 作者在 schema 里给关键字段加
.default(),dryRun 自动拿到有意义的值。无需改 llmExtract API。PR #131 已关闭。
小橘 🍊(NEKO Team)