resolveFileServiceForKnowledge was reading os.Getenv("LOCAL_STORAGE_BASE_DIR")
on every request. This causes a mismatch when the variable is not in the
process environment at request time (e.g. it was set programmatically before
app startup but not exported, or the DI-constructed fileService uses a
different configured path).
Fix: store the value in a new localBaseDir field at NewDataAnalysisTool
construction time — the same moment the DI container assembles the local
FileService — and use t.localBaseDir in resolveFileServiceForKnowledge
instead. This guarantees the data-analysis tool always resolves files
under the same base directory that the local FileService was configured
with, eliminating the "path not found" errors when LOCAL storage is used
for a knowledge base while the global storage backend is minio/oss/cos.
Fixes #1040
|
||
|---|---|---|
| .. | ||
| capabilities.go | ||
| data_analysis.go | ||
| data_analysis_duckdb_test.go | ||
| data_analysis_materialize_test.go | ||
| data_analysis_test.go | ||
| data_schema.go | ||
| database_query.go | ||
| definitions.go | ||
| final_answer.go | ||
| final_answer_test.go | ||
| get_document_info.go | ||
| grep_chunks.go | ||
| json_repair.go | ||
| json_repair_test.go | ||
| knowledge_search.go | ||
| list_knowledge_chunks.go | ||
| mcp_tool.go | ||
| mcp_tool_image_test.go | ||
| mcp_tool_test.go | ||
| normalize_id.go | ||
| normalize_id_test.go | ||
| param_cast.go | ||
| param_cast_test.go | ||
| param_validate.go | ||
| param_validate_test.go | ||
| query_knowledge_graph.go | ||
| query_knowledge_graph_test.go | ||
| registry.go | ||
| sanitize_messages.go | ||
| sanitize_messages_test.go | ||
| sequentialthinking.go | ||
| skill_execute.go | ||
| skill_read.go | ||
| strip_think.go | ||
| strip_think_test.go | ||
| todo_write.go | ||
| tool.go | ||
| truncate.go | ||
| truncate_test.go | ||
| web_fetch.go | ||
| web_search.go | ||
| wiki_delete_page.go | ||
| wiki_flag_issue.go | ||
| wiki_read_issue.go | ||
| wiki_read_source_doc.go | ||
| wiki_rename_page.go | ||
| wiki_replace_text.go | ||
| wiki_tools.go | ||
| wiki_tools_test.go | ||
| wiki_update_issue.go | ||
| wiki_write_page.go | ||