Skip to content

Config: Cannot create new version for legacy configs missing completion.type #605

@vprashrex

Description

@vprashrex

Describe the bug

Legacy configurations in the database do not have the completion.type field.
When updating such configs with a valid type (e.g., "text"), the backend throws an error:

Cannot change config type from 'None' to 'text'. Type is immutable.

To Reproduce

Steps to reproduce the behavior:
For this config_id: c56df7c0-85cf-4d78-9309-9616688f36a8
(This config was created before completion.type became mandatory and does not contain the type field.)

  1. Create a new version for the above config_id
  2. Provide a valid completion configuration with a mandatory type, for example:
{
  "config_blob": {
    "completion": {
      "provider":"openai",
      "type": "text",
      "params": {
        "model": "gpt-4o-mini",
        "temperature": 1,
        "instructions": ""
      }
    }
  },
  "commit_message": ""
}
  1. Submit the request
  2. See error

Expected behavior
The system should allow creating a new version for legacy configurations where completion.type is missing.

Screenshots

Image

Additional context
Options to fix

  1. Database Migration
  • Update all existing records where completion.type is missing → set default "text".
  1. Backend Server to Support for None

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions