fix: doc_query chronological insert, register cli/webui output channels

- context.go: add InsertByTimestamp for chronological context insertion
- toolcall.go: doc_query uses InsertByTimestamp instead of Append
- agent_tools_test.go: update tests to use payload/type keys
- cli/plugin.go: register output_send__cli channel
- webui/plugin.go: register output_send__webui channel
This commit is contained in:
root
2026-07-25 16:25:06 +08:00
parent 729a33a71b
commit 6db1d334d6
5 changed files with 48 additions and 4 deletions

View File

@ -503,7 +503,7 @@ func (a *Agent) executeDocTool(tc agentAPI.ToolCall) string {
if len(content) > 2000 {
content = content[:2000] + "..."
}
a.context.Append(ContextEvent{
a.context.InsertByTimestamp(ContextEvent{
Timestamp: d.CreatedAt,
Source: "cold_storage",
Input: fmt.Sprintf("加载文档记忆: %s", query),