Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
58 changes: 0 additions & 58 deletions pkg/workflow/codex_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,64 +531,6 @@ func (e *CodexEngine) GetSquidLogsSteps(workflowData *WorkflowData) []GitHubActi
return defaultGetSquidLogsSteps(workflowData, codexEngineLog)
}

// expandNeutralToolsToCodexTools converts neutral tools to Codex-specific tools format
// This ensures that playwright tools get the same allowlist as the copilot agent
// Updated to use ToolsConfig instead of map[string]any
func (e *CodexEngine) expandNeutralToolsToCodexTools(toolsConfig *ToolsConfig) *ToolsConfig {
if toolsConfig == nil {
return &ToolsConfig{
Custom: make(map[string]MCPServerConfig),
raw: make(map[string]any),
}
}

// Create a copy of the tools config
result := &ToolsConfig{
GitHub: toolsConfig.GitHub,
Bash: toolsConfig.Bash,
WebFetch: toolsConfig.WebFetch,
WebSearch: toolsConfig.WebSearch,
Edit: toolsConfig.Edit,
Playwright: toolsConfig.Playwright,
AgenticWorkflows: toolsConfig.AgenticWorkflows,
CacheMemory: toolsConfig.CacheMemory,
Timeout: toolsConfig.Timeout,
StartupTimeout: toolsConfig.StartupTimeout,
Custom: make(map[string]MCPServerConfig),
raw: make(map[string]any),
}

// Copy custom tools
maps.Copy(result.Custom, toolsConfig.Custom)

// Copy raw map
maps.Copy(result.raw, toolsConfig.raw)

// Playwright is a CLI tool and must not be added to the MCP configuration.
if toolsConfig.Playwright != nil {
applyCodexPlaywrightTool(result, toolsConfig.Playwright)
}

return result
}

func applyCodexPlaywrightTool(result *ToolsConfig, playwright *PlaywrightToolConfig) {
playwrightConfig := &PlaywrightToolConfig{
Version: playwright.Version,
Mode: playwright.Mode,
}
result.Playwright = playwrightConfig
delete(result.raw, "playwright")
}

// expandNeutralToolsToCodexToolsFromMap is a backward compatibility wrapper
// that accepts map[string]any instead of *ToolsConfig
func (e *CodexEngine) expandNeutralToolsToCodexToolsFromMap(tools map[string]any) map[string]any {
toolsConfig, _ := ParseToolsConfig(tools)
result := e.expandNeutralToolsToCodexTools(toolsConfig)
return result.ToMap()
}

// RenderMCPConfig is implemented in codex_mcp.go

// renderCodexMCPConfig is implemented in codex_mcp.go
Expand Down
8 changes: 0 additions & 8 deletions pkg/workflow/codex_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1327,14 +1327,6 @@ func TestCodexEnginePluginConfig(t *testing.T) {
assert.Contains(t, yaml.String(), "GH_AW_CODEX_CONFIG_JSON:")
})

t.Run("normalizes unterminated whitespace-only final config line", func(t *testing.T) {
var yaml strings.Builder
writeIndentedCodexConfig(&yaml, "a = 1\n ")
if got, want := yaml.String(), codexRunBlockIndent+"a = 1\n\n"; got != want {
t.Fatalf("unterminated whitespace-only line was not normalized:\nExpected: %q\nGot: %q", want, got)
}
})

t.Run("accepts nil workflow data", func(t *testing.T) {
var yaml strings.Builder
if err := renderCodexMCPConfigForTest(t, engine, &yaml, map[string]any{}, nil, nil); err != nil {
Expand Down
24 changes: 0 additions & 24 deletions pkg/workflow/codex_mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,6 @@ const (
codexRunBlockIndent = " "
)

// writeIndentedCodexConfig adds the YAML run-block indentation to each custom
// config line. YAML block scalar parsing strips this common indentation before
// the shell runs, so the heredoc receives the original TOML content. Lines that
// contain only whitespace are normalized to empty lines.
func writeIndentedCodexConfig(yaml *strings.Builder, config string) {
outputEndsWithNewline := false
for _, line := range strings.SplitAfter(config, "\n") {
if line == "" {
continue
}
if strings.TrimSpace(line) == "" {
yaml.WriteByte('\n')
outputEndsWithNewline = true
continue
}
yaml.WriteString(codexRunBlockIndent)
yaml.WriteString(line)
outputEndsWithNewline = strings.HasSuffix(line, "\n")
}
if config != "" && !outputEndsWithNewline {
yaml.WriteByte('\n')
}
}

// RenderMCPConfig generates MCP server configuration for Codex
func (e *CodexEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]any, mcpTools []string, workflowData *WorkflowData) error {
if codexMCPLog.Enabled() {
Expand Down
68 changes: 0 additions & 68 deletions pkg/workflow/codex_playwright_test.go

This file was deleted.

4 changes: 0 additions & 4 deletions pkg/workflow/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ func GetLogParserScript(name string) string {
return "EXTERNAL_SCRIPT"
}

func GetLogParserBootstrap() string {
return ""
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing GetLogParserBootstrap is a public API break for any downstream code importing pkg/workflow, so this is not a safe "dead code" deletion.

💡 Why this blocks merge

GetLogParserBootstrap is exported, and pkg/workflow/README.md still lists it as part of the package surface. Internal callsites being gone only proves it is dead inside this repo; external consumers compiling against github.com/github/gh-aw/pkg/workflow will now fail at build time.

Please either keep a deprecated shim that preserves the symbol (it can keep returning ""), or treat this as an intentional breaking change with the corresponding release-note/API-compat path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored the original exported GetLogParserBootstrap() string getter in 8404eeb, preserving its empty-string return value. Added a regression test; the full workflow package test suite passes. This cleanup no longer removes the public symbol.

func GetReadBufferScript() string {
return ""
}
Comment thread
Copilot marked this conversation as resolved.
Resolved
Expand Down
Loading