Skip to content

[plan] Fix engine.version to accept numeric types #8222

@github-actions

Description

@github-actions

Objective

Fix engine.version field to accept numeric types as advertised in schema, preventing silent configuration failures.

Context

The schema defines engine.version as "type": ["string", "number"] with examples [20, 3.11], but the code only accepts strings. Users following schema examples with numeric versions have their configuration silently ignored.

Location: pkg/workflow/engine.go:66-69

Current Implementation

// Only checks string type
if version, hasVersion := engineObj["version"]; hasVersion {
    if versionStr, ok := version.(string); ok {
        config.Version = versionStr
    }
}

Recommended Fix

Apply the pattern already used for max-turns field in the same file (lines 81-87):

if version, hasVersion := engineObj["version"]; hasVersion {
    switch v := version.(type) {
    case string:
        config.Version = v
    case int, int64, uint64:
        config.Version = fmt.Sprintf("%d", v)
    case float64:
        config.Version = fmt.Sprintf("%g", v)
    }
}

Files to Modify

  • Update: pkg/workflow/engine.go (lines 66-69)
  • Update: pkg/workflow/engine_test.go (add test cases)

Acceptance Criteria

  • String versions continue to work: engine.version: "beta"
  • Integer versions work: engine.version: 20
  • Float versions work: engine.version: 3.11
  • Test cases cover all three type scenarios
  • No breaking changes to existing configurations

Estimated Effort

~10 minutes implementation
Related to #8221

AI generated by Plan Command for discussion #8218

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions