refactor: restructure Go code into workspace with api, core, and adk modules#1385
refactor: restructure Go code into workspace with api, core, and adk modules#1385
Conversation
…adk modules Split the monolithic go/ module into a Go workspace with three modules: - go/api: shared types (CRDs, ADK types, database models, HTTP client SDK) - go/core: infrastructure (controllers, HTTP server, CLI, DB implementation) - go/adk: Go Agent Development Kit (moved from contrib/go-adk/, types deduplicated) Key changes: - Unified Dockerfile parameterized with BUILD_PACKAGE for both controller and adk - Unified go/Makefile with workspace-wide fmt/vet/lint/test targets - ADK types deduplicated: canonical definitions in go/api/adk, re-exported in go/adk/pkg/config - ExecuteCode/Stream fields changed from bool to *bool with helper methods - Fix LLM Name() methods to return model name instead of provider name (fixes 404s) - Add oneshot example tool for quick agent config testing - Update CI workflows, root Makefile, documentation for new paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Adds TestE2EInvokeGolangADKAgent which creates a declarative agent using the Go ADK image (via ImageRepository override) with a mock LLM server. Tests both sync and streaming A2A invocations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> # Conflicts: # Makefile # go/Dockerfile # go/api/adk/types.go # go/api/database/models.go # go/core/go.mod # go/core/go.sum # go/core/internal/controller/translator/agent/git_skills_test.go # go/core/internal/controller/translator/agent/skills-init.sh.tmpl # go/core/internal/controller/translator/agent/skills_unit_test.go # go/core/internal/controller/translator/agent/testdata/inputs/agent_with_embedding_provider.yaml # go/core/internal/controller/translator/agent/testdata/inputs/agent_with_git_skills.yaml # go/core/internal/controller/translator/agent/testdata/inputs/agent_with_memory.yaml # go/core/internal/controller/translator/agent/testdata/outputs/agent_with_embedding_provider.json # go/core/internal/controller/translator/agent/testdata/outputs/agent_with_git_skills.json # go/core/internal/controller/translator/agent/testdata/outputs/agent_with_memory.json # go/core/internal/database/client.go # go/core/internal/database/client_test.go # go/core/internal/database/fake/client.go # go/core/internal/database/manager.go # go/core/internal/httpserver/handlers/memory.go # go/core/internal/httpserver/handlers/memory_test.go # go/core/test/e2e/invoke_api_test.go # go/core/test/e2e/mocks/invoke_memory_agent.json
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
There was a problem hiding this comment.
Pull request overview
This PR restructures the Go codebase from a monolithic module into a workspace with three distinct modules (api, core, adk), improving separation of concerns and enabling independent versioning. The refactoring deduplicates ADK types by establishing canonical definitions in go/api/adk, fixes critical LLM provider bugs where model Name() methods returned provider names instead of model names (causing 404 errors), and unifies the build system with a parameterized Dockerfile and workspace-wide Make targets.
Changes:
- Restructured Go code into workspace with
api(shared types),core(infrastructure), andadk(agent SDK) modules - Fixed LLM Name() methods to return model names instead of provider names (resolves API 404 errors)
- Changed AgentConfig ExecuteCode/Stream fields from bool to *bool with helper methods for backward compatibility
Reviewed changes
Copilot reviewed 136 out of 426 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| go/core/internal/controller/translator/agent/testdata/outputs/*.json | Updated golden test files to reflect ExecuteCode/Stream bool→*bool changes and removed null fields |
| go/core/internal/controller/translator/agent/testdata/README.md | Updated test commands to reflect new module paths (go/core/) |
| go/core/internal/controller/translator/agent/*.go | Updated import paths from go/internal to go/core/internal |
| go/core/internal/controller/*.go | Updated import paths for new module structure |
| go/core/internal/a2a/*.go | Updated import paths for core module |
| go/core/cli/internal/**/*.go | Updated CLI import paths for new workspace structure |
| go/core/go.mod | Changed module path from go to go/core and added go/api dependency |
| go/core/cmd/controller/main.go | Removed MCPServerPlugins field from plugin config |
| go/api/v1alpha2/agent_types.go | Added ImageRepository field to DeclarativeDeploymentSpec |
| go/api/v1alpha2/common_types.go | Updated import path from go/internal/utils to go/api/utils |
| go/api/utils/utils.go | New file: extracted shared utilities to api module |
| go/api/httpapi/types.go | Changed package name from api to httpapi and updated database import |
| go/api/go.mod | New module definition for shared api types |
| go/api/database/models.go | Updated import path for ADK types |
| go/api/client/*.go | Updated import paths from pkg/client/api to api/httpapi |
| go/api/adk/types.go | Added TLS config fields, Anthropic parameters, GenericModel type, and changed ExecuteCode/Stream to *bool with helper methods |
| go/adk/pkg/**/*.go | Updated import paths for adk module structure and Go 1.25 improvements (slices.Sort, maps.Copy) |
| go/adk/pkg/models/openai_adk.go | Fixed Name() to return m.Config.Model instead of "openai" |
| go/adk/pkg/models/anthropic_adk.go | Fixed Name() to return m.Config.Model instead of "anthropic" |
| go/adk/pkg/agent/agent.go | Moved MCP toolset creation into CreateGoogleADKAgent, removed toolsets parameter |
| go/adk/pkg/config/types.go | New file: re-exports types from go/api/adk for backward compatibility |
| go/adk/examples/oneshot/main.go | New tool for quick agent config testing |
| go/adk/go.mod | Changed module path to go/adk and added go/api dependency |
| go/README.md | Updated to document workspace structure and build commands |
| go/Makefile | Updated for workspace: fmt/vet/lint/test targets now iterate over modules |
| go/Dockerfile | Parameterized with BUILD_PACKAGE to support both controller and adk builds |
| go/.gitignore | Updated for new bin/ locations |
| contrib/go-adk/* | Removed duplicate ADK implementation (merged into go/adk) |
| Makefile | Updated paths, added golang-adk build target |
| .github/workflows/*.yaml | Updated paths and added golang-adk to build matrix |
Comments suppressed due to low confidence (1)
go/core/cmd/controller/main.go:36
- Removed
MCPServerPlugins: nilbutAgentPlugins: nilremains. If both fields were always nil, consider whether the entire plugins configuration is needed or if the struct initialization can be simplified.
AgentPlugins: nil,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… env - GeminiAnthropic: replace LiteLLM proxy with Anthropic SDK's built-in Vertex AI support (vertex.WithGoogleAuth with ADC) - Ollama: read OLLAMA_API_BASE env var instead of hardcoding localhost - Bedrock: lowercase error string per Go conventions - Add NewAnthropicVertexAIModelWithLogger constructor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Use the Anthropic SDK's built-in Bedrock support (bedrock.WithLoadDefaultConfig) to enable Claude models on AWS Bedrock. Supports both IAM credential auth (AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY) and bearer token auth (AWS_BEARER_TOKEN_BEDROCK). Region is read from the model config or AWS_REGION. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Dmytro Rashko <dmitriy.rashko@amdocs.com>
Split the monolithic go/ module into a Go workspace with three modules:
Key changes: