Skip to content
Merged
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
8 changes: 8 additions & 0 deletions pkg/workflow/action_mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,11 @@ func DetectActionMode(version string) ActionMode {
actionModeLog.Printf("Detected dev mode (default): isRelease=%v, ref=%s", IsRelease(), githubRef)
return ActionModeDev
}

// GetActionModeFromWorkflowData extracts the ActionMode from WorkflowData, defaulting to dev mode if nil
func GetActionModeFromWorkflowData(workflowData *WorkflowData) ActionMode {
if workflowData != nil {
return workflowData.ActionMode
}
return ActionModeDev
}
6 changes: 1 addition & 5 deletions pkg/workflow/claude_mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ func (e *ClaudeEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]a
// Create unified renderer with Claude-specific options
// Claude uses JSON format without Copilot-specific fields and multi-line args
createRenderer := func(isLast bool) *MCPConfigRendererUnified {
actionMode := ActionModeDev // Default to dev mode
if workflowData != nil {
actionMode = workflowData.ActionMode
}
return NewMCPConfigRenderer(MCPRendererOptions{
IncludeCopilotFields: false, // Claude doesn't use "type" and "tools" fields
InlineArgs: false, // Claude uses multi-line args format
Format: "json",
IsLast: isLast,
ActionMode: actionMode,
ActionMode: GetActionModeFromWorkflowData(workflowData),
})
}

Expand Down
6 changes: 1 addition & 5 deletions pkg/workflow/codex_mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ func (e *CodexEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]an
// Create unified renderer with Codex-specific options
// Codex uses TOML format without Copilot-specific fields and multi-line args
createRenderer := func(isLast bool) *MCPConfigRendererUnified {
actionMode := ActionModeDev // Default to dev mode
if workflowData != nil {
actionMode = workflowData.ActionMode
}
return NewMCPConfigRenderer(MCPRendererOptions{
IncludeCopilotFields: false, // Codex doesn't use "type" and "tools" fields
InlineArgs: false, // Codex uses multi-line args format
Format: "toml",
IsLast: isLast,
ActionMode: actionMode,
ActionMode: GetActionModeFromWorkflowData(workflowData),
})
}

Expand Down
6 changes: 1 addition & 5 deletions pkg/workflow/copilot_mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ func (e *CopilotEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]
// Create unified renderer with Copilot-specific options
// Copilot uses JSON format with type and tools fields, and inline args
createRenderer := func(isLast bool) *MCPConfigRendererUnified {
actionMode := ActionModeDev // Default to dev mode
if workflowData != nil {
actionMode = workflowData.ActionMode
}
return NewMCPConfigRenderer(MCPRendererOptions{
IncludeCopilotFields: true, // Copilot uses "type" and "tools" fields
InlineArgs: true, // Copilot uses inline args format
Format: "json",
IsLast: isLast,
ActionMode: actionMode,
ActionMode: GetActionModeFromWorkflowData(workflowData),
})
}

Expand Down
6 changes: 1 addition & 5 deletions pkg/workflow/custom_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,12 @@ func (e *CustomEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]a
// Create unified renderer with Custom engine-specific options
// Custom engine uses JSON format without Copilot-specific fields and multi-line args (like Claude)
createRenderer := func(isLast bool) *MCPConfigRendererUnified {
actionMode := ActionModeDev // Default to dev mode
if workflowData != nil {
actionMode = workflowData.ActionMode
}
return NewMCPConfigRenderer(MCPRendererOptions{
IncludeCopilotFields: false, // Custom engine doesn't use "type" and "tools" fields
InlineArgs: false, // Custom engine uses multi-line args format
Format: "json",
IsLast: isLast,
ActionMode: actionMode,
ActionMode: GetActionModeFromWorkflowData(workflowData),
})
}

Expand Down
Loading