fix(config): recover startup from incompatible model settings - #2134
Merged
Conversation
wsp1911
marked this pull request as draft
August 6, 2026 18:49
- Make model normalization and validation capability-aware so speech, image, and embedding models do not inherit text-generation constraints. - Prevent pure speech model sentinels such as context_window=0 and max_tokens=0 from aborting application startup. - Isolate recoverable invalid models, reconcile model references, and preserve structured diagnostics. - Add schema versioning, pre-repair backups, default recovery for malformed configuration, and strict atomic persistence. - Save cloud speech model, speech default, and voice-input settings in one atomic operation. - Expose the new configuration APIs across Desktop, App Server, WebSocket, and Web UI. - Add the reusable bitfun-config-loader and focused regression tests.
- Reserve an 8 MiB stack for the Windows desktop process entry thread. - Set RUST_MIN_STACK before constructing the Tokio runtime. - Preserve configuration recovery and cloud speech command behavior.
wsp1911
marked this pull request as ready for review
August 7, 2026 03:00
- Export TypeScript bindings from bitfun-app-server-protocol before app-server bindings. - Require SaveCloudSpeechConfigRequest and SaveCloudSpeechConfigResult in the API barrel. - Prevent stale local generated files from masking missing CI bindings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #
Type and Areas
Type:
Regression fix / bug fix
Areas:
Rust core, desktop/Tauri, App Server protocol/client, Web UI, services-core, configuration tooling
Motivation / Impact
The configuration manager previously validated every configured model as a text-generation model.
A pure speech-recognition model (
Qwen ASR) contained:ai.models[19].context_window = 0ai.models[19].max_tokens = 0This caused global configuration initialization to fail before the Desktop window was created, making the application appear unable to start.
This change:
Verification
Passed:
cargo test -p bitfun-core --no-default-features --lib service::config— 77 passedcargo test -p bitfun-desktop --lib— 240 passedcargo check -p bitfun-desktopcargo test -p bitfun-app-servercargo test -p bitfun-app-server-protocolcargo test -p bitfun-app-server-clientcargo test -p bitfun-services-core --no-default-features --features json-io --lib json_storepnpm run type-check:webpnpm --dir src/web-ui exec vitest run src/infrastructure/api/service-api/ConfigAPI.test.ts src/infrastructure/api/adapters/websocket-adapter.test.ts— 26 passedpnpm run i18n:auditpnpm run check:core-boundariespnpm run check:core-boundaries:testpnpm run check:repo-hygienegit diff --checkReal configuration verification:
ai.models[19].context_windowai.models[19].max_tokensInteractive UI validation was not performed, in accordance with the repository instructions.
Reviewer Notes
early-startup.log.E:/Projects/OpenBitFun/bitfun-config-loader.Checklist