Skip to content

fix: send nested request body for workflow config set - #10

Draft
anamhira47 wants to merge 1 commit into
mainfrom
cursor/fix-workflow-config-set-body-d8ea
Draft

fix: send nested request body for workflow config set#10
anamhira47 wants to merge 1 commit into
mainfrom
cursor/fix-workflow-config-set-body-d8ea

Conversation

@anamhira47

Copy link
Copy Markdown
Contributor

Summary

Fixes REV-377: CLI workflow config set command was failing with validation error:

✗ Failed to update run config: Validation error: body.run_config: Field required; body.override_run_config: Field required

Problem

The CLI was sending a flat request body to /api/v1/workflows/update_run_config/{workflow_id}:

{"parallelism": 3, "max_retries": 1}

But the backend expects a nested structure:

{"run_config": {"parallelism": 3, "max_retries": 1}, "override_run_config": true}

Solution

Updated UpdateWorkflowRunConfig in internal/api/client.go to:

  1. Accept an override bool parameter (consistent with sibling methods like UpdateWorkflowLocationConfig and UpdateWorkflowBuildConfig)
  2. Wrap the config in the expected nested body structure with run_config and override_run_config fields

Also updated all callers:

  • CLI command (cmd/revyl/workflow_settings.go) - passes override=true
  • TUI (internal/tui/workflow_mgmt.go) - passes wf.OverrideRunConfig

Added OverrideRunConfig field to the Workflow struct for consistency with other config types.

Testing

  • All existing tests pass
  • The command revyl workflow config set <workflow> --parallel 3 --retries 1 will now send the correct nested body structure

Linear Issue: REV-377

Open in Web Open in Cursor 

The CLI was sending a flat body to the update_run_config endpoint:
  {"parallelism": 3, "max_retries": 1}

But the backend expects a nested structure:
  {"run_config": {"parallelism": 3, "max_retries": 1}, "override_run_config": true}

Changes:
- Update UpdateWorkflowRunConfig to accept an override parameter and wrap
  the body in the expected nested structure (consistent with sibling methods
  like UpdateWorkflowLocationConfig and UpdateWorkflowBuildConfig)
- Add OverrideRunConfig field to Workflow struct for consistency
- Update CLI caller to pass override=true when setting config
- Update TUI caller to pass the workflow's OverrideRunConfig value

Fixes REV-377

Co-authored-by: Anam Hira <anam@revyl.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants