Skip to content

Add RetryDelay to ErrorHandling in WorkflowStep CRD #2773

@JAORMX

Description

@JAORMX

Summary

The VirtualMCPServer CRD's ErrorHandling struct is missing the RetryDelay field that is supported by the implementation.

Current State

Implementation (pkg/vmcp/config/config.go:399-409):

type StepErrorHandling struct {
    // Action: "abort", "continue", "retry"
    Action string `json:"action"`

    // RetryCount is the number of retry attempts (for retry action).
    RetryCount int `json:"retry_count,omitempty"`

    // RetryDelay is the initial delay between retries.
    RetryDelay Duration `json:"retry_delay,omitempty"`
}

CRD (cmd/thv-operator/api/v1alpha1/virtualmcpserver_types.go:274-285):

type ErrorHandling struct {
    // Action defines the action to take on error
    // +kubebuilder:validation:Enum=abort;continue;retry
    // +kubebuilder:default=abort
    Action string `json:"action,omitempty"`

    // MaxRetries is the maximum number of retries
    // Only used when Action is "retry"
    MaxRetries int `json:"maxRetries,omitempty"`
    
    // NO RetryDelay field
}

Impact

Users cannot configure the delay between retry attempts for workflow steps. This is documented in the proposal (docs/proposals/THV-2106-virtual-mcp-server.md:900-903):

on_error:
  action: abort  # abort | continue | retry
  retry_count: 3
  retry_delay: 5s

Proposed Solution

Add to ErrorHandling:

// RetryDelay is the delay between retry attempts
// Only used when Action is "retry"
// +kubebuilder:default="1s"
// +kubebuilder:validation:Pattern=`^([0-9]+(\.[0-9]+)?(ms|s|m))+$`
// +optional
RetryDelay string `json:"retryDelay,omitempty"`

Update the converter to parse and pass through the retry delay.

Related Files

  • pkg/vmcp/config/config.go (implementation)
  • cmd/thv-operator/api/v1alpha1/virtualmcpserver_types.go (CRD)
  • cmd/thv-operator/api/v1alpha1/virtualmcpcompositetooldefinition_types.go (CRD)
  • cmd/thv-operator/pkg/vmcpconfig/converter.go (converter)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgoPull requests that update go codekubernetesItems related to KubernetesoperatorvmcpVirtual MCP Server related issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions