Background
The addModelRevision GraphQL mutation rejects requests that omit ModelConfig.name (and similarly model_path / service.port / service.health_check.path), even though those values are routinely supplied by other layers in the revision merge chain: the runtime variant's default_model_definition, model-definition.yaml in the model vfolder, a revision preset, or another field in the request itself.
Repro
Call addModelRevision without ModelConfigInput.name. Server returns:
{
"errors": [
{
"message": "ModelConfig.name is required",
"path": ["addModelRevision"],
"extensions": { "code": "backendai_generic_internal-error", "serviceName": "strawberry" }
}
],
"data": { "addModelRevision": null }
}
Root cause
src/ai/backend/manager/api/gql/deployment/types/revision.py binds ModelConfigInputGQL / ModelDefinitionInputGQL / ModelServiceConfigInputGQL / ModelHealthCheckInputGQL to the strict ModelConfig / ModelDefinition / ModelServiceConfig / ModelHealthCheck DTOs from common/config.py. The strict types require name, model_path, port, path. The merge-chain semantics expect these to be optional per source layer; the ModelConfigDraft / ModelDefinitionDraft / ModelServiceConfigDraft / ModelHealthCheckDraft variants already exist for that purpose. Today the GQL boundary forbids omitting fields that to_resolved() (called only after the full merge) would happily accept.
Expected behavior
All ModelConfig-related GraphQL input fields that the merge chain can supply (runtime variant default_model_definition, vfolder model-definition.yaml, revision preset, model_mount_destination default) MUST be optional at the GQL boundary. Required-field enforcement stays in ModelConfigDraft.to_resolved() / ModelHealthCheckDraft.to_resolved() / ModelServiceConfigDraft.to_resolved() after the merge.
Acceptance criteria
- ModelConfigInput.name and ModelConfigInput.model_path are nullable in the GraphQL schema.
- ModelServiceConfigInput.port and ModelHealthCheckInput.path are nullable.
- ModelDefinitionInput.models is nullable (a request that overrides nothing should be valid).
- addModelRevision succeeds when name / model_path / port / health_check.path are omitted in the request and the variant / vfolder / preset supplies them.
- Existing requests that DO supply name / model_path continue to work unchanged.
JIRA Issue: BA-5983
Background
The addModelRevision GraphQL mutation rejects requests that omit ModelConfig.name (and similarly model_path / service.port / service.health_check.path), even though those values are routinely supplied by other layers in the revision merge chain: the runtime variant's default_model_definition, model-definition.yaml in the model vfolder, a revision preset, or another field in the request itself.
Repro
Call addModelRevision without ModelConfigInput.name. Server returns:
{ "errors": [ { "message": "ModelConfig.name is required", "path": ["addModelRevision"], "extensions": { "code": "backendai_generic_internal-error", "serviceName": "strawberry" } } ], "data": { "addModelRevision": null } }Root cause
src/ai/backend/manager/api/gql/deployment/types/revision.py binds ModelConfigInputGQL / ModelDefinitionInputGQL / ModelServiceConfigInputGQL / ModelHealthCheckInputGQL to the strict ModelConfig / ModelDefinition / ModelServiceConfig / ModelHealthCheck DTOs from common/config.py. The strict types require name, model_path, port, path. The merge-chain semantics expect these to be optional per source layer; the ModelConfigDraft / ModelDefinitionDraft / ModelServiceConfigDraft / ModelHealthCheckDraft variants already exist for that purpose. Today the GQL boundary forbids omitting fields that to_resolved() (called only after the full merge) would happily accept.
Expected behavior
All ModelConfig-related GraphQL input fields that the merge chain can supply (runtime variant default_model_definition, vfolder model-definition.yaml, revision preset, model_mount_destination default) MUST be optional at the GQL boundary. Required-field enforcement stays in ModelConfigDraft.to_resolved() / ModelHealthCheckDraft.to_resolved() / ModelServiceConfigDraft.to_resolved() after the merge.
Acceptance criteria
JIRA Issue: BA-5983