oracle / oracle/accelerated-data-science
[Bug]: Model custom metadata accepts 16,000 characters but OCI Model Catalog limit is 255
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 124
- Forks
- 67
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 2
Description
Oracle-ads version used
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of oracle-ads.
-
I have confirmed this bug exists on the main branch of oracle-ads.
-
I agree to follow Code of Conduct.
Description
ModelCustomMetadata uses METADATA_VALUE_LENGTH_LIMIT = 16000, so ADS accepts and validates custom-metadata values that OCI Data Science Model Catalog rejects. A synthetic 256-character value passes locally in oracle-ads 2.14.3 and 2.15.3, but CreateModel returns HTTP 400 because the service limit is 255 characters. The constant remains 16000 on main. This was reproduced in us-ashburn-1 with an empty model record, one synthetic custom-metadata value, and no model artifact.
How to Reproduce
import ads
import oci
from ads.model.model_metadata import (
METADATA_VALUE_LENGTH_LIMIT,
ModelCustomMetadata,
)
value = "x" * 256
metadata = ModelCustomMetadata()
metadata.add("metadata_value_limit_reproduction", value)
print(ads.__version__)
print(METADATA_VALUE_LENGTH_LIMIT)
print(metadata.validate())
config = oci.config.from_file()
client = oci.data_science.DataScienceClient(config)
details = oci.data_science.models.CreateModelDetails(
compartment_id="<compartment_ocid>",
project_id="<data_science_project_ocid>",
display_name="ADS metadata value limit reproduction",
custom_metadata_list=[
oci.data_science.models.Metadata(
key="metadata_value_limit_reproduction",
value=value,
category="Other",
has_artifact=False,
)
],
)
client.create_model(details)
What was Observed
Local ADS validation succeeds:
oracle-ads 2.14.3 and 2.15.3
METADATA_VALUE_LENGTH_LIMIT: 16000
metadata.validate(): True
OCI Data Science rejects the CreateModel request:
status: 400
code: InvalidParameter
message: The CustomMetadataValue <256-character value> field value exceeds maximum length of 255
No model resource is created.
What was Expected
ADS metadata validation should match the OCI Data Science Model Catalog API. If 255 characters is the service contract, METADATA_VALUE_LENGTH_LIMIT should remain 255 and ModelCustomMetadata.add()/validate() should reject a 256-character value before CreateModel is called. This also keeps libraries that use the ADS constant for metadata splitting from generating values rejected by OCI.
Version
2.14.3
2.15.3 (latest release as of 2026-08-14)
The main branch also defines METADATA_VALUE_LENGTH_LIMIT = 16000 in ads/model/model_metadata.py.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ads/model/model_metadata.py and inspect METADATA_VALUE_LENGTH_LIMIT plus ModelCustomMetadata.add() and validate(). Run the provided 256-character reproduction and check the existing metadata validation behavior. Done means a 256-character value is rejected locally while values within the OCI 255-character limit remain accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100