test(desktop): pin ACP availableModels merge for #3934 (#3934) - #5076
Open
iroiro147 wants to merge 1 commit into
Open
test(desktop): pin ACP availableModels merge for #3934 (#3934)#5076iroiro147 wants to merge 1 commit into
iroiro147 wants to merge 1 commit into
Conversation
Closes block#3934. Supersedes block#4048 (rebase). The runtime merge of both ACP model sources was implemented in `desktop/src-tauri/src/commands/agent_models.rs` (`normalize_agent_models`, merged after commit 925a9a7), but no regression test existed for the unstable `availableModels` path. Two unit tests under `desktop/src-tauri/src/commands/agent_models_tests.rs`: 1. `agent_models_populates_unstable_available_models_only_hermes_shape` — reproduces the exact JSON shape Hermes Agent emits (stable `configOptions = null`, `unstable.availableModels = [...]`, plus `unstable.currentModelId`), asserts all three models surface and the desktop default model id resolves from `unstable.currentModelId`. 2. `agent_models_stable_config_options_take_precedence_over_unstable_duplicates` — when a model id appears in both stable `configOptions` and unstable `availableModels`, the stable entry takes precedence for the UI display name (first-seen dedup wins, keeping the stable path authoritative). Rebased onto main @ bd2fdf4; no runtime code change. Signed-off-by: iroiro147 <sarthak.singh@mastersunion.org>
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
Closes #3934. Supersedes #4048 (rebase onto current main @ bd2fdf4).
The runtime merge of both ACP model sources was implemented in
desktop/src-tauri/src/commands/agent_models.rs(normalize_agent_models, merged after commit 925a9a7), but no regression test existed for the unstableavailableModelspath — a silent future regression there would reproduce the bug.Changes
Two unit tests under
desktop/src-tauri/src/commands/agent_models_tests.rs:agent_models_populates_unstable_available_models_only_hermes_shapeReproduces the exact JSON shape Hermes Agent emits:
stable.configOptions = null,unstable.availableModels = [...], plusunstable.currentModelId. Asserts all three models surface and the desktop default model id resolves fromunstable.currentModelId.agent_models_stable_config_options_take_precedence_over_unstable_duplicatesWhen a model id appears in both stable
configOptionsand unstableavailableModels, the stable entry takes precedence for the UI display name — first-seen dedup wins, keeping the stable path authoritative.Why not a code change?
Verified with an isolated structural probe of the
normalize_agent_modelsmerge logic (Python translation, tested against the reported Hermessession/newJSON shape): models ARE surfaced today,currentModelIdmaps todefault, andsupportsSwitchingflipstrue. The reporter on v0.5.2 AppImage is running a binary cut from a release tag older than the 925a9a7 merge. The real fix therefore needs only the next release with these tests to prevent future regressions — no runtime code change required.Test plan
Local cargo-test run is blocked on my machine (missing
binaries/sidecars required bysherpa-onnx-c-apistatic lib, unrelated to the diff) — relying on CI for execution. The diff is strictly additive inside a single test file.Why default path is the right choice
The unstable
availableModelspath is an evolving ACP convention — the route for "the agent carries its own catalog". The stableconfigOptionspath is the blessed route for "the product manages a saved preference". First-seen precedence keeps the promised UX: the user sees the exact display string they selected from the stable catalog (or Hermes's own string when no stable entry exists), anddefaultModelIdnever silently flips to an unstable value the user didn't explicitly confirm.