fix: make quick start rollback on websocket failure
maintainer edit: stage Quick Start edits on a draft config so declining WebSocket/password setup cannot leave saveable provider defaults behind. Align beginner WebUI docs with the password-protected setup.
This commit is contained in:
@@ -1700,14 +1700,17 @@ def _configure_quick_start(config: Config) -> bool:
|
||||
"Quick Start",
|
||||
"Choose provider endpoint, add credentials and model, then enable the local WebUI channel.",
|
||||
)
|
||||
if not _configure_quick_start_provider(config):
|
||||
draft = config.model_copy(deep=True)
|
||||
if not _configure_quick_start_provider(draft):
|
||||
_pause()
|
||||
return False
|
||||
if not _enable_quick_start_websocket_defaults(config):
|
||||
if not _enable_quick_start_websocket_defaults(draft):
|
||||
_pause()
|
||||
return False
|
||||
_show_quick_start_summary(config)
|
||||
_show_quick_start_summary(draft)
|
||||
_pause("Press Enter to save and exit...")
|
||||
for field_name in type(config).model_fields:
|
||||
setattr(config, field_name, getattr(draft, field_name))
|
||||
return True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user