Repository navigation
Conversation
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 ZCode integration remaining stuck in Needs Repair (
needs-update) even after clicking Repair / Update Configuration when the selected default model is not already present inpersonalModelIds.Root Cause
standard-personalprovider's active model list frompersonalModelIds, andinspect_zcode_agent_configrequiresdefaultModelSelection.modelIdto be contained inpersonalModelIds.build_zcode_agent_configprunedpersonalModelIdsagainst the live catalog without ever adding the selected default model, while still writing that model todefaultModelSelection. If the user previously hid models in ZCode Model Catalog Settings (or the previous default model disappeared from/v1/models), clicking Repair wrote a config that immediately failedinspect_zcode_agent_configagain.selection_modelagainstordered(which always insertsmodel) prevented falling back toavailable_models[0]whenmodelwas no longer inavailable_models, and unchecking the active default model insave_zcode_editorleftdefaultModelSelectionpointing at a disabled model.Changes
src-tauri/crates/ecpa-agents/src/configuration.rs(build_zcode_agent_config):selection_modelagainstavailable_modelsfirst so removed models properly fall back toavailable_models[0](or keepmodelwhenavailable_modelsis empty).personalModelIdsandmodelOrder.src-tauri/crates/ecpa-agents/src/zcode.rs(save_zcode_editor):cpa-guidefault model is disabled in ZCode Model Catalog Settings while other models remain enabled, updatedefaultModelSelectionto the first remaining enabled model (respectingmodelOrder).src-tauri/crates/ecpa-agents/src/tests/agent_configuration.rs:zcode_preserves_catalog_visibility_and_model_orderto verify both hidden-model preservation when updating with an enabled default model and inclusion of the selected default model when repairing/applying.zcode_repair_includes_selected_default_model_in_personal_model_idsandzcode_catalog_editor_updates_default_model_when_disabling_active_model.Verification
cargo test --manifest-path src-tauri/Cargo.toml -p ecpa-agents zcode): all 29 ZCode tests covering this change passed, including both new regression tests andzcode_agent_config_falls_back_to_an_available_default_model.v0.3.130-test.zcode-repair.1) and verified live against ZCode4.1.2.11125: clicking Repair immediately transitioned ZCode from Needs Repair to Configured, kept existingglm-5.3-flash, added onlyqwenwork/flashtopersonalModelIds, and left all other hidden models untouched.