Files
ragflow/internal/agent/tool/email_test.go

308 lines
8.8 KiB
Go
Raw Normal View History

feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
//
// Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package tool
import (
"bufio"
"context"
"encoding/json"
"fmt"
"net"
"strings"
"testing"
"time"
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
"ragflow/internal/agent/runtime"
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
)
func TestEmail_BuildMessage(t *testing.T) {
t.Parallel()
msg := buildEmailMessage(
"alice@example.com",
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
"Alice Sender",
[]string{"bob@example.com"},
[]string{"carol@example.com"},
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
"Hello, world",
"Body of the message.",
)
s := string(msg)
for _, want := range []string{
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
`From: "Alice Sender" <alice@example.com>`,
"To: bob@example.com\r\n",
"Cc: carol@example.com\r\n",
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
"Subject: Hello, world",
"Content-Type: text/plain; charset=UTF-8",
"Body of the message.",
} {
if !strings.Contains(s, want) {
t.Errorf("message missing %q\n--- message ---\n%s\n---", want, s)
}
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
if strings.Contains(s, "To: bob@example.com, carol@example.com") {
t.Fatalf("CC recipient leaked into To header:\n%s", s)
}
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
// RFC 822 mandates a blank line between headers and body.
if !strings.Contains(s, "\r\n\r\n") {
t.Errorf("message missing blank line between headers and body\n%s", s)
}
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
func TestEmail_SendBuildsDistinctHeadersAndEnvelopeRecipients(t *testing.T) {
originalSendEmail := sendEmail
t.Cleanup(func() { sendEmail = originalSendEmail })
var sentParams emailParams
var sentMessage []byte
sendEmail = func(_ context.Context, p emailParams, msg []byte) error {
sentParams = p
sentMessage = append([]byte(nil), msg...)
return nil
}
built, err := BuildByName("email", map[string]any{
"smtp_server": "smtp.example.com",
"smtp_port": 587,
"email": "alice@example.com",
"sender_name": "Alice Sender",
})
if err != nil {
t.Fatalf("BuildByName(email): %v", err)
}
args := map[string]any{
"to_email": "bob@example.com",
"cc_email": "carol@example.com, dave@example.com",
"subject": "Test {sys.date}",
"content": "Test body content.",
}
argsJSON, _ := json.Marshal(args)
state := runtime.NewCanvasState("run-email", "task-email")
state.Sys["date"] = "2026-07-15"
out, err := built.(*EmailTool).InvokableRun(runtime.WithState(context.Background(), state), string(argsJSON))
if err != nil {
t.Fatalf("InvokableRun: %v", err)
}
var env emailEnvelope
if err := json.Unmarshal([]byte(out), &env); err != nil || !env.OK || env.Error != "" {
t.Fatalf("output = %s, decode error = %v", out, err)
}
message := string(sentMessage)
for _, want := range []string{
`From: "Alice Sender" <alice@example.com>`,
"To: bob@example.com\r\n",
"Cc: carol@example.com, dave@example.com\r\n",
"Subject: Test 2026-07-15",
"Test body content.",
} {
if !strings.Contains(message, want) {
t.Fatalf("message missing %q:\n%s", want, message)
}
}
if got := emailRecipients(sentParams.ToEmail, sentParams.CCEmail); strings.Join(got, ",") != "bob@example.com,carol@example.com,dave@example.com" {
t.Fatalf("SMTP envelope recipients = %#v", got)
}
}
func TestEmail_STARTTLSRequiredBeforeSubmission(t *testing.T) {
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
t.Parallel()
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
listener, err := net.Listen("tcp", "127.0.0.1:0")
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
if err != nil {
t.Fatalf("Listen: %v", err)
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
defer listener.Close()
commands := make(chan []string, 1)
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
go func() {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
conn, acceptErr := listener.Accept()
if acceptErr != nil {
commands <- nil
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
return
}
defer conn.Close()
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
_ = conn.SetDeadline(time.Now().Add(2 * time.Second))
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
reader := bufio.NewReader(conn)
writer := bufio.NewWriter(conn)
_, _ = writer.WriteString("220 mock-smtp ready\r\n")
_ = writer.Flush()
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
var received []string
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
for {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
line, readErr := reader.ReadString('\n')
if readErr != nil {
commands <- received
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
return
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
command := strings.ToUpper(strings.TrimSpace(line))
received = append(received, command)
if strings.HasPrefix(command, "EHLO") || strings.HasPrefix(command, "HELO") {
_, _ = writer.WriteString("250 mock-smtp\r\n")
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
_ = writer.Flush()
}
}
}()
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
host, port, err := net.SplitHostPort(listener.Addr().String())
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
if err != nil {
t.Fatalf("SplitHostPort: %v", err)
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
var portNumber int
_, _ = fmt.Sscanf(port, "%d", &portNumber)
err = sendEmailSTARTTLS(context.Background(), emailParams{
SMTPServer: host, SMTPPort: portNumber, Email: "alice@example.com",
ToEmail: "bob@example.com",
}, []byte("message"))
if err == nil || !strings.Contains(err.Error(), "does not advertise STARTTLS") {
t.Fatalf("err = %v", err)
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
}
select {
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
case received := <-commands:
for _, command := range received {
if strings.HasPrefix(command, "MAIL FROM") || strings.HasPrefix(command, "RCPT TO") || command == "DATA" {
t.Fatalf("message submission started without STARTTLS: %#v", received)
}
}
case <-time.After(3 * time.Second):
t.Fatal("mock SMTP server did not finish")
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
}
}
func TestEmail_RequiresFields(t *testing.T) {
t.Parallel()
cases := []struct {
name string
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
tool *EmailTool
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
args string
wantErr string
}{
{
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
name: "missing smtp_server",
tool: newEmailTool(emailParams{SMTPPort: 587, Email: "a@b"}),
args: `{"to_email":"c@d","subject":"s","content":"b"}`,
wantErr: "smtp_server",
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
},
{
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
name: "missing to_email",
tool: newEmailTool(emailParams{SMTPServer: "x", SMTPPort: 587, Email: "a@b"}),
args: `{"subject":"s","content":"b"}`,
wantErr: "to_email",
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
},
{
name: "bad smtp_port",
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
tool: newEmailTool(emailParams{SMTPServer: "x", SMTPPort: -1, Email: "a@b"}),
args: `{"to_email":"c@d","subject":"s","content":"b"}`,
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
wantErr: "smtp_port",
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
_, err := tc.tool.InvokableRun(context.Background(), tc.args)
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
if err == nil {
t.Fatalf("expected error for %s", tc.name)
}
if !strings.Contains(err.Error(), tc.wantErr) {
t.Errorf("err = %v, want to contain %q", err, tc.wantErr)
}
})
}
}
func TestEmail_Info(t *testing.T) {
t.Parallel()
tool := NewEmailTool()
info, err := tool.Info(context.Background())
if err != nil {
t.Fatalf("Info: %v", err)
}
if info.Name != "email" {
t.Errorf("Name = %q, want email", info.Name)
}
if !strings.Contains(info.Desc, "SMTP") {
t.Errorf("Desc = %q, want to mention SMTP", info.Desc)
}
refactor(go-agent): unify tool-backed canvas components (#16912) ## Summary This PR consolidates Eino-backed Agent tools behind the shared ToolBackedComponent implementation and aligns their Canvas configuration, runtime inputs, output conversion, validation, and registration. ## What changed - Migrated these Canvas components to the unified tool-backed path: - Tavily Search and Extract - Execute SQL - Google - Yahoo Finance - Email - DuckDuckGo - Wikipedia - Google Scholar - ArXiv - PubMed - BGPT - GitHub - WenCai - SearXNG - Keenable Search - Removed superseded component wrappers and their duplicate tests. - Added dedicated registry builders for node-level configuration and validation. - Kept model-emitted runtime inputs separate from Canvas node configuration. - Moved Email defaults, template resolution, recipient parsing, SMTP execution, and output conversion into the owning tool. - Added complete ToolComponent specifications for Canvas inputs, outputs, and input forms. - Preserved raw upstream fields where downstream workflows may depend on them. - Added workflow registration coverage for all migrated component names. - Kept HTTP Request, Docs Generator, and Browser as standalone components because they are not Eino-backed tools. ## Testing Passed: bash build.sh --test ./internal/agent/tool/... bash build.sh --test ./internal/agent/component/... bash build.sh --test ./internal/agent/runtime/... <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/c728d7a3-9d15-4c5c-b0eb-6b77ad0e41ac" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/ef13119a-ef92-4b43-9061-eee9511bf492" /> <img width="2057" height="1111" alt="image" src="https://github.com/user-attachments/assets/f50f2c30-eab0-463c-b0b3-0a02523219f1" />
2026-07-15 21:42:08 +08:00
schemaJSON, err := info.ToJSONSchema()
if err != nil {
t.Fatalf("ToJSONSchema: %v", err)
}
raw, err := json.Marshal(schemaJSON)
if err != nil {
t.Fatalf("marshal schema: %v", err)
}
for _, runtimeField := range []string{"to_email", "cc_email", "content", "subject"} {
if !strings.Contains(string(raw), `"`+runtimeField+`"`) {
t.Errorf("schema missing runtime field %q: %s", runtimeField, raw)
}
}
for _, configField := range []string{"smtp_server", "smtp_port", "email", "password", "sender_name"} {
if strings.Contains(string(raw), `"`+configField+`"`) {
t.Errorf("schema leaked node config %q: %s", configField, raw)
}
}
}
func TestEmail_ComponentContractAndFactory(t *testing.T) {
t.Parallel()
built, err := BuildByName("email", map[string]any{
"smtp_server": "smtp.example.com",
"smtp_port": "587",
"email": "sender@example.com",
"password": "secret",
"sender_name": "Sender",
"outputs": map[string]any{"success": map[string]any{}},
"setups": map[string]any{"to_email": "configured@example.com"},
})
if err != nil {
t.Fatalf("BuildByName(email): %v", err)
}
emailTool := built.(*EmailTool)
if emailTool.defaults.SMTPPort != 587 || emailTool.defaults.SMTPServer != "smtp.example.com" {
t.Fatalf("node defaults = %#v", emailTool.defaults)
}
spec := emailTool.ComponentSpec()
if _, ok := spec.Inputs["to_email"]; !ok {
t.Fatalf("component inputs = %#v", spec.Inputs)
}
if _, ok := spec.Outputs["success"]; !ok {
t.Fatalf("component outputs = %#v", spec.Outputs)
}
toEmail, ok := spec.InputForm["to_email"].(map[string]any)
if !ok || toEmail["name"] != "To " || toEmail["type"] != "line" {
t.Fatalf("to_email input form = %#v", spec.InputForm["to_email"])
}
if outputs := emailTool.BuildComponentOutputs(map[string]any{"ok": true, "provider": "smtp"}); outputs["success"] != true {
t.Fatalf("component outputs = %#v", outputs)
}
}
func TestEmail_BuildByNameRejectsInvalidNodeParams(t *testing.T) {
t.Parallel()
for _, params := range []map[string]any{
{"smtp_port": float64(1.5)},
{"smtp_port": 70000},
{"smtp_server": 1},
} {
if _, err := BuildByName("email", params); err == nil {
t.Fatalf("BuildByName(email, %#v) succeeded, want error", params)
}
}
feat(agent): Go port — canvas engine, 22 components, DSL v2, 13 endpoints (#15952) Ports the agent canvas subsystem from Python to Go. ## What's included ### Canvas Engine (Phase 0/1) - State engine, scheduler, variable resolver, Redis checkpoint store, cancel protocol - **209 tests** across canvas / component / io packages ### 22 Components (P0–P4) | Tier | Components | |---|---| | P0 T1+T2+T3 | LLM, Agent, ExitLoop, Switch, Categorize, Begin, Message, Invoke | | P1 T3 | VariableAggregator, VariableAssigner, StringTransform, ListOperations, DataOperations | | P2 T3 | Iteration, IterationItem, Loop, LoopItem | | P3 T3 | UserFillUp, Fillup | | P4 T5 | Browser, ExcelProcessor, DocsGenerator | ### DSL v2 Schema (Phase 2.5) - Typed v2 in-memory model with v1-to-v2 auto-detect converter - v1 legacy field stripping per plan §2.11.7 ### HTTP Endpoints & Bug Fixes (Plans PR1–PR3) - **DELETE SQL bug fix**: gorm v2 `Where("id = ?", id).Delete(...)` pattern - **CreateAgent validation**: title/DSL required, duplicate check, 103 envelope - **13 new endpoints**: templates, prompts, tags, sessions CRUD, chat/completions (SSE + non-stream stubs), rerun, test_db_connection, logs, webhook/logs - **756 Go unit tests** (745 → 756, +18) - **17 → 0 Python integration test failures** (test_agents.py + test_session_management/) ### Tools 21 eino tools: HTTPHelper, search tools, financial/data tools, mandatory stubs ### Infrastructure OTel observability, NATS message queue, DeepDoc gRPC client, SSRF guards, IDOR mitigation
2026-06-12 22:58:28 +08:00
}