Repository navigation
Studio: let the API load settings panel forget an entry - #10160
Conversation
… copy left behind
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d30a5ff81d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Reported rather than swallowed: the picker would still apply that copy, and the | ||
| // model's next save mirrors it back to the server the row was just removed from. | ||
| // The list is refetched either way, because the server entry is gone. | ||
| if (!deps.removeLocal(modelId, ggufVariant)) { |
There was a problem hiding this comment.
Preserve local saves made while forgetting remotely
When the same model is saved from another tab, or after navigating to its settings page, while this awaited PUT is still pending, that later user action writes the new config to shared localStorage immediately and may queue or send its server save behind the removal. Once the earlier removal responds, this unconditional cleanup deletes that newer browser config; if the later server save then wins, the API retains the new override while the picker reports it as unremembered. Snapshot the local record at click time and delete it only if it is unchanged, or otherwise serialize the local mutation with saves.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not taking this one. The interleaving is mechanically possible but it needs a save of the SAME model to land in localStorage inside this PUT's own round trip: the request goes to 127.0.0.1 and answers in tens of milliseconds, and reaching the settings page or a second tab and pressing save inside that window is not a session a user can have. The guard is not free either. Since the removal covers several spellings now (cached-repo aliases, the legacy loose-gguf label, and the bare record), 'delete only if unchanged' means a compare-and-swap across every one of them, and a mismatch on any single spelling would have to decide whether to keep the rest, which is a larger correctness surface than the window it closes. If a save can be shown to overlap in practice, the fix belongs in per-model-config as a versioned write rather than in this caller.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0ecb2036a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (variant && !otherQuantsRemain(modelId, variant)) { | ||
| deleted = deletePerModelConfig(modelId, null) && deleted; |
There was a problem hiding this comment.
Base bare-key cleanup on the server's remaining quants
When browser storage and the server map differ, this local-only predicate can make the two sides forget different records. For example, if a failed/offline save left a local repo:Q8 entry that is absent remotely, forgetting the server's last quant makes the backend delete the bare fallback, while otherQuantsRemain preserves the browser's bare copy; that copy can still be applied and later synced back. Conversely, a server-only sibling quant makes the backend retain the bare fallback while this browser deletes it. Pass the remote sibling state used by the backend into this cleanup (or have the remove response report which aliases were deleted) rather than inferring it from localStorage.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not taking this one. The two stores are not required to agree: syncModelOverride is best-effort by design (a failed mirror must not fail the save) and fromApiOverride documents the mirror as lossy, so a local record the server lacks, and the reverse, are states this code already expects. Given that, a local deletion deciding on remote sibling state is the wrong direction: in the first case the browser keeps a bare record for a model it still holds a sibling quant for, which is what the user asked to keep, and in the second it drops a bare record no local quant inherits, since findConfigKeyForModelVariant does not fall back from a variant to the bare key the way the loader does. Neither ends in a wrong load, only in one side outliving the other, which is what a best-effort mirror means. Plumbing the PUT response back through putModelOverride to drive a localStorage delete would make that mirror authoritative for local state, which is a larger change to the contract than the divergence it closes.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Review + GitHub Actions + UI evidencePinned head: A/B on Actions — runThe PR staged on fresh upstream
Positive side, same tests, unmodified tree: 28/28 pass. Whole frontend suite on head: 6565/6565. UI, merge base vs headTwo isolated Studio installs from separate checkouts — BEFORE
Conclusion: on the merge base the deleted folder's entry cannot be removed from anywhere and keeps applying to every API request that names it; on this head one click removes it from the server and from this browser, and the summary counts read correctly at 1. |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Confirmed the panel in studio/frontend/src/features/api-monitor/components/saved-model-settings.tsx has no way to drop an entry once the model is gone from the picker, and the forget path clears both the server keys and the local copy. Will get this reviewed. |
|
Pushed a follow-up onto this branch for the two things that came up in review: two commits on top of The backend now reports what a remove cleared. The remove branch of the overrides route already clears up to four spellings of one model: the resolved target keys, the legacy So the frontend stops mirroring those rules. And the two Forget paths agree. The cleanup runs inside Against a backend that predates Tests are folded into the existing |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Lyxot
left a comment
There was a problem hiding this comment.
Looks good. The remove now reports every key it clears and the browser drops exactly those records, so the two Forget paths agree and the server's alias rules stay in one place instead of being mirrored in the frontend.
Merged current main; backend and frontend tests pass locally against it.
One note for whoever merges: the three red checks are pre-existing on main, not from this branch. The startup bundle is already over budget on main (1564.4 KB there against a 1562.5 KB budget; this branch adds 0.3 KB), the GGUF smoke failure is the temperature-0 determinism check disagreeing with itself across two runs, and the scan-packages digest test fails on main's head too.
…slothai#10289) `Repo tests (CPU)` is red on `main`, on one test out of 15,843, asserting `const writesByKey = new Map<string, Promise<void>>();`. unslothai#10160 is right and reordered nothing. Letting the API load settings panel forget an entry means `putModelOverride` returns a `ModelOverrideWriteResult` carrying `removedKeys` rather than `void`, and the queue it is stored in changed type with it. Three of the test's four assertions still match byte for byte: the key folded through `modelOverrideKey(normalizeModelIdentity, normalizeGgufVariantIdentity)`, the chain on the settled tail, and only the last writer clearing the slot. The one that broke names the promise's value type, and what a write resolves to has nothing to do with the order writes commit in. The assertion now pins serialisation through one in-flight promise per key without naming what that promise resolves to. Re-syncing the literal instead would leave it failing the next time the result type changes, which is a change that reorders nothing; this is the same shape as unslothai#10267 and unslothai#10231. One assertion is added rather than only relaxed, `writesByKey.set(key, write);`. Without the tail being stored, every writer chains on the same empty slot and the ordering is gone, and nothing in the test noticed. Verified by breaking it. Six edits to `model-overrides.ts`, each run against the test, compared with what a plain re-sync of the literal would give: | edit | re-synced literal | this change | | --- | --- | --- | | baseline | passed | passed | | result type changes again, ordering untouched | failed | passed | | the tail is never stored, a real ordering loss | passed | failed | | serialisation removed entirely | failed | failed | | writes no longer chain on the tail | failed | failed | | any writer clears the slot, not just the last | failed | failed | | the key stops folding the identity | failed | failed | The two middle rows are the point: the re-sync stays brittle against a harmless change and stays blind to a real one. `tests/studio/test_model_picker_contracts.py`: 191 passed. No source changes. Staging CI green.

Fixes #10159.
The "Settings applied on API load" panel lists saved model settings but gives you no way to remove one. The only place that can forget an entry is the model's own settings page, and that page only opens for a model still listed in the picker. Custom folder models come from a folder scan, so once you delete the folder the model leaves the picker and the entry is stuck there forever. Deleting a model from inside Studio leaves it stuck too, because nothing clears the entry on delete.
It is worse for custom folder models than for downloaded ones. The entry is keyed by the file path, so a repo from Hugging Face can be downloaded again to reach its settings page, but a deleted local folder never comes back under the same id. The entry keeps applying to every API request that names it and nothing can remove it.
This adds a forget button to each row. It sends the same remove request the settings page sends, so the server drops every version of the key it stores, and it clears the copy saved in the browser so the picker does not put the settings back. The list is refetched afterwards because the server can remove more keys than the panel knows about. If the server refuses, the row stays and an error is shown.
There is no automatic cleanup when a model or a scan folder is deleted. People re-add folders, and quietly throwing away their settings would be worse than leaving them. The button also covers folders deleted outside the app, which nothing on the server could catch.
Also fixes "1 parallel slots" and the same missing plural for checkpoints, GPU layers and MoE layers.