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
2 changes: 1 addition & 1 deletion pkg/workflow/agent_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (c *Compiler) validateBareModeSupport(frontmatter map[string]any, engine Co

if !engine.GetCapabilities().BareMode {
agentValidationLog.Printf("Engine %s does not support bare mode, emitting warning", engine.GetID())
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Engine '%s' does not support bare mode (engine.bare: true). Bare mode is only supported for the 'copilot' and 'claude' engines. The setting will be ignored.", engine.GetID())))
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Engine '%s' does not support bare mode (engine.bare: true). Bare mode is only supported for the 'copilot', 'claude', and 'pi' engines. The setting will be ignored.", engine.GetID())))

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.

[/codebase-design] The engine name list in this warning is hardcoded and will drift each time a new engine gains BareMode: true — it already required a manual update in this PR.

💡 Suggested fix: derive the list dynamically

Consider building the supported-engines string from the registered engines at runtime, or centralising it as a constant so there is a single place to update:

supported := []string{}
for _, e := range allEngines {
    if e.GetCapabilities().BareMode {
        supported = append(supported, "'"+e.GetID()+"'")
    }
}
msg := fmt.Sprintf("... Bare mode is only supported for the %s engines.", strings.Join(supported, ", "))

This keeps the warning accurate automatically as new engines are added.

@copilot please address this.

c.IncrementWarningCount()
}
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/workflow/engine_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,11 @@ func TestSupportsBareMode(t *testing.T) {
engine: NewClaudeEngine(),
expected: true,
},
{
name: "pi supports bare mode",
engine: NewPiEngine(),
expected: true,
},
{
name: "codex does not support bare mode",
engine: NewCodexEngine(),
Expand Down
1 change: 1 addition & 0 deletions pkg/workflow/pi_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func NewPiEngine() *PiEngine {
MaxContinuations: false,
WebSearch: false,
NativeAgentFile: false,
BareMode: true, // Pi is bare by default; bare mode is a no-op
},
},
}
Expand Down
Loading