Skip to main content

migrate_config_with_doctor

Function
This function is defined in the config module.
Apply the declarative migration rules once and stamp config_version. Returns (migrated, applied_reasons). The input is copied shallowly (and per-channel dicts copied) so the caller’s mapping is not mutated in place. Only rules whose detect fires contribute a reason, so a config already at the current shape migrates cleanly with an empty reason list while still receiving the version stamp. This is the single migration executor behind gateway doctor --fix. Raises :class:ConfigVersionError when the config was written by a newer build (its stamp exceeds :data:GATEWAY_CONFIG_VERSION) or the stamp is malformed — an older binary must never downgrade a newer config or drop keys it does not understand.

Signature

Parameters

Dict[str, Any]
required
No description available.

Returns

'Tuple[Dict[str, Any], List[str]]'
The result of the operation.

Uses

  • ConfigVersionError
  • rule.detect
  • rule.fix

Source

View on GitHub

praisonaiagents/gateway/config.py at line 147

Configuration Overview

Agent Config