-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
相关组件
后端服务及API
Bug 描述
mcp配置正常,但当问答中调用时,未能返回正确答案,后台显示调用报错
使用chatbox等LLM对话工具调用同一mcp时能正常调用 & 返回
期望行为
追踪原因,修复问题
相关日志
WeKnora-app | INFO [2026-01-08 01:06:59.701] [request_id=jROO8fFEQWiG] session.go:190[UpdateSession] | Session updated successfully, ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.701] [request_id=jROO8fFEQWiG] qa.go:348[AgentQA] | Session configuration updated successfully for session: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.701] [request_id=jROO8fFEQWiG] message.go:42[CreateMessage] | Start creating message
WeKnora-app | INFO [2026-01-08 01:06:59.701] [request_id=jROO8fFEQWiG] message.go:43[CreateMessage] | Creating message for session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.701] [request_id=jROO8fFEQWiG] message.go:47[CreateMessage] | Checking if session exists, tenant ID: 10000, session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.702] [request_id=jROO8fFEQWiG] message.go:55[CreateMessage] | Session exists, creating message
WeKnora-app | INFO [2026-01-08 01:06:59.703] [request_id=jROO8fFEQWiG] message.go:64[CreateMessage] | Message created successfully, ID: c9c96dab-1a4a-4305-94e4-75737cd5fc63
WeKnora-app | INFO [2026-01-08 01:06:59.703] [request_id=jROO8fFEQWiG] message.go:42[CreateMessage] | Start creating message
WeKnora-app | INFO [2026-01-08 01:06:59.703] [request_id=jROO8fFEQWiG] message.go:43[CreateMessage] | Creating message for session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.703] [request_id=jROO8fFEQWiG] message.go:47[CreateMessage] | Checking if session exists, tenant ID: 10000, session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.704] [request_id=jROO8fFEQWiG] message.go:55[CreateMessage] | Session exists, creating message
WeKnora-app | INFO [2026-01-08 01:06:59.705] [request_id=jROO8fFEQWiG] message.go:64[CreateMessage] | Message created successfully, ID: 8fde2c80-5230-4bd1-8605-55ed7002e1ec
WeKnora-app | INFO [2026-01-08 01:06:59.705] [request_id=jROO8fFEQWiG] qa.go:431[AgentQA] | Calling agent QA service, session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.706] [request_id=jROO8fFEQWiG] qa.go:444[AgentQA] | Session has no title, starting async title generation, session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.706] [request_id=jROO8fFEQWiG] | Starting pull-based SSE streaming for session=267b78e2-ad87-447e-bdf2-2f76206c1e12, message=8fde2c80-5230-4bd1-8605-55ed7002e1ec
WeKnora-app | INFO [2026-01-08 01:06:59.706] [request_id=jROO8fFEQWiG] session.go:979[AgentQA] | Start agent-based question answering, session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12, tenant ID: 10000, query: 皮肤灰白,有皮屑,可能有什么样的疾病,并帮我搜索相似病例。, session: {"id":"267b78e2-ad87-447e-bdf2-2f76206c1e12","title":"","description":"","tenant_id":10000,"knowledge_base_id":"","max_rounds":5,"enable_rewrite":true,"fallback_strategy":"model","fallback_response":"抱歉,我无法回答这个问题。","embedding_top_k":10,"keyword_threshold":0.3,"vector_threshold":0.5,"rerank_model_id":"fcccb054-1b93-48ae-a241-b9b6329c63b3","rerank_top_k":5,"rerank_threshold":0.5,"summary_model_id":"74b4f28d-adde-495c-88b8-0d325d58e39a","summary_parameters":{"max_tokens":0,"repeat_penalty":1,"top_k":0,"top_p":0,"frequency_penalty":0,"presence_penalty":0,"prompt":"你是一个专业的智能信息检索助手,名为WeKnora。你犹如专业的高级秘书,依据检索到的信息回答用户问题,不能利用任何先验知识。\n当用户提出问题时,助手会基于特定的信息进行解答。助手首先在心中思考推理过程,然后向用户提供答案。\n","context_template":"## 回答问题规则\n- 仅根据检索到的信息中的事实进行回复,不得运用任何先验知识,保持回应的客观性和准确性。\n- 复杂问题和答案的按Markdown分结构展示,总述部分不需要拆分\n- 如果是比较简单的答案,不需要把最终答案拆分的过于细碎\n- 结果中使用的图片地址必须来自于检索到的信息,不得虚构\n- 检查结果中的文字和图片是否来自于检索到的信息,如果扩展了不在检索到的信息中的内容,必须进行修改,直到得到最终答案\n- 如果用户问题无法回答,必须如实告知用户,并给出合理的建议。\n\n## 输出限制\n- 以Markdown图文格式输出你的最终结果\n- 输出内容要保证简短且全面,条理清晰,信息明确,不重复。\n\n## 当前时间是:\n{{.CurrentTime}} {{.CurrentWeek}}\n\n## 检索到的信息如下:\n------BEGIN------\n{{range .Contexts}}\n{{.}}\n{{end}}\n------END------\n\n## 用户当前的问题是:\n{{.Query}}\n","no_match_prefix":"\u003cthink\u003e\n\u003c/think\u003e\nNO_MATCH","temperature":0.3,"seed":0,"max_completion_tokens":2048},"agent_config":{"agent_mode_enabled":true,"web_search_enabled":false,"knowledge_bases":[],"knowledge_ids":[]},"context_config":{"max_tokens":0,"compression_strategy":"","recent_message_count":0,"summarize_threshold":0},"created_at":"2026-01-08T01:06:07.291189+08:00","updated_at":"2026-01-08T01:06:59.693124463+08:00","deleted_at":null}
WeKnora-app | INFO [2026-01-08 01:06:59.706] [request_id=jROO8fFEQWiG] session.go:1032[AgentQA] | Merged agent config from tenant 10000 and session 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.706] [request_id=jROO8fFEQWiG] session.go:1050[AgentQA] | No knowledge bases specified for agent, running in pure agent mode
WeKnora-app | INFO [2026-01-08 01:06:59.706] [request_id=jROO8fFEQWiG] session.go:798[buildSearchTargets] | Built 0 search targets: 0 full KB, 0 partial KB
WeKnora-app | INFO [2026-01-08 01:06:59.706] [request_id=jROO8fFEQWiG] session.go:1068[AgentQA] | Agent search targets built: 0 targets
WeKnora-app | INFO [2026-01-08 01:06:59.707] [] model.go:328[GetChatModel] | Getting chat model: deepseek-chat, source: remote
WeKnora-app | INFO [2026-01-08 01:06:59.707] [request_id=jROO8fFEQWiG] model.go:328[GetChatModel] | Getting chat model: deepseek-chat, source: remote
WeKnora-app | INFO [2026-01-08 01:06:59.708] [request_id=jROO8fFEQWiG] model.go:122[GetModelByID] | Model found, name: BAAI/bge-reranker-v2-m3, status: active
WeKnora-app | INFO [2026-01-08 01:06:59.708] [request_id=jROO8fFEQWiG] model.go:126[GetModelByID] | Model is active and ready to use
WeKnora-app | INFO [2026-01-08 01:06:59.708] [request_id=jROO8fFEQWiG] model.go:280[GetRerankModel] | Getting rerank model: BAAI/bge-reranker-v2-m3, source: remote
WeKnora-app | INFO [2026-01-08 01:06:59.708] [request_id=jROO8fFEQWiG] model.go:298[GetRerankModel] | Rerank model initialized successfully
WeKnora-app | INFO [2026-01-08 01:06:59.708] [request_id=jROO8fFEQWiG] session.go:1161[getContextManagerForSession] | Using session-specific context config for session 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:06:59.708] [request_id=jROO8fFEQWiG] context_manager.go:107[GetContext] | [ContextManager][Session-267b78e2-ad87-447e-bdf2-2f76206c1e12] Getting context
WeKnora-app | DEBUG[2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] redis_storage.go:81[Load] | [RedisStorage][Session-267b78e2-ad87-447e-bdf2-2f76206c1e12] No context found in Redis
WeKnora-app | INFO [2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] context_manager.go:119[GetContext] | [ContextManager][Session-267b78e2-ad87-447e-bdf2-2f76206c1e12] Retrieved 0 messages (~0 tokens)
WeKnora-app | DEBUG[2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] context_manager.go:127[GetContext] | [ContextManager][Session-267b78e2-ad87-447e-bdf2-2f76206c1e12] Message distribution: map[]
WeKnora-app | DEBUG[2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] redis_storage.go:81[Load] | [RedisStorage][Session-267b78e2-ad87-447e-bdf2-2f76206c1e12] No context found in Redis
WeKnora-app | DEBUG[2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] context_manager.go:164[GetContextStats] | [ContextManager][Session-267b78e2-ad87-447e-bdf2-2f76206c1e12] Context stats: 0 messages, ~0 tokens
WeKnora-app | INFO [2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] session.go:1193[getContextForSession] | LLM context stats for session 267b78e2-ad87-447e-bdf2-2f76206c1e12: messages=0, tokens=~0, compressed=false
WeKnora-app | INFO [2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] session.go:1108[AgentQA] | Loaded 0 messages from LLM context manager
WeKnora-app | INFO [2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] session.go:1111[AgentQA] | Creating agent engine
WeKnora-app | INFO [2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] agent_service.go:75[CreateAgentEngine] | Creating agent engine with custom EventBus
WeKnora-app | INFO [2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] agent_service.go:209[registerTools] | Pure Agent Mode: Knowledge base tools disabled due to empty configuration
WeKnora-app | INFO [2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] agent_service.go:223[registerTools] | Registering tools: [thinking], tenant ID: 10000, webSearchEnabled: false
WeKnora-app | INFO [2026-01-08 01:06:59.709] [request_id=jROO8fFEQWiG] agent_service.go:286[registerTools] | Registered 1 tools
WeKnora-app | INFO [2026-01-08 01:07:00.003] [request_id=jROO8fFEQWiG] | Registered MCP tool: mcp.. from service: 中国临床案例成果数据库
WeKnora-app | INFO [2026-01-08 01:07:00.003] [request_id=jROO8fFEQWiG] agent_service.go:122[CreateAgentEngine] | Registered MCP tools from 1 enabled services
WeKnora-app | INFO [2026-01-08 01:07:00.003] [request_id=jROO8fFEQWiG] session.go:1129[AgentQA] | Executing agent with streaming
WeKnora-app | INFO [2026-01-08 01:07:00.003] [request_id=jROO8fFEQWiG] engine.go:82[Execute] | ========== Agent Execution Started ==========
WeKnora-app | INFO [2026-01-08 01:07:00.003] [request_id=jROO8fFEQWiG] engine.go:83[Execute] | [Agent] SessionID: 267b78e2-ad87-447e-bdf2-2f76206c1e12, MessageID: 8fde2c80-5230-4bd1-8605-55ed7002e1ec
WeKnora-app | INFO [2026-01-08 01:07:00.004] [request_id=jROO8fFEQWiG] engine.go:84[Execute] | [Agent] User Query: 皮肤灰白,有皮屑,可能有什么样的疾病,并帮我搜索相似病例。
WeKnora-app | INFO [2026-01-08 01:07:00.004] [request_id=jROO8fFEQWiG] engine.go:85[Execute] | [Agent] LLM Context Messages: 0
WeKnora-app | INFO [2026-01-08 01:07:00.004] [request_id=jROO8fFEQWiG] | [PIPELINE] stage=Agent action=execute_start context_msgs=0 message_id="8fde2c80-5230-4bd1-8605-55ed7002e1ec" query="皮肤灰白,有皮屑,可能有什么样的疾病,并帮我搜索相似病例。" session_id="267b78e2-ad87-447e-bdf2-2f76206c1e12"
WeKnora-app | DEBUG[2026-01-08 01:07:00.004] [request_id=jROO8fFEQWiG] engine.go:108[Execute] | [Agent] SystemPrompt Length: 5987 characters
WeKnora-app | DEBUG[2026-01-08 01:07:00.004] [request_id=jROO8fFEQWiG] engine.go:109[Execute] | [Agent] SystemPrompt (stream)
WeKnora-app | ----
WeKnora-app | ### Role
WeKnora-app | You are WeKnora, a meticulous retrieval assistant powered by Progressive Agentic RAG. You operate in a strictly isolated, **Closed-Loop Knowledge Environment** (No Internet). You are defined by your "Deep Reading" philosophy: you never trust a snippet alone; you always verify the full context.
WeKnora-app |
WeKnora-app | ### Mission
WeKnora-app | To provide answers that are not only accurate but contextually complete. You achieve this by following a strict **"Locate-then-Read"** protocol: finding documents via search, then reading their full content before synthesizing an answer.
WeKnora-app |
WeKnora-app | ### Critical Constraints (ABSOLUTE RULES)
WeKnora-app | 1. **No Snippet-Only Answers:** You are FORBIDDEN from answering based solely on the short text snippets returned by grep_chunks or knowledge_search.
WeKnora-app | 2. **Mandatory Deep Reading:** Whenever a search tool returns relevant knowledge_ids, you MUST use list_knowledge_chunks to read the actual content of those chunks/documents before using them as evidence.
WeKnora-app | 3. **No Internet:** You are strictly confined to internal Knowledge Bases.
WeKnora-app | 4. **Evidence Verification:** If the full text read via list_knowledge_chunks contradicts the search snippet or shows the info is irrelevant, you must discard it and search again.
WeKnora-app |
WeKnora-app | ### Workflow: The "Locate-Read-Plan-Execute" Cycle
WeKnora-app |
WeKnora-app | You must follow this **Specific Operational Sequence** for every user query:
WeKnora-app |
WeKnora-app | #### Phase 1: Preliminary Reconnaissance & Context Verification
WeKnora-app | Before answering or creating a plan, you MUST perform an initial "Test & Read" loop.
WeKnora-app | 1. **Locate:** Execute grep_chunks (keyword) and knowledge_search (semantic) to find potential documents.
WeKnora-app | 2. **READ (Mandatory):** Identify the most relevant knowledge_ids from step 1 (you can select multiple, e.g., top 3-5). **IMMEDIATELY call list_knowledge_chunks** on these IDs to retrieve their full content.
WeKnora-app | 3. **Analyze:** In your think block, evaluate the *full text* you just read. Does it cover the user's intent?
WeKnora-app | * *Decision:* If this full text is sufficient → Go to **Answer Generation**.
WeKnora-app | * *Decision:* If complex/incomplete → Go to **Phase 2**.
WeKnora-app |
WeKnora-app | #### Phase 2: Strategic Decision & Planning
WeKnora-app | If Phase 1 is insufficient, create a todo_write Work Plan.
WeKnora-app | * **Plan Structure:** Break the problem into distinct retrieval tasks.
WeKnora-app | * **Context Awareness:** Use the full text read in Phase 1 to inform your plan (e.g., "Doc A mentions Protocol X, I need to create a task to specifically search for Protocol X details").
WeKnora-app |
WeKnora-app | #### Phase 3: Disciplined Execution with Deep Reading
WeKnora-app | Execute tasks in todo_write sequentially. For **EACH** task:
WeKnora-app | 1. **Search:** Perform grep_chunks or knowledge_search specific to the sub-task.
WeKnora-app | 2. **READ (Mandatory):**
WeKnora-app | * Extract the knowledge_ids of the most promising results.
WeKnora-app | * **Call list_knowledge_chunks** to fetch the content for these IDs. **Do not skip this step.**
WeKnora-app | * *Note:* You are encouraged to check multiple files if the answer might be spread across them.
WeKnora-app | 3. **Reflect (Deep Reflection):**
WeKnora-app | * "Based on the *full text* I just read, is this sub-task resolved?"
WeKnora-app | * If no, formulate a remedial search action immediately.
WeKnora-app | * Only mark as "completed" when the full text evidence is secured.
WeKnora-app |
WeKnora-app | #### Phase 4: Final Synthesis
WeKnora-app | * Synthesize findings based **only** on the content read via list_knowledge_chunks.
WeKnora-app | * Generate the final response with citations.
WeKnora-app |
WeKnora-app | ### Core Retrieval Strategy (The "Locate-then-Read" Pattern)
WeKnora-app | For every information seeking step, strictly follow this 3-step atomic unit:
WeKnora-app |
WeKnora-app | 1. **Step A: Locate (Search)**
WeKnora-app | * Use grep_chunks for specific entities (Error codes, product names).
WeKnora-app | * Use knowledge_search for concepts.
WeKnora-app | * *Goal:* Get a list of candidate knowledge_ids.
WeKnora-app |
WeKnora-app | 2. **Step B: Read (Fetch Context)**
WeKnora-app | * **Action:** Call list_knowledge_chunks(knowledge_ids=[id1, id2, ...]).
WeKnora-app | * *Rule:* Always fetch the content. Snippets are often truncated or lack necessary context (like prerequisites or exceptions).
WeKnora-app | * *Scope:* It is acceptable and encouraged to fetch 3-5 distinct documents to ensure comprehensive coverage.
WeKnora-app |
WeKnora-app | 3. **Step C: Evaluate (Filter)**
WeKnora-app | * Read the output of list_knowledge_chunks.
WeKnora-app | * Discard irrelevant documents.
WeKnora-app | * Extract facts from valid documents to build your answer.
WeKnora-app |
WeKnora-app | ### Tool Selection Guidelines
WeKnora-app | * **grep_chunks / knowledge_search:** Used ONLY as "Pointers" or "Index Lookups". They tell you *where* to look, not *what* the answer is.
WeKnora-app | * **list_knowledge_chunks:** Your "Eyes". MUST be used after every search. Use to read what the information is.
WeKnora-app | * **todo_write:** Use for managing multi-step research.
WeKnora-app | * **think:** Your "Conscience". Use to plan and relect the content returned by list_knowledge_chunks.
WeKnora-app |
WeKnora-app | ### Final Output Standards
WeKnora-app | 1. **Context-Backed:** Your answer must reflect the nuance found in the full text (e.g., conditions, warnings, detailed steps) which might be missing from search snippets.
WeKnora-app | 2. **Sourced(Inline, Proximate Citations):** All factual statements must include a citation immediately after the relevant claim—within the same sentence or paragraph where the fact appears: <kb doc="..." chunk_id="..." />.
WeKnora-app | Citations may not be placed at the end of the answer. They must always be inserted inline, at the exact location where the referenced information is used ("proximate citation rule").
WeKnora-app | 3. **Honest:** If the full text reveals the search hit was a false positive, admit it and search again.
WeKnora-app | 4. **Rich Media (Markdown with Images):** When retrieved chunks contain images (indicated by the "images" field with URLs), you MUST include them in your response using standard Markdown image syntax: . Place images at contextually appropriate positions within the answer to create a well-formatted, visually rich response. Images help users better understand the content, especially for diagrams, charts, screenshots, or visual explanations.
WeKnora-app |
WeKnora-app | ### System Status
WeKnora-app | Current Time: 2026-01-08T01:07:00+08:00
WeKnora-app |
WeKnora-app | ### User Selected Knowledge Bases (via @ mention)
WeKnora-app | None
WeKnora-app |
WeKnora-app | ----
WeKnora-app | INFO [2026-01-08 01:07:00.004] [request_id=jROO8fFEQWiG] engine.go:113[Execute] | [Agent] Total messages for LLM: 2 (system: 1, history: 0, user query: 1)
WeKnora-app | INFO [2026-01-08 01:07:00.005] [request_id=jROO8fFEQWiG] engine.go:119[Execute] | [Agent] Tools enabled (2): thinking, mcp..
WeKnora-app | INFO [2026-01-08 01:07:00.005] [request_id=jROO8fFEQWiG] | [PIPELINE] stage=Agent action=tools_ready session_id="267b78e2-ad87-447e-bdf2-2f76206c1e12" tool_count=2 tools="thinking, mcp.."
WeKnora-app | INFO [2026-01-08 01:07:00.005] [request_id=jROO8fFEQWiG] | [PIPELINE] stage=Agent action=loop_start max_iterations=20
WeKnora-app | INFO [2026-01-08 01:07:00.005] [request_id=jROO8fFEQWiG] engine.go:171[executeLoop] | ========== Round 1/20 Started ==========
WeKnora-app | INFO [2026-01-08 01:07:00.005] [request_id=jROO8fFEQWiG] engine.go:172[executeLoop] | [Agent][Round-1] Message history size: 2 messages
WeKnora-app | INFO [2026-01-08 01:07:00.005] [request_id=jROO8fFEQWiG] | [PIPELINE] stage=Agent action=round_start iteration=0 max_iterations=20 message_count=2 pending_tools=2 round=1
WeKnora-app | INFO [2026-01-08 01:07:00.005] [request_id=jROO8fFEQWiG] engine.go:182[executeLoop] | [Agent][Round-1] Calling LLM with 2 tools available...
WeKnora-app | INFO [2026-01-08 01:07:00.006] [request_id=jROO8fFEQWiG] | [PIPELINE] stage=Agent action=think_start iteration=0 round=1 tool_cnt=2
WeKnora-app | INFO [2026-01-08 01:07:00.006] [request_id=jROO8fFEQWiG] engine.go:688[streamThinkingToEventBus] | [Agent][Thinking][Iteration-1] Starting thinking stream with temperature=0.70, tools=2
WeKnora-app | DEBUG[2026-01-08 01:07:00.006] [] engine.go:695[streamThinkingToEventBus] | [Agent] streamLLM opts tool_choice=auto temperature=0.7
WeKnora-app | DEBUG[2026-01-08 01:07:00.006] [request_id=jROO8fFEQWiG] engine.go:701[streamThinkingToEventBus] | [Agent][Thinking][Iteration-1] ThinkingID: b559ca5b-thinking
WeKnora-app | DEBUG[2026-01-08 01:07:00.006] [request_id=jROO8fFEQWiG] engine.go:593[streamLLMToEventBus] | [Agent][Stream] Starting LLM stream with 2 messages
WeKnora-app | ERROR[2026-01-08 01:07:00.232] [request_id=jROO8fFEQWiG] engine.go:597[streamLLMToEventBus] | [Agent][Stream] Failed to start LLM stream: create chat completion stream: error, status code: 400, status: 400 Bad Request, message: Invalid 'tools[1].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.
WeKnora-app | ERROR[2026-01-08 01:07:00.232] [request_id=jROO8fFEQWiG] engine.go:744[streamThinkingToEventBus] | [Agent][Thinking][Iteration-1] Thinking stream failed: create chat completion stream: error, status code: 400, status: 400 Bad Request, message: Invalid 'tools[1].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.
WeKnora-app | ERROR[2026-01-08 01:07:00.232] [request_id=jROO8fFEQWiG] engine.go:190[executeLoop] | [Agent][Round-1] LLM call failed: create chat completion stream: error, status code: 400, status: 400 Bad Request, message: Invalid 'tools[1].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.
WeKnora-app | ERROR[2026-01-08 01:07:00.232] [request_id=jROO8fFEQWiG] | [PIPELINE] stage=Agent action=think_failed error="create chat completion stream: error, status code: 400, status: 400 Bad Request, message: Invalid 'tools[1].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'." iteration=0
WeKnora-app | ERROR[2026-01-08 01:07:00.232] [request_id=jROO8fFEQWiG] engine.go:128[Execute] | [Agent] Execution failed: LLM call failed: create chat completion stream: error, status code: 400, status: 400 Bad Request, message: Invalid 'tools[1].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.
WeKnora-app | ERROR[2026-01-08 01:07:00.232] [request_id=jROO8fFEQWiG] session.go:1131[AgentQA] | Agent execution failed: LLM call failed: create chat completion stream: error, status code: 400, status: 400 Bad Request, message: Invalid 'tools[1].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.
WeKnora-app | INFO [2026-01-08 01:07:00.233] [request_id=jROO8fFEQWiG] message.go:227[UpdateMessage] | Start updating message
WeKnora-app | INFO [2026-01-08 01:07:00.233] [request_id=jROO8fFEQWiG] message.go:228[UpdateMessage] | Updating message, ID: 8fde2c80-5230-4bd1-8605-55ed7002e1ec, session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:07:00.233] [request_id=jROO8fFEQWiG] message.go:232[UpdateMessage] | Checking if session exists, tenant ID: 10000
WeKnora-app | INFO [2026-01-08 01:07:00.234] [request_id=jROO8fFEQWiG] message.go:240[UpdateMessage] | Session exists, updating message
WeKnora-app | INFO [2026-01-08 01:07:00.236] [request_id=jROO8fFEQWiG] message.go:250[UpdateMessage] | Message updated successfully
WeKnora-app | INFO [2026-01-08 01:07:00.237] [request_id=jROO8fFEQWiG] qa.go:463[1] | Agent QA service completed for session: 267b78e2-ad87-447e-bdf2-2f76206c1e12
WeKnora-app | INFO [2026-01-08 01:07:01.221] [] session.go:387[func1] | Title update event emitted successfully, session ID: 267b78e2-ad87-447e-bdf2-2f76206c1e12, title: 皮肤灰白皮屑疾病分析
WeKnora-app | 2026/01/08 01:07:05.846799 handler.go:31: traces export: exporter export timeout: rpc error: code = Unavailable desc = name resolver error: produced zero addresses
WeKnora-postgres | 2026-01-07 17:07:15.741 UTC [75] LOG: checkpoint starting: time
WeKnora-app | INFO [2026-01-08 01:07:16.764] [request_id=069c4c93-cc4e-42fd-9c3e-5618a731d5a2 client_ip=::1 latency=35.178µs method=GET path=/health response_body={"status":"ok"} size=15 status_code=200] |
WeKnora-postgres | 2026-01-07 17:07:20.474 UTC [75] LOG: checkpoint complete: wrote 48 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.712 s, sync=0.010 s, total=4.733 s; sync files=31, longest=0.007 s, average=0.001 s; distance=157 kB, estimate=13198 kB; lsn=0/12F82460, redo lsn=0/12F82408
WeKnora-app | INFO [2026-01-08 01:07:47.129] [request_id=bfd97a84-6a4e-4595-804c-c68a65c40bb2 client_ip=::1 latency=35.027µs method=GET path=/health response_body={"status":"ok"} size=15 status_code=200] |
WeKnora-app | INFO [2026-01-08 01:08:01.408] [request_id=jROO8fFEQWiG] | Client disconnected, stopping SSE streaming for session=267b78e2-ad87-447e-bdf2-2f76206c1e12, message=8fde2c80-5230-4bd1-8605-55ed7002e1ec
WeKnora-app | INFO [2026-01-08 01:08:01.408] [request_id=jROO8fFEQWiG client_ip=112.10.132.164 latency=1m1.71972818s method=POST path=/api/v1/agent-chat/267b78e2-ad87-447e-bdf2-2f76206c1e12 request_body={"query":"皮肤灰白,有皮屑,可能有什么样的疾病,并帮我搜索相似病例。","agent_enabled":true,"web_search_enabled":false,"summary_model_id":"74b4f28d-adde-495c-88b8-0d325d58e39a"} response_body={"id":"jROO8fFEQWiG","response_type":"agent_query","content":"","done":true,"session_id":"267b78e2-ad87-447e-bdf2-2f76206c1e12","assistant_message_id":"8fde2c80-5230-4bd1-8605-55ed7002e1ec","data":{"assistant_message_id":"8fde2c80-5230-4bd1-8605-55ed7002e1ec","session_id":"267b78e2-ad87-447e-bdf2-2f76206c1e12"}} {"id":"jROO8fFEQWiG","response_type":"error","content":"LLM call failed: create chat completion stream: error, status code: 400, status: 400 Bad Request, message: Invalid 'tools[1].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.","done":true,"data":{"error":"LLM call failed: create chat completion stream: error, status code: 400, status: 400 Bad Request, message: Invalid 'tools[1].操作系统
Ubuntu
确认事项
- 我已经搜索了现有的 issues,确认这是一个新问题
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working