Skip to content

fix(studio): key Run settings editors by model and quant only - #10869

Closed
Souravrajvi0 wants to merge 1 commit into
unslothai:mainfrom
Souravrajvi0:feat/studio-model-config-editor-key-cf2c
Closed

Souravrajvi0 wants to merge 1 commit into
unslothai:mainfrom
Souravrajvi0:feat/studio-model-config-editor-key-cf2c

Conversation

@Souravrajvi0

@Souravrajvi0 Souravrajvi0 commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stop putting loadedConfig in ModelConfigPage React keys; use modelConfigEditorKey(modelId, ggufVariant) in the sidebar and model picker dropdown.

Live config sync goes through loadedConfigSignature and the shared draft store (#10851, merged).

Test plan

  • Contract tests updated in tests/studio/test_model_picker_contracts.py
  • studio/frontend/tests/hub-runtime-boundary.test.ts
  • Merged latest main and resolved conflicts (draft store + editor keys)

Pairs with #10851 (landed). Follow-up: #10870.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2452c8f95

ℹ️ 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".

return (
<ModelConfigPage
key={modelConfigInstanceKey(modelId, settingsGgufVariant, loadedConfig)}
key={modelConfigEditorKey(modelId, settingsGgufVariant)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep live config changes in the editor key

When the resident configuration arrives or changes without changing the model/quant—for example, after asynchronous status hydration—this stable key preserves the existing ModelConfigPage instance. That component initializes configState from loadedConfig only once via useState(resolveInitial) and has no effect or draft store that synchronizes later prop changes, so the sidebar continues showing saved or previous settings and Reload can overwrite the actual runtime configuration. The same regression exists in the picker replacement at model-selector.tsx:565; retain the config signature in these keys until the claimed live-sync mechanism is included.

Useful? React with 👍 / 👎.

@danielhanchen

Copy link
Copy Markdown
Member

This drops the live-config part of the editor key, which on current main is the only thing that reseeds the Run settings page when status hydrates after it opens, so Apply can write back stale saved values until the shared draft store from #10851 lands. Could you confirm the ordering you want here, or mark this one as stacked on #10851 so it does not merge first?

@Souravrajvi0
Souravrajvi0 force-pushed the feat/studio-model-config-editor-key-cf2c branch 2 times, most recently from 4d2f173 to 7c7b0a3 Compare September 14, 2026 05:22
@Souravrajvi0

Souravrajvi0 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

@danielhanchen — follow-up on merge order (and correcting my earlier note):

The branch is one commit on main again

Intent: merge #10851 first, then this PR. On current main, dropping loadedConfig from the React key would regress live re-seed until the draft store lands; this change is meant to pair with primeModelConfigDraft / loadedConfigSignature from #10851, not to ship ahead of it.

CI: test_active_model_config_round_trips_gpu_fields now expects modelConfigEditorKey in the sidebar (that was the Repo tests CPU failure on the first push).

Happy to mark this blocked on #10851 in the title/description if that helps triage.

@danielhanchen

Copy link
Copy Markdown
Member

On main the editor still seeds its state from loadedConfig once per mounted instance (see the note at the top of model-config/config-signature.ts), so with the shared draft store from #10851 not in yet, dropping loadedConfig from the key looks like it would leave the sidebar showing stale values once the live config lands. Could you confirm the reseed path, or land this together with #10851?

@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

@danielhanchen — thanks for flagging the ordering risk; this is unblocked now that #10851 is on main.

Reseed path (no loadedConfig in the React key):

  • ModelConfigPage calls primeModelConfigDraft(draftKey, …, loadedConfigSignature(loadedConfig)) whenever the live signature changes, so hydration / resident updates re-seed the shared draft instead of relying on a remount.
  • Sidebar + model-picker hosts use key={modelConfigEditorKey(modelId, quant)}, where modelConfigEditorKey is the same normalized draftStorageKey as the draft store — so both editors stay on one draft while live config moves through primeModelConfigDraft.
  • modelConfigInstanceKey(..., loadedConfig) remains in config-signature.ts for signature-based remount semantics elsewhere; this PR only drops config from the editor keys.

This push: merged current main (conflicts in model-config-draft.ts, index.ts, test_model_picker_contracts.py), kept upstream’s draft store + modelConfigEditorKey on draftStorageKey, and fixed pre-commit.ci locally.

Verified:

  • pytest — test_active_model_config_round_trips_gpu_fields, test_the_sidebar_settings_editor_reseeds_when_the_live_config_lands
  • node --test — hub-runtime-boundary.test.ts, model-config-draft.test.ts

Happy to add a short “depends on #10851 (merged)” note in the PR description if you want that visible in triage.

Stop including loadedConfig in ModelConfigPage React keys. Pair with the
shared draft store in unslothai#10851 for live config sync via loadedConfigSignature.
@danielhanchen

Copy link
Copy Markdown
Member

Thanks for the PR, and for following up on the ordering question. Closing this one for now, reasoning below.

On current main the editor re-reads the stored server row (which is where llamaExtraArgs come back from) only when a fresh editor instance mounts; that hydration effect does not depend on liveSignature. useActiveModelConfig on main also does not carry llamaExtraArgs yet (that is #10870, still open). With the React key reduced to model + quant:

  1. The user opens Run settings, the draft is seeded and the server row hydrates the extra args.
  2. Status lands, primeModelConfigDraft sees a new live signature and replaces the draft with the live config, which has no extra args.
  3. No remount, so the hydration mark from step 1 still stands and the row is never re-read. The next Apply reloads without the user's llama extra args.

On main the remount in step 3 releases the draft, clears the mark and re-hydrates, which is why model-config-page.tsx relies on it ("a live change remounts under the same key"). Driving the draft store functions from main directly reproduces this: with the remount the row read re-runs, without it it does not.

There is also no user-facing bug this fixes today; the remount only resets transient UI state. If you want to revisit after #10870 lands, a version that also re-runs the row hydration when the live signature changes, plus a concrete symptom the remount causes, would be a good basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants