Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
fc5b607
perf: system prompt double-generating
wangliang181230 Mar 23, 2026
ec3d5fa
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 24, 2026
b09d0ca
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 25, 2026
134ed9a
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 25, 2026
75f239d
fix: Fix some minor problem
wangliang181230 Mar 25, 2026
b9a02b1
fix
wangliang181230 Mar 25, 2026
27fc513
小调整。
wangliang181230 Mar 25, 2026
afacd7f
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 26, 2026
46218ef
文件处理,使用 with ... as file 语法,避免文件未关闭。
wangliang181230 Mar 26, 2026
2e8dced
修正错误字符串
wangliang181230 Mar 26, 2026
b3e7b65
fix bugs: invalid regex escape sequences, and resource leaks
wangliang181230 Mar 26, 2026
078bda5
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 26, 2026
ad2aff2
fix bugs: invalid regex escape sequences, and resource leaks
wangliang181230 Mar 26, 2026
fbbdb70
撤回对正则的修正。
wangliang181230 Mar 26, 2026
1a72ba2
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 27, 2026
66ccc3a
operation
wangliang181230 Mar 27, 2026
8b94350
小调整
wangliang181230 Mar 27, 2026
418ac71
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 27, 2026
d4527de
小调整
wangliang181230 Mar 27, 2026
2817aee
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 27, 2026
2feaa9a
小调整
wangliang181230 Mar 27, 2026
5ae0a84
revert
wangliang181230 Mar 27, 2026
6383670
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Mar 30, 2026
4761094
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 2, 2026
a17aee7
revert
wangliang181230 Apr 2, 2026
9cb6364
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 14, 2026
5b842e5
小调整。
wangliang181230 Apr 14, 2026
12b0b93
小调整。
wangliang181230 Apr 14, 2026
c93c8cb
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 15, 2026
5679f6b
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 15, 2026
3ff563f
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 16, 2026
1d6ddee
小调整.
wangliang181230 Apr 16, 2026
314dfa1
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 16, 2026
1097cb0
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 16, 2026
5619117
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 16, 2026
8038ca3
revert
wangliang181230 Apr 16, 2026
915d03e
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 Apr 22, 2026
b857412
fix: Fix `not_contain` compare
wangliang181230 Apr 22, 2026
8de2060
fix style
wangliang181230 Apr 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ def execute(self, message_list: List[BaseMessage],
mcp_output_enable=True,
**kwargs):
chat_model = get_model_instance_by_model_workspace_id(model_id, workspace_id,
**(
model_params_setting or {})) if model_id is not None else None
**(model_params_setting or {})) if model_id is not None else None
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix style

if stream:
return self.execute_stream(message_list, chat_id, problem_text, post_response_handler, chat_model,
paragraph_list,
Expand Down
2 changes: 1 addition & 1 deletion apps/application/flow/compare/not_contain_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def support(self, node_id, fields: List[str], source_value, compare, target_valu
def compare(self, source_value, compare, target_value):
if isinstance(source_value, str):
return str(target_value) not in source_value
elif isinstance(self, list):
elif isinstance(source_value, list):
return not any([str(item) == str(target_value) for item in source_value])
else:
return str(target_value) not in str(source_value)
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def reset_application_node_dict(application_node_dict, runtime_node_id, node_dat
'${value}', content)
application_node['content'] = res.replace('${value}', value)
except Exception as e:
pass
maxkb_logger.warning(f'reset_application_node_dict error: {e}', exc_info=True)


class BaseApplicationNode(IApplicationNode):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def convert_value(name: str, value, _type, is_required, source, node):
if _type == 'int':
return int(value)
if _type == 'boolean':
value = 0 if ['0', '[]'].__contains__(value) else value
if isinstance(value, str) and value.lower() in ('false', '0', '[]', ''):
return False
return bool(value)
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修复当 value 为字符串的 falsebool(value) 返回了 True 的问题。
注:后面多处代码相同处理。

if _type == 'float':
return float(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def convert_value(name: str, value, _type, is_required, source, node):
if _type == 'int':
return int(value)
if _type == 'boolean':
value = 0 if ['0', '[]'].__contains__(value) else value
if isinstance(value, str) and value.lower() in ('false', '0', '[]', ''):
return False
return bool(value)
if _type == 'float':
return float(value)
Expand Down
14 changes: 11 additions & 3 deletions apps/common/handle/impl/text/pdf_split_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ def handle(self, file, pattern_list: List, with_filter: bool, limit: int, get_bu
# 获取临时文件的路径
temp_file_path = temp_file.name

pdf_document = fitz.open(temp_file_path)
pdf_document = None
try:
pdf_document = fitz.open(temp_file_path)
if type(limit) is str:
limit = int(limit)
if type(with_filter) is str:
Expand Down Expand Up @@ -79,7 +80,8 @@ def handle(self, file, pattern_list: List, with_filter: bool, limit: int, get_bu
'content': []
}
finally:
pdf_document.close()
if pdf_document is not None:
pdf_document.close()
# 处理完后可以删除临时文件
os.remove(temp_file_path)

Expand Down Expand Up @@ -331,9 +333,15 @@ def get_content(self, file, save_image):
# 获取临时文件的路径
temp_file_path = temp_file.name

pdf_document = fitz.open(temp_file_path)
pdf_document = None
try:
pdf_document = fitz.open(temp_file_path)
return self.handle_pdf_content(file, pdf_document)
except BaseException as e:
traceback.print_exception(e)
return f'{e}'
finally:
if pdf_document is not None:
pdf_document.close()
# 处理完后可以删除临时文件
os.remove(temp_file_path)
2 changes: 1 addition & 1 deletion apps/common/utils/tool_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def init_sandbox_dir():
local_ip = socket.gethostbyname(hostname)
banned_hosts = f"{banned_hosts},{local_ip}"
banned_hosts = ",".join(s.strip() for s in banned_hosts.split(",") if s.strip() and s.strip().lower() != hostname.lower())
with open(sandbox_conf_file_path, "w") as f:
with open(sandbox_conf_file_path, "w", encoding='utf-8') as f:
f.write(f"SANDBOX_PYTHON_BANNED_HOSTS={banned_hosts}\n")
f.write(f"SANDBOX_PYTHON_ALLOW_DL_PATHS={','.join(sorted(set(filter(None, sys.path + _sandbox_python_sys_path + allow_dl_paths.split(',')))))}\n")
f.write(f"SANDBOX_PYTHON_ALLOW_DL_OPEN={allow_dl_open}\n")
Expand Down
1 change: 0 additions & 1 deletion apps/knowledge/views/paragraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def get(self, request: Request, workspace_id: str, knowledge_id: str, document_i
@log(
menu='Paragraph', operate='Create Paragraph',
get_operation_object=lambda r, keywords: get_knowledge_document_operation_object(
get_knowledge_operation_object(keywords.get('knowledge_id')),
get_knowledge_operation_object(keywords.get('knowledge_id')),
get_document_operation_object(keywords.get('document_id'))
),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_knowledge_document_operation_object 方法只有两个参数,这里多传了一个。

感觉应该是不小心多复制了一行代码的感觉。

Expand Down
3 changes: 2 additions & 1 deletion apps/tools/serializers/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ def convert_value(name: str, value: str, _type: str, is_required: bool):
if _type == 'int':
return int(value)
if _type == 'boolean':
value = 0 if ['0', '[]'].__contains__(value) else value
if isinstance(value, str) and value.lower() in ('false', '0', '[]', ''):
return False
return bool(value)
if _type == 'float':
return float(value)
Expand Down
2 changes: 2 additions & 0 deletions apps/trigger/handler/impl/task/application_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def valid_value_type(value, _type):
return isinstance(value, int)
if _type == 'boolean':
return isinstance(value, bool)
if _type == 'any':
return True
return isinstance(value, str)


Expand Down
3 changes: 2 additions & 1 deletion apps/trigger/handler/impl/task/tool_task/base_tool_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def _convert_value(_type, value):
if _type == 'int':
return int(value)
if _type == 'boolean':
value = 0 if ['0', '[]'].__contains__(value) else value
if isinstance(value, str) and value.lower() in ('false', '0', '[]', ''):
return False
return bool(value)
if _type == 'float':
return float(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def _convert_value(_type, value):
if _type == 'int':
return int(value)
if _type == 'boolean':
value = 0 if ['0', '[]'].__contains__(value) else value
if isinstance(value, str) and value.lower() in ('false', '0', '[]', ''):
return False
return bool(value)
if _type == 'float':
return float(value)
Expand Down
4 changes: 2 additions & 2 deletions apps/trigger/handler/impl/trigger/scheduled_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ def execute(trigger, **kwargs):
if source_type == "APPLICATION":
from trigger.handler.impl.task.application_task import ApplicationTask

ApplicationTask.execute(trigger_task, **kwargs)
ApplicationTask().execute(trigger_task, **kwargs)
elif source_type == "TOOL":
from trigger.handler.impl.task.tool_task import ToolTask

ToolTask.execute(trigger_task, **kwargs)
ToolTask().execute(trigger_task, **kwargs)
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApplicationTaskToolTask 是 class,必须先实例化才能调用方法

else:
maxkb_logger.warning(f"unsupported source_type={source_type}, task_id={trigger_task['id']}")

Expand Down
3 changes: 2 additions & 1 deletion apps/trigger/handler/simple_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ def undeploy(trigger, **kwargs):
@return:
"""
for simple_trigger_handler in simple_trigger_handlers:
return simple_trigger_handler.undeploy(trigger, **kwargs)
if simple_trigger_handler.support(trigger, **kwargs):
return simple_trigger_handler.undeploy(trigger, **kwargs)
raise Exception("不支持的触发器类型")
1 change: 0 additions & 1 deletion ui/src/workflow/common/NodeSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ const handleSearch = (kw: string) => {
}
}
const reSearch = () => {
console.log('ss')
handleSearch(searchText.value)
}
// 生命周期
Expand Down
Loading