Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/agent-performance-analyzer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/agent-persona-explorer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/audit-workflows.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/cloclo.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/daily-cli-tools-tester.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/daily-firewall-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/workflows/daily-observability-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/daily-safe-output-optimizer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/workflows/deep-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/dev-hawk.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/example-workflow-analyzer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/mcp-inspector.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/metrics-collector.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/portfolio-analyst.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/prompt-clustering-analysis.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/python-data-charts.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/q.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/safe-output-health.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/security-review.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/smoke-claude.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/smoke-copilot.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/static-analysis-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/workflow-normalizer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ const SafeOutputsMCPServerID = "safeoutputs"
// SafeInputsMCPServerID is the identifier for the safe-inputs MCP server
const SafeInputsMCPServerID = "safeinputs"

// AgenticWorkflowsMCPServerID is the identifier for the agentic-workflows MCP server
const AgenticWorkflowsMCPServerID = "agenticworkflows"

// SafeInputsMCPVersion is the version of the safe-inputs MCP server
const SafeInputsMCPVersion = "1.0.0"

Expand Down
5 changes: 3 additions & 2 deletions pkg/workflow/agentic_workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"
"testing"

"github.com/github/gh-aw/pkg/constants"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -121,8 +122,8 @@ func TestAgenticWorkflowsMCPConfigGeneration(t *testing.T) {
result := yaml.String()

// Verify the MCP config contains agentic-workflows
assert.Contains(t, result, "agentic_workflows",
"%s engine should generate MCP config with agentic_workflows server name", e.name)
assert.Contains(t, result, constants.AgenticWorkflowsMCPServerID,
"%s engine should generate MCP config with "+constants.AgenticWorkflowsMCPServerID+" server name", e.name)
assert.Contains(t, result, "gh",
"%s engine MCP config should use gh CLI command for agentic-workflows", e.name)
assert.Contains(t, result, "mcp-server",
Expand Down
4 changes: 2 additions & 2 deletions pkg/workflow/importable_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"
"testing"

"github.com/github/gh-aw/pkg/constants"
"github.com/github/gh-aw/pkg/stringutil"

"github.com/github/gh-aw/pkg/testutil"
"github.com/github/gh-aw/pkg/workflow"
)
Expand Down Expand Up @@ -342,7 +342,7 @@ Uses all imported tools.
t.Error("Expected compiled workflow to contain serena tool")
}
// Per MCP Gateway Specification v1.0.0, agentic-workflows uses containerized format
if !strings.Contains(workflowData, `"agentic_workflows"`) {
if !strings.Contains(workflowData, `"`+constants.AgenticWorkflowsMCPServerID+`"`) {
t.Error("Expected compiled workflow to contain agentic-workflows tool")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/workflow/mcp_config_builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func renderAgenticWorkflowsMCPConfigWithOptions(yaml *strings.Builder, isLast bo
}

// Use MCP Gateway spec format with container, entrypoint, entrypointArgs, and mounts
yaml.WriteString(" \"agentic_workflows\": {\n")
yaml.WriteString(" \"" + constants.AgenticWorkflowsMCPServerID + "\": {\n")

// Add type field for Copilot (per MCP Gateway Specification v1.0.0, use "stdio" for containerized servers)
if includeCopilotFields {
Expand Down Expand Up @@ -286,7 +286,7 @@ func renderSafeOutputsMCPConfigTOML(yaml *strings.Builder) {
// Uses MCP Gateway spec format: container, entrypoint, entrypointArgs, and mounts fields.
func renderAgenticWorkflowsMCPConfigTOML(yaml *strings.Builder, actionMode ActionMode) {
yaml.WriteString(" \n")
yaml.WriteString(" [mcp_servers.agentic_workflows]\n")
yaml.WriteString(" [mcp_servers." + constants.AgenticWorkflowsMCPServerID + "]\n")

containerImage := constants.DefaultAlpineImage
var entrypoint string
Expand Down
10 changes: 6 additions & 4 deletions pkg/workflow/mcp_config_refactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package workflow
import (
"strings"
"testing"

"github.com/github/gh-aw/pkg/constants"
)

// TestRenderSafeOutputsMCPConfigWithOptions verifies the shared Safe Outputs config helper
Expand Down Expand Up @@ -103,7 +105,7 @@ func TestRenderAgenticWorkflowsMCPConfigWithOptions(t *testing.T) {
includeCopilotFields: true,
actionMode: ActionModeDev,
expectedContent: []string{
`"agentic_workflows": {`,
`"` + constants.AgenticWorkflowsMCPServerID + `": {`,
`"type": "stdio"`,
`"container": "localhost/gh-aw:dev"`, // Dev mode uses locally built image
`"${{ github.workspace }}:${{ github.workspace }}:rw"`, // workspace mount (read-write)
Expand All @@ -129,7 +131,7 @@ func TestRenderAgenticWorkflowsMCPConfigWithOptions(t *testing.T) {
includeCopilotFields: true,
actionMode: ActionModeRelease,
expectedContent: []string{
`"agentic_workflows": {`,
`"` + constants.AgenticWorkflowsMCPServerID + `": {`,
`"type": "stdio"`,
`"container": "alpine:latest"`,
`"entrypoint": "/opt/gh-aw/gh-aw"`,
Expand All @@ -155,7 +157,7 @@ func TestRenderAgenticWorkflowsMCPConfigWithOptions(t *testing.T) {
includeCopilotFields: false,
actionMode: ActionModeDev,
expectedContent: []string{
`"agentic_workflows": {`,
`"` + constants.AgenticWorkflowsMCPServerID + `": {`,
`"container": "localhost/gh-aw:dev"`, // Dev mode uses locally built image
`"${{ github.workspace }}:${{ github.workspace }}:rw"`, // workspace mount (read-write)
`"/tmp/gh-aw:/tmp/gh-aw:rw"`, // temp directory mount (read-write)
Expand Down Expand Up @@ -300,7 +302,7 @@ func TestRenderAgenticWorkflowsMCPConfigTOML(t *testing.T) {
result := output.String()

expectedContent := []string{
`[mcp_servers.agentic_workflows]`,
`[mcp_servers.` + constants.AgenticWorkflowsMCPServerID + `]`,
tt.expectedContainer,
`args = ["-w", "${{ github.workspace }}"]`, // Docker working directory
`env_vars = ["DEBUG", "GITHUB_TOKEN"]`,
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/mcp_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func (r *MCPConfigRendererUnified) RenderAgenticWorkflowsMCP(yaml *strings.Build
// Per MCP Gateway Specification v1.0.0 section 3.2.1, stdio-based MCP servers MUST be containerized.
func (r *MCPConfigRendererUnified) renderAgenticWorkflowsTOML(yaml *strings.Builder) {
yaml.WriteString(" \n")
yaml.WriteString(" [mcp_servers.agentic_workflows]\n")
yaml.WriteString(" [mcp_servers." + constants.AgenticWorkflowsMCPServerID + "]\n")

containerImage := constants.DefaultAlpineImage
var entrypoint string
Expand Down
11 changes: 7 additions & 4 deletions pkg/workflow/mcp_renderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package workflow
import (
"strings"
"testing"

"github.com/github/gh-aw/pkg/constants"
)

func TestNewMCPConfigRenderer(t *testing.T) {
Expand Down Expand Up @@ -181,8 +183,8 @@ func TestRenderAgenticWorkflowsMCP_JSON_Copilot(t *testing.T) {
if !strings.Contains(output, `"type": "stdio"`) {
t.Error("Expected 'type': 'stdio' field per MCP Gateway Specification")
}
if !strings.Contains(output, `"agentic_workflows": {`) {
t.Error("Expected agentic_workflows server ID")
if !strings.Contains(output, `"`+constants.AgenticWorkflowsMCPServerID+`": {`) {
t.Error("Expected " + constants.AgenticWorkflowsMCPServerID + " server ID")
}
// Per MCP Gateway Specification v1.0.0, stdio servers MUST use container format
// In dev mode, should use locally built image
Expand Down Expand Up @@ -255,8 +257,9 @@ func TestRenderAgenticWorkflowsMCP_TOML(t *testing.T) {
output := yaml.String()

// Verify TOML format (per MCP Gateway Specification v1.0.0)
if !strings.Contains(output, "[mcp_servers.agentic_workflows]") {
t.Error("Expected TOML section header")
expectedHeader := `[mcp_servers.` + constants.AgenticWorkflowsMCPServerID + `]`
if !strings.Contains(output, expectedHeader) {
t.Errorf("Expected TOML section header: %s", expectedHeader)
}
// Per MCP Gateway Specification v1.0.0, stdio servers MUST use container format
// In dev mode, should use locally built image
Expand Down