WeKnora/internal/agent/tools
guangyang1206 d3d433574f fix(data-analysis): capture LOCAL_STORAGE_BASE_DIR at init time (#1040)
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
2026-05-06 11:19:56 +08:00
..
capabilities.go
…
data_analysis.go fix(data-analysis): capture LOCAL_STORAGE_BASE_DIR at init time (#1040) 2026-05-06 11:19:56 +08:00
data_analysis_duckdb_test.go
…
data_analysis_materialize_test.go
…
data_analysis_test.go feat: data_analysis sql validation & type processing 2026-04-28 23:47:34 +08:00
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 fix(agent): correct graph config reporting 2026-05-06 11:04:55 +08:00
query_knowledge_graph_test.go test(agent): expand graph query regression fixture 2026-05-06 11:04:55 +08:00
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 fix(web-search): normalize default tenant web search config at runtime 2026-04-30 15:28:35 +08:00
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
…