When modifying configuration schemas or adding new configuration options, always ensure backward compatibility with existing deployments. Long-running systems with many user deployments require smooth migration paths from old configurations to new ones.
When modifying configuration schemas or adding new configuration options, always ensure backward compatibility with existing deployments. Long-running systems with many user deployments require smooth migration paths from old configurations to new ones.
Key practices:
Example from model configuration handling:
// Check for new format first
if (defaultModel.includes('@')) {
// New format: model@provider
if (defaultModel in modelTable) {
modelTable[defaultModel].isDefault = true;
}
} else {
// Old format: just model name - find first matching model
for (const key in modelTable) {
if (key.split('@').shift() === defaultModel) {
modelTable[key].isDefault = true;
break;
}
}
}
This approach ensures that users with existing configurations can continue using the system without forced updates, while new users benefit from improved configuration options.
Enter the URL of a public GitHub repository