PluginProbe
Extendify / trunk
Extendify vtrunk
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
← All changes | src/Agent/workflows/abilities/tools/execute-ability.js +8 -1 3.1.3 → trunk View file →
@@ -41,10 +41,17 @@
41 41 }
42 42
43 43 // Optional inputs the model didn't fill come through as null at any depth —
44 44 // drop them so schema defaults stand in and the ability sees only real values.
45 + const isEmptyEntry = (value) =>
46 + !!value &&
47 + typeof value === 'object' &&
48 + !Array.isArray(value) &&
49 + !Object.keys(value).length;
45 50 const withoutNulls = (value) => {
46 - if (Array.isArray(value)) return value.map(withoutNulls);
51 + // An entry the model left blank still has to satisfy the item schema.
52 + if (Array.isArray(value))
53 + return value.map(withoutNulls).filter((entry) => !isEmptyEntry(entry));
47 54 if (value && typeof value === 'object') {
48 55 return Object.fromEntries(
49 56 Object.entries(value)
50 57 .filter(([, v]) => v != null)