51eb98e0ae
fix(mcp+adapter): 流式 tool_calls 解析修复 + MCP transport 超时保护
...
openai adapter transform_stream_chunk:
- OpenAI 流式分片是嵌套格式 function.{name,arguments},原样透传后
json.Unmarshal 到扁平 ToolCall{name,arguments} 时 name 恒为空,
accumulateStream flushToolCall 因 acc.name=="" 静默丢弃整个工具调用
(流式路径自上线起 tool_calls 全部丢失的根因)
- 现在正确解包 function.name → name,function.arguments → raw_arguments
(保留原始 JSON 字符串分片,由 accumulateStream 按 index 拼接)
- 不按 name 过滤分片:OpenAI 流式续传块 name 为空但携带 arguments 分片
mcp stdio/sse transport:
- stdio Send() 无超时:server 进程卡死时插件加载永久阻塞
- sse http.Client 无超时:远程 server 网络抖动/无响应时永久阻塞,
导致 webui 等后续插件全部无法启动(生产实例偶发启动卡死根因)
- stdio 加 60s 请求超时;sse client 加 30s 整体 + 10s 拨号超时
2026-08-25 18:59:00 +08:00
171e6f233b
llm: 统一源接入层修复(对照 llmsproxy)
...
- provider: 新增 OpenAI-compatible 响应/流兜底解析,Lua adapter 异常时也能解析
choices/message/tool_calls/usage(含 function.arguments 缺失、对象/字符串参数)
- 过滤无效 LLM 源(<nil>/空/缺 http(s) scheme),main 与 ReloadFromConfig 均跳过,
避免 mocktest 等坏源污染 fallback 与 healthcheck
- adapter(openai/deepseek/groq/mistral/github/kimicode): 修 tool_calls 对
nil function 的崩溃,兼容扁平/嵌套结构;openai 流透传 reasoning/tool_calls
- config: ToConfig 探活端点过滤无效 base_url,修复 supervisor 误报 LLM unreachable
2026-08-09 20:39:54 +08:00
548b750b1a
fix(openai adapter): handle null response body and use type-safe field access
...
- Fix transform_response crash when json.decode returns nil (null body)
- Replace truthy checks with type() == "table" for safer field access
- Prevents 'attempt to index a non-table object(nil)' errors
2026-07-30 17:09:51 +08:00
51f190e0b6
core: pass ReasoningContent to assistant messages in process.go
...
- process.go: attach resp.ReasoningContent when building assistant messages
- deepseek.lua v2.1.0: remove last_reasoning closure hack; rely on
core-provided reasoning_content in messages
- openai.lua: strip reasoning_content from messages in transform_request
(not supported by OpenAI API)
2026-07-28 17:07:17 +08:00
f91b20ee16
v0.7.3: 重构 Provider 层 + 计算层隔离 + Cleaner/NoMemory 架构
...
- 删除 OpenAIProvider/OllamaProvider 死代码,LuaAdaptedProvider 独存
- DisableThinking 从 ExtraBody 移到 CompletionRequest 顶层字段
- ContextWindow 从 Provider 签名移到 BaseConfig/ModelContextWindow() 统管
- 确认 CleanText 仅做基本空白 trim,QQ 模板剥离归插件 Cleaner
- Cleaner/NoMemory 仅作用于向量计算和 jieba 分词层,原文不变
- context.ContextEvent/Doc.Content 始终保存原文
- 删除 nlp/download.go 死代码
- media.go: context.Background() -> a.ctx 级联
- clawhubadapter: HTTP 超时
- cut.go: 跨平台 mod cache 路径 (GOMODCACHE->GOPATH->HomeDir)
- bridge_e2e_test: 移除未用 runtime import
- lua 适配器: disable_thinking 传参
2026-07-28 11:42:29 +08:00
ee811fb308
fix: Lua adapter fixes + add ReasoningContent to CompletionResponse
...
- Fix syntax error: tc.function -> tc["function"] (function is Lua keyword)
- Fix empty tool_calls: Lua returns nil instead of empty table ({} vs [] in JSON)
- Fix token_usage key name in unified response (usage -> token_usage)
- Add ReasoningContent to CompletionResponse struct
- Nits: jsonTable init, import ordering
2026-07-03 08:29:08 +08:00
bc26850b50
feat: complete HomeAgent architecture v2
...
- IO abstraction layer with OutputChannel routing and capability validation
- Three-layer memory (Context-Document-Graph) with TF-IDF relevance pruning
- OneBot V11 QQ protocol plugin with Reverse WebSocket client
- Plugin system with hot-reload (SKILL.md + native factories)
- Knowledge system with TF-IDF vector indexing
- Personality system (personal.md)
- Text memory (JSONL with rotation)
- Change tracker (overlayfs) with rollback
- Lua adapter VM
- Design document (DESIGN.md)
Module: gitcode.com/JianFeeeee/HomeAgent
2026-07-02 12:04:36 +08:00