From 98b90079cd4b2a15bfe3a5ad7803a08cfe88203e Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 26 Dec 2025 09:14:24 +0800 Subject: [PATCH 1/3] * [bug #66284] skip show property which is not in schema on handle ai respose in zentao agent. --- www/js/zui3/ai.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/js/zui3/ai.js b/www/js/zui3/ai.js index f5a84f41e0..2d74b1e0df 100644 --- a/www/js/zui3/ai.js +++ b/www/js/zui3/ai.js @@ -49,7 +49,8 @@ function getPromptFormConfig(fields, extraConfig) if(!Array.isArray(fields) || !fields.length) return; const typeMap = {radio: 'picker', checkbox: 'multiPicker', text: 'input'}; const required = []; - const properties = fields.reduce((properties, field, index) => { + const properties = fields.reduce((properties, field, index) => + { field.code = `field-${field.id}`; properties[field.code] = { type : 'string', @@ -139,6 +140,7 @@ window.executeZentaoPrompt = async function(info, testingMode) if(isChange && originObject) { const renderProp = (prop, value) => { + if(propNames[prop] === undefined) return null; let oldValue = originObject[prop]; if(oldValue === undefined || oldValue === null) oldValue = ''; if(value === undefined || value === null) value = ''; @@ -146,8 +148,8 @@ window.executeZentaoPrompt = async function(info, testingMode) value = typeof value === 'string' ? value : JSON.stringify(value); oldValue = typeof oldValue === 'string' ? oldValue : JSON.stringify(oldValue); const isSame = oldValue === value; - return h` - ${propNames[prop] || prop} + return h` + ${propNames[prop]} ${isSame ? renderValue(value) : (oldValue.length ? h`
` : h`
${value}
`)} `; }; From 601639145feaddff17869a47ba33bf0f4abe61e9 Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 26 Dec 2025 09:46:05 +0800 Subject: [PATCH 2/3] * [misc] add syncCounter to track synchronization attempts and adjust wait time in syncNext method. --- module/zai/js/vectorized.ui.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/zai/js/vectorized.ui.js b/module/zai/js/vectorized.ui.js index aaf085cfc1..656e82c76d 100644 --- a/module/zai/js/vectorized.ui.js +++ b/module/zai/js/vectorized.ui.js @@ -18,6 +18,7 @@ class VectorizedPanel extends zui.Component this.syncingTimer = 0; this.progressBarWidth = 700; this.waitTime = 0; + this.syncCouter = 0; let store = null; if(window !== window.parent) @@ -162,8 +163,12 @@ class VectorizedPanel extends zui.Component async syncNext(data) { + this.syncCouter++; const result = await this.post(['zai', 'ajaxSyncVectorization'], data); - await zui.delay(result.data.lastSync ? (result.data.lastSync.time * 2) : 100); + let waitTime = result.data.lastSync ? (result.data.lastSync.time * 3) : 100; + if(this.syncCouter % 200 === 0) waitTime += 2000; + if(this.syncCouter % 1000 === 0) waitTime += 2000; + await zui.delay(waitTime); return result; } From e7388cc71e77baf9a31a7987ae237d6294c166ee Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 26 Dec 2025 11:45:34 +0800 Subject: [PATCH 3/3] * [misc] adjust knowledge search threshold from 0.7 to 0.5 for improved results in zai control. --- module/zai/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zai/control.php b/module/zai/control.php index 21e239ba89..045c64d301 100644 --- a/module/zai/control.php +++ b/module/zai/control.php @@ -216,7 +216,7 @@ class zai extends control if(empty($userPrompt) || empty($filters)) return $this->send(array('result' => 'failed', 'message' => $this->lang->fail)); - $knowledges = $this->zai->searchKnowledgesInCollections($userPrompt, $filters, $type, $limit, 0.7); + $knowledges = $this->zai->searchKnowledgesInCollections($userPrompt, $filters, $type, $limit, 0.5); $results = []; foreach($knowledges as $knowledge) {