Commit Graph

54 Commits

Author SHA1 Message Date
3cad4b635f RegisterStage: add scope parameter, remove RegisterStageOwnTools
- SDK: RegisterStage(stage, handler, scope...) with StageScopeGlobal/StageScopeOwnTools
- Delete RegisterStageOwnTools, migrate cmd and qq plugins
- Internal SDK: add StageScope alias
- Docs: update all zh/en docs for C ABI buildmode and stage scope
- C ABI: fix nil errorOut in Handle.Start/Handle.Stop (SIGSEGV fix)
- C ABI header: add dispatch IDs 26-45 for Settings/Doc/Knowledge/LLM/Social/TextMemory
2026-07-17 11:25:54 +08:00
724febf7b4 fix: remove closure-captured h.api, use stateless pluginMap lookup
- Replace invokeTool/invokeOutput/invokeStage callbacks with standalone
  functions pluginInvokeTool/pluginInvokeOutput/pluginInvokeStage
- Case 1: sync tool invocation (not async - LLM needs return value)
- Case 2/3: use pluginID + pluginMap lookup instead of closures
- Store ps.api in pluginState for direct C function calls
2026-07-17 09:59:17 +08:00
a00198a9b0 feat: complete SDK dispatch - all methods implemented (32-41)
- DocMemory: Insert/Remove/Stats dispatch (32-34)
- Knowledge: Add/List dispatch (35-36)
- LLM: CurrentSource dispatch (37)
- Social: GetTrait/GetRelations/ListPersons dispatch (38-40)
- TextMemory: Append dispatch (41)
- EventBus: subscribe stub (not wired for external plugins)
- All bridge template stubs replaced with real dispatch calls
2026-07-17 09:46:33 +08:00
babef149b5 fix: comprehensive dispatch fixes
- go_core_dispatch case 1: tool handler now calls back to plugin via invokeTool
- go_core_dispatch case 2: stage handler sends full StageContext (11 fields)
- New dispatch methods 26-31: Settings.GetCore/SetCore/ListCore/GetPlugin/SetPlugin/ListPlugin
- Remove dlclose (plugin goroutines may still be running after Stop)
- invokeTool/invokeOutput/invokeStage callbacks with proper error handling
- Fix n2 unused variable
2026-07-17 09:33:53 +08:00
f9fe852ded fix: RegisterOutputChannel and RegisterStage now route through plugin callbacks
- go_core_dispatch case 2/3 no longer stub - real callbacks to plugin
- pluginState.invokeOutput/invokeStage call plugin's go_invoke_output/stage
- OutputChannel registration via IOManager.RegisterDevice
- Stage handler registration via PluginSDK.RegisterStage
2026-07-17 09:26:46 +08:00
1624c57867 fix: CoreAPI lifecycle - don't FreeCoreAPI until Stop
- Move FreeCoreAPI from defer in Start() to Stop()
- Call handle.Stop() before freeing resources
- This prevents SIGSEGV from plugins accessing freed CoreAPI memory
- Plugin's Go bridge code is safe (no C memory bugs)
2026-07-17 09:21:50 +08:00
9ca793e66d feat: C ABI plugin loader with full CoreAPI dispatch
- internal/plugin/cabi/: dlopen + dlsym for plugin_init
- create_core_api(): C struct with dispatch_bridge→go_core_dispatch
- go_core_dispatch routes all 25 SDK methods (RegisterTool, MemoryAPI, etc.)
- dynamic.go: cabiPlugin uses CreateCoreAPI(sdk)→Start(corePtr)
- Each plugin gets a unique ID stored in CoreAPI.ctx
- C functions moved to loader.c to avoid cgo duplicate symbol issues
2026-07-17 08:54:45 +08:00
277a29a786 feat: C ABI plugin bridge for Linux c-shared plugins
- New internal/plugin/cabi/ package: dlopen + dlsym loader
- plugindev: generates z_entry.c + z_bridge_gen.go for c-shared builds
- plugindev: replaces -buildmode=plugin with -buildmode=c-shared
- Go bridge uses mock SDK during Start(), core discovers registrations
- PluginAPI: init/start/stop + invoke_tool/stage/output + get_tool_defs/stages/channels
- ha_dispatch: single C function handles all plugin→core calls via method ID
- tryLoadSO: tries C ABI first, falls back to Go plugin.Open
- All example plugins updated (main.go removed, plg.json targets updated)
2026-07-17 08:11:26 +08:00
09b79811a0 feat: add knowledge_delete tool + cmd_run self-kill guard via before_toolcall stage hook 2026-07-16 19:24:31 +08:00
d67c2c3534 fix: guard cmd_run against self-kill (homed pid/service) 2026-07-16 19:18:54 +08:00
c951e75b39 fix: async knowledge writeIndex + 60s tool execution timeout 2026-07-16 19:04:10 +08:00
f3b1cef2c1 fix: change output channel tool type from 'output' to 'function' for LLM API compatibility 2026-07-16 18:33:50 +08:00
07237c2af4 chore: bump version to 0.7.1 2026-07-16 18:07:19 +08:00
7f28b997e6 feat: output channel redesign - per-channel output gates, LLM chain events, SDKConfig
- Output channels generate per-channel tools: output_send__{name} (type=output) + output_send__{name}_help
- content is JSON string transparently passed to plugin handler for routing
- EventAgentLLMChain: full LLM response forwarded after each turn for webui/logs
- sdk.New refactored to SDKConfig struct (no more 13 positional args)
- RegisterOutputChannel adds desc param for JSON format documentation
- channelDevice simplified (no Tools method), desc field added
- Child agent permission updated for output_send__ prefix
- System prompt: output gates, multi-call, long messages split
- WebUI: subscribes to EventAgentLLMChain in SSE, no output channel
- Tests updated for new naming convention
2026-07-16 12:11:16 +08:00
fa91b24460 refactor: switch from modernc/sqlite back to mattn/go-sqlite3 (CGo) 2026-07-14 11:43:59 +08:00
c7e22fbe30 refactor: move webui.listen_addr from core.daemon to webui category 2026-07-14 11:22:46 +08:00
950090959f feat: restructure plugin system, add Lua plugin support, update docs 2026-07-13 21:48:13 +08:00
1f1233b823 refactor: P0-P3 fixes, C1 cleanup, architecture diagrams, go.work upgrade
- P0-1: ProviderError type + ReportStatus for precise 401/403 detection
- P0-2: Remove -config flag from deploy/homeagent.service
- P2-1: 5s debounce on context.go Save()
- P2-2→C1: Delete output_set_channel entirely
- P2-3: Extract mediaDataURL/mediaChat helpers
- P2-4: Dedup defaultSources var
- P3: Delete dead packages (embed/tokenizer/container/snapshot)
- P3: Delete dead functions (messagesToMap, RunStageAll)
- CL: Update .gitignore, docs, Makefile, gojieba removal
- Config: Delete config/config.yaml, update docs
- Arch: Remove EmitOutputTo from emitResponse
- CL-1: go.work 1.19→1.21
- Docs: Add Mermaid architecture diagrams to README
- Docs: Add kernel-rebuild requires plugin-rebuild note to PLUGIN_DEV.md
2026-07-12 11:42:56 +08:00
dad62516a8 fix: openclaw translateAndRegister uses full tool name for LLM visibility 2026-07-10 13:55:03 +08:00
f3c58e539c fix: formatTree shows root-level knowledge items
Root node items (items without category) were skipped by depth>0 check,
causing knowledge_list to always return '(空)'. Also simplified formatTree
to avoid redundant child item rendering.
2026-07-07 17:15:50 +08:00
2edc039351 fix: correct context pruning order and vector alignment
- Prune context BEFORE processing (LSTM forget gate pattern)
  so LLM only sees relevant context, instead of pruning after the fact
- Fix ensureTrained() to recompute all event vectors after retraining
  vectorizer, fixing feature-space mismatch between stored vectors and
  query vector that made relevance scoring effectively random
- Add read lock to knowledge BuildTree() (data race fix)
- Log writeIndex() errors instead of discarding them
- Fix TOCTOU race in document ContextToDoc() dedup
- Fix healthcheck timing (measure elapsed before cleanup)
- Refactor waiter CLI into separate files (state, conn, config, editor,
  history, builtin) for maintainability
- Add CLI plugin API key authentication
2026-07-07 17:07:38 +08:00
b664360f61 test: cover WebUI auth flows and bootstrap credentials
- add auth middleware tests for API key, login, and root redirect
- auto-bootstrap admin username/password and API key when unset
- add logout control to dashboard and cookie-aware client behavior
2026-07-06 21:43:49 +08:00
3513912290 feat: add API key and login authentication to WebUI
- protect API routes with API key or authenticated session
- add /login page and /api/v1/login, /api/v1/logout endpoints
- gate dashboard behind session cookie
- auto-bootstrap webui username/password/api_key if unset
- add logout action to dashboard and cookie-aware API client
2026-07-06 21:40:44 +08:00
5fd8d04b1e chore: replace hack with tools and remove obsolete artifacts
- Rename hack/ to tools/ for formal naming
- Update plugin development and deployment script references
- Remove obsolete DESIGN/MILESTONE/PLAN docs now superseded by docs/
- Remove abandoned internal/onebot implementation
- Ignore stray local qq binary artifact
2026-07-06 20:46:32 +08:00
eb55a8fb98 feat: expand local operator controls across CLI and WebUI
- Add structured CLI commands for status/kernel/settings/plugins/memory/knowledge/agents
- Inject core dependencies directly into CLI plugin for non-HTTP operator workflows
- Add plugin management panel and API proxy endpoints to WebUI
- Let cmd_run inherit default workdir from core.agent.workdir
- Use fixed loopback address for pluginmgr API
- Remove stale MaxToolTurns config usage from homed wiring
2026-07-06 20:32:04 +08:00
b55f1dcf0e fix: cap distiller startup scan and switch to formal SDK module dependency
- replace vendored third_party/homeagent-sdk with formal module dependency
- keep canonical SDK via go.mod pinned commit
- optimize distiller startup loading to stream recent raw records only
- parse timestamps correctly and cap startup load to 5000 records
- remove quadratic string building in raw record parsing
- restore fast startup while preserving memory pipeline
2026-07-06 20:18:13 +08:00
50e5dec745 feat: converge dynamic plugins onto canonical homeagent-sdk
- Separate built-in plugin interface from external plugin interface
- Route dynamic plugin loading through homeagent-sdk/sdk using reflection
- Turn internal/sdk into an enhanced wrapper over canonical SDK types
- Vendor SDK repo snapshot under third_party/homeagent-sdk for stable builds
- Keep internal constructors/adapters for memory, knowledge, llm, settings
- Align dynamic QQ loading with canonical SDK chain
2026-07-06 19:27:51 +08:00
a7e06fba77 feat: expose tool owner plugin in stage context
- add Plugin field to ToolDef, ToolCall, ToolResult
- track tool owner in StageHost
- annotate before/after_toolcall stage context with tool plugin
- add RegisterStageOwnTools() for plugin-scoped tool listeners
- keep interrupt input source/output channel context in stage messages
2026-07-06 17:25:18 +08:00
5a2c3e199a fix: preserve interrupt source metadata without duplicate processing
- annotate queued and interrupt inputs with source/output channel context
- drain all pending interrupts instead of only one
- avoid double-processing by routing interrupts exclusively:
  active LLM -> intercept channel, idle -> input queue
- keep interrupt source/channel in payload and system context
2026-07-06 17:17:01 +08:00
df0abcd298 feat: files built-in plugin, doc rewrite, architecture cleanup
- Add files plugin as built-in (internal/plugins/files/) with read/write/edit/ls tools,
  supporting overwrite/append/insert/create modes and offset/limit segmented reading
- Rewrite README.md with core domain separation and three-layer memory highlights
- Rewrite docs/OVERVIEW.md with per-subsystem file path references
- Rewrite docs/ARCHITECTURE.md (783→~300 lines), merge redundant sections
- Clean docs/PLUGIN_DEV.md: remove emoji, simplify SDK examples
- Fix provider Model pollution in LuaAdaptedProvider.Chat()
- Fix executeToolCall to return actual error vs quiet not-found
- Fix plugin.Open path caching with SHA256 temp-path workaround
- Add knowledge/homeagent_architecture demo entry
- Add config/personal/personal.md identity configuration
2026-07-06 14:33:09 +08:00
8cec92d947 feat: 路径配置化 + 裸二进制启动 + pluginmgr 内置插件
- types.go: 新增 PluginDirConfig 结构体嵌入 Config
- config/registry.go: 新增7个路径配置项 (core.plugin.dir 等) + ConfigDef 元数据
- cmd/homed/main.go: -data 默认自动检测二进制同级目录,使用 cfg.Plugin.Dir
- internal/plugins/pluginmgr/: 内置插件实现 (4工具 + HTTP API + 包校验)
- all.go: 注册 pluginmgr
- manifest.go: 扩展 PluginManifest 字段
- sdk/settings.go: RegisterDef / Defs 接口
- webui: 设置页自动发现 ConfigDef 元数据
- config/config.go, config/config.yaml: 清理 YAML 死代码
- sdk/plugin.go: IO 通道泛型化支持非文本类型
- waiter: CLI 支持 socket 发现和交互模式
2026-07-04 16:56:32 +08:00
ac49a7b956 fix: 媒体 fallback 描述文本使用通道名而非固定'用户上传' 2026-07-04 15:03:17 +08:00
c3816dc699 IO 抽象层增强:非文本输入支持 + waiter CLI 重写
PluginSDK:
- 添加 InjectInput / InjectInputSync / InjectInterrupt 泛型接口
- 插件现在可注入 image/audio/file 等任意类型输入

Provider:
- 添加 ContentBlock / ImageURL / AudioURL 类型
- Message 增加 Blocks 字段,Content 在非空 Blocks 时序列化为数组(多模态格式)

Agent:
- handleInput 新增 image/audio 类型分发 → processMediaInput
- processMediaInput 将媒体数据附着到对话上下文,LLM 自主决策处理策略
- 新增内置工具:describe_image / transcribe_audio / ocr_image(pendingMedia 驱动)
- 工具仅当有未处理媒体数据时注册,通过 Provider 直接调用多模态模型

Config:
- 新增 InputProcessingConfig(image/audio 处理配置)
- 含 fallback_provider / describe_prompt / ocr_enabled 等选项

Waiter CLI 重写:
- 配置文件 ~/.config/homeagent/cli.yaml(自动发现 socket)
- 原始终端行编辑 + 命令历史持久化 + 彩色输出
- 内置命令:/help /reconnect /connect /remote /local /prompt
- 断线自动重连
2026-07-04 15:01:35 +08:00
68a373ede0 fix: correct OpenClaw plugin architecture - notifications as sole registration path
- Remove SKILL tool registration with nil handler (was causing nil
  pointer in StageHost.ExecuteTool)
- Rewrite loadOCPlugin: notifications are the only registration path.
  Synchronously drain all buffered register notifications after
  waitReady, then start persistent notifyLoop for future registrations.
  ListTools is verification-only, no longer registers tools.
- notifyLoop: persistent via for n := range sp.NotifyChan(), lifecycle
  bound to sidecar process
- StageHost.ExecuteTool: add nil-handler check (defense-in-depth)
- Remove unused OCNamedParam, DrainNotify from sidecar.go
2026-07-04 14:32:39 +08:00
e273e746ea feat: complete OpenClaw plugin API bridge with async notification architecture
- simulator/main.js: All 30+ register* methods now send JSON-RPC notifications
  to Go instead of being silent no-ops. Each plugin capability registration
  (tool, provider, channel, hook, http_route, command, service, etc.) is
  forwarded to Go via the notify channel.

- sidecar.go: Refactored to async reader goroutine. Single goroutine reads
  all stdout lines, routes responses to pending callers via channel by ID,
  and dispatches notifications (no-ID messages) to notifyCh for handling.

- plugin.go: drainNotify() collects all capabilities registered during
  plugin init. handleNotify() logs each registered capability for visibility.

- All 9 openclaw tests pass including simulator + full pipeline tests.
2026-07-04 14:08:42 +08:00
f68c8fff16 fix: complete OpenClaw plugin compatibility with test coverage
- Add test OpenClaw plugins: oc-simple (openclaw.plugin.json) and oc-pkg (package.json#extensions)
- Fix plugin.go Start() to detect package.json#openclaw.extensions as OC manifest
- Add hasOCExtensions() helper for package.json OC field detection
- Tests: simulator with manifest entry discovery, package.json extension discovery,
  full Plugin.Start() -> loadOCPlugin() -> register -> call pipeline
2026-07-04 13:46:15 +08:00
fab58e709a feat: complete P0/P1/P2 — WebUI SPA, OpenClaw sidecar+simulator, healthcheck auto-sched+perf
P0: WebUI重构
- 完整 SPA 仪表盘 (7标签页), //go:embed dashboard.html
P1: OpenClaw兼容 (三通道: SKILL.md / sidecar / simulator)
- Node.js 模拟进程统一加载任意 OpenClaw 插件
- JSON-RPC 2.0 over stdio 协议, go:embed 内嵌
P2: Healthcheck 优化
- 定时自动执行 (startAutoCheck, 30min)
- healthcheck_perf 性能监控工具

其他: agentcli/cmd 插件, integration_test, status.go,
      test_deepseek 清理, 多项 bug 修复
2026-07-04 12:51:32 +08:00
77e12f7329 fix: 网络检测增强 + Tracker changeset 清理
网络检测 (monitor.go):
- TCP 拨测 (8.8.8.8:53 / 1.1.1.1:53 / 208.67.222.222:53)
- 延迟阈值检测 (>5s 标记降级)
- DNS 多目标检测 (google/baidu/cloudflare)
- NetworkCheckResult 新增 TCPReachable + LatencyDegraded

Tracker:
- 新增 WithKeepChangesets / WithMaxChangesetAge 选项
- Init 时自动清理过期 changeset (默认保留100份/30天)
- 先按年龄裁剪,再按数量裁剪
2026-07-03 21:31:00 +08:00
068af0569c test: 补齐4个模块测试 + LLM 图质量评估 + 文件日志
补齐测试:
- pipeline_test.go: 29 个测试 (蒸馏/刷盘/加载/三连提取/工具函数)
- social_test.go: 11 个测试 (特质CRUD/社交关系/网络/安全 nil 守卫)
- text/memory_test.go: 20 个测试 (追加/回放/并发/旋转/清理/持久化)
- indexer_test.go: 15 个测试 (同步/上下文/召回过滤/关键词/工具定义)

图质量评估:
- reorgGraph 新增 evaluateGraphQuality 步骤
- 自动识别蒸馏噪音 (用户-提及/AI-回应) 和低 confidence 关系
- 通过 enqueueConsolidationTask 交由 LLM 逐条判断保留/删除

文件日志:
- 启动时创建 data/log/ 目录
- io.MultiWriter 同时输出到 stderr 和 homed_<时间>.log
2026-07-03 21:26:55 +08:00
6d1b6b15d6 fix: 三层记忆/知识库数据泄漏修复 + 系统提示词动态化
问题修复:
- distiller: Append 添加 memDB==nil 守卫,避免数据泄漏
- indexer: 启动时立即 Sync(),消除前30分钟空窗期
- 系统提示词: 移除硬编码的13项工具列表,改为动态分类说明
- doc_query: 消去 Query+Consume 重复搜索,改为 Consume 一次完成
- extractKeyTriples: 从原文 dump 改为规则提取(姓名/居住地/喜好/年龄/职业)
2026-07-03 20:55:51 +08:00
d4956c23f0 feat: OpenAI 兼容端点完整实现 + reasoning_content 输出通道
- StageContext 新增 ReasoningContent + TokenUsage 字段
- emitResponse 将 reasoning_content / usage 传入 Payload
- /v1/chat/completions:
  - 非流式返回 reasoning_content + token_usage
  - 流式 (stream=true) SSE 分块返回 reasoning/content/finish chunk
  - token_usage 来自精确 LLM 回报而非估算
2026-07-03 20:49:43 +08:00
239a22899b fix: 模型思考模式配置 + Unicode 截断 + 审计修复 (13 files)
模型模式:
- 新增 LLMConfig/Source.ThinkingEnabled 配置,通过 ExtraBody
  控制 DeepSeek thinking mode,默认关闭
- SeedDefaults/ToConfig 读写 core.llm.thinking_enabled
- deepseek.lua 移除硬编码 temperature=0

Unicode 截断:
- truncateStr 改按 rune 计数,修复中文截断乱码

审计修复 (Critical):
- graph.go: defer rows.Close 在 for 循环 → 显式 Close (连接池泄漏)
- cli/openclaw/plugin.go: bare type assertion → comma-ok (panic)
- channel.go: payload["type"].(string) → comma-ok (panic)
- webui/handler.go: .(string) → fmt.Sprint (panic)
- agent.go: 添加 nil provider 错误返回

审计修复 (High):
- events/bus.go: copy handler slice under RLock (data race)
- webui/handler.go: SSE 通过 channel 串行化写入 (data race)
- timer/plugin.go: time.Sleep → select with stopCh (Stop 阻塞)
- provider.go: stream ch <- 添加 select ctx.Done (goroutine 泄漏)
- main.go: outputCh goroutine 添加 ctx.Done 退出路径
2026-07-03 20:46:04 +08:00
197f932932 docs: 项目概览(OVERVIEW.md) + 插件开发指南(PLUGIN_DEV.md) + MCP 适配器插件
- OVERVIEW.md: 非技术用户友好的项目介绍和目标
- PLUGIN_DEV.md: 完整插件开发指南(含三种开发方式、API 参考、最佳实践)
- internal/plugins/mcp/: MCP 协议适配器插件(JSON-RPC over stdio/SSE)
  - client.go: MCP 客户端(ListTools / CallTool)
  - stdio.go: 子进程 stdin/stdout 传输
  - sse.go: HTTP POST 传输
  - plugin.go: init() 自注册 + Settings 配置读取
- README.md 更新链接
2026-07-03 17:58:20 +08:00
2d314b3e9c 重构: 插件自注册 + .so 动态加载 + 中断打断机制
- 所有内置插件 init() 自注册 (plugin.RegisterFactory), 移除 main.go 硬编码
- 新增 .so 动态加载器 (internal/plugin/dynamic.go), 插件可编译为 plugin.so
- 新增 plugin.json 元数据 (internal/plugin/manifest.go)
- 新增 interceptLoop 独立 goroutine:
  (a) cancelLLM() 取消进行中的 HTTP 请求
  (b) interceptCh → drainInterrupt() 注入 [打断消息] 到 LLM 上下文
  (c) InjectInput 空闲时触发新处理循环
- 新增 internal/plugins/all.go 空白导入触发所有内置插件 init()
- internal/sdk/ 作为 PluginSDK 正式 Go API
- internal/api/ → internal/plugins/webui/ 迁移
- 删除旧 cmd/cli/, 使用 cmd/waiter/ 替代
- 更新 PLAN.md / ARCHITECTURE.md / README.md 文档
2026-07-03 16:53:34 +08:00
4442c9cea4 适配多个 LLM 源 (anthropic/gemini/mistral/groq/github) + SQLite 配置收敛 + 测试插件 2026-07-03 14:03:51 +08:00
b1b90ae09f docs+test: update ARCHITECTURE.md + settings integration tests
- Add Lua adaptation layer section (Provider → LuaAdaptedProvider)
- Add ConfigRegistry + SettingsAPI section
- Add self-loop input channel section
- Update directory tree with config/, lua/adapters/
- Update v3→v4 comparison table
- Integration tests: settings GET/PUT/prefix/filter/HTML/edge cases
- Tests verify: key listing, prefix filtering, value update via PUT,
  HTML content checks, missing registry handling
2026-07-03 08:43:16 +08:00
672b098c4e feat: WebUI settings page with sidebar + ConfigRegistry integration
- /api/v1/settings endpoint: GET (list by prefix) + PUT (set key/value)
- Config tab redesigned: left sidebar (core + per-plugin) + right editor
- Sidebar groups: core.* and plugin.<name>.* from plugin registry
- Each setting rendered as editable input with save button
- WebUI now receives cfgReg and pluginReg from main
- handler_test.go updated with new NewHandler signature
2026-07-03 08:39:30 +08:00
9c33b3b149 feat: ConfigRegistry + SettingsAPI for plugin config access
Core exposes a unified settings interface through Plugin SDK:
- internal/config/registry.go: thread-safe namespaced KV store
  - Register/Get/Set/List/Delete with JSON persistence
  - Flush() for explicit save to disk
- SettingsAPI in SDK: plugins call plugin.Settings().Get/Set/List
  - Full access: read/write any key (core.*, plugin.<name>.*)
- plugin.Registry.SetConfigRegistry() wires it into SDK plugins
- main.go registers core.* keys at startup, flushes on shutdown
- 7 tests for ConfigRegistry
2026-07-03 08:32:41 +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
a8369a7f38 core: add self-loop input channel for internal tasks (memory consolidation)
- Add selfInputCh (chan string, buf 64) to Agent struct
- eventLoop reads from both io.InputChan() and selfInputCh
- enqueueConsolidationTask uses injectSelf() instead of io.InjectTextTo()
- SelfInputChan() exposes read-only channel for testing
- Core no longer depends on IO layer for internal tasks
2026-07-03 08:11:31 +08:00