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:
chengyongru
2026-06-22 13:04:05 +08:00
committed by Xubin Ren
parent 9713fe2a3b
commit 9b52202f4a
5 changed files with 59 additions and 9 deletions
+6 -3
View File
@@ -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