Files
osmedeus/internal/core/step_test.go
T
j3ssie 438d8ec138 feat: implement agent executor with tool calling, sub-agents, and comprehensive test suite
- Add AgentExecutor implementing LLM-based agentic loop with tool calling, max iterations, and stop conditions
- Introduce agent preset tools (bash, file_exists, http_get, run_module, etc.) with extensible registry pattern
- Add sub-agent spawning capability via spawn_agent tool call with recursive depth limits and validation
- Implement ToolExecutor for custom tool execution with template rendering and error handling
- Add agent session persistence and memory management with sliding window configuration
- Create comprehensive E2E test suite covering 15+ agent workflow scenarios (minimal, custom tools, planning, multi-goal, structured output, tracing hooks, file tools, orchestration, Python tools, sub-agents, nested sub-agents, and validation)
- Add agent-and-llm test data directory with 17 YAML workflow fixtures
- Update integration tests to include agent workflow directories
- Add AgentTool and AgentConfig types with validation for duplicate names and unknown presets
- Implement LLM streaming test utilities
- Update documentation (CLAUDE.md, HACKING.md, README.md) with agent features and CLI examples
2026-02-10 08:44:48 +07:00

61 lines
1.0 KiB
Go

package core
import (
"testing"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestStepSuppressDetails(t *testing.T) {
tests := []struct {
name string
yaml string
expected bool
}{
{
name: "suppress_details true",
yaml: `
name: test-step
type: function
suppress_details: true
functions:
- exec_cmd("echo hello")
`,
expected: true,
},
{
name: "suppress_details false",
yaml: `
name: test-step
type: function
suppress_details: false
functions:
- exec_cmd("echo hello")
`,
expected: false,
},
{
name: "suppress_details omitted defaults to false",
yaml: `
name: test-step
type: function
functions:
- exec_cmd("echo hello")
`,
expected: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var step Step
err := yaml.Unmarshal([]byte(tt.yaml), &step)
require.NoError(t, err)
assert.Equal(t, tt.expected, step.SuppressDetails)
assert.Equal(t, "test-step", step.Name)
})
}
}