mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-22 01:48:11 +00:00
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:
@ -62,7 +62,8 @@ func TestExecuteOutputSendTool(t *testing.T) {
|
||||
|
||||
a := &Agent{io: io}
|
||||
tc := agentAPI.ToolCall{Name: "output_send__screen", Arguments: map[string]interface{}{
|
||||
"content": `{"content":"hello world"}`,
|
||||
"payload": "hello world",
|
||||
"type": "text",
|
||||
}}
|
||||
result := a.executeOutputSendTool(tc)
|
||||
if !strings.Contains(result, "screen") {
|
||||
@ -84,7 +85,8 @@ func TestExecuteOutputSendToolChannelNotExist(t *testing.T) {
|
||||
io := agentIO.NewIOManager()
|
||||
a := &Agent{io: io}
|
||||
tc := agentAPI.ToolCall{Name: "output_send__nonexistent", Arguments: map[string]interface{}{
|
||||
"content": "hello",
|
||||
"payload": "hello",
|
||||
"type": "text",
|
||||
}}
|
||||
result := a.executeOutputSendTool(tc)
|
||||
if !strings.Contains(result, "不存在") && !strings.Contains(result, "不可用") {
|
||||
@ -101,7 +103,8 @@ func TestExecuteOutputSendToolNoTextCap(t *testing.T) {
|
||||
|
||||
a := &Agent{io: io}
|
||||
tc := agentAPI.ToolCall{Name: "output_send__camera", Arguments: map[string]interface{}{
|
||||
"content": "hello",
|
||||
"payload": "hello",
|
||||
"type": "text",
|
||||
}}
|
||||
result := a.executeOutputSendTool(tc)
|
||||
if strings.Contains(result, "已通过") {
|
||||
|
||||
Reference in New Issue
Block a user