Skip to content

Saving one model card preserves drafts on the others - #1505

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/preserve-model-card-drafts
Nov 16, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/preserve-model-card-drafts

Conversation

@Maya-Kid

Copy link
Copy Markdown
Contributor

Why

Edit the chat model, then save the embedding card. The shared settings refresh used to restore the old chat model while leaving the card marked as unsaved. Saving a value that the server normalizes back to its previous value could also leave the input unnormalized, and an in-flight save could replace newer edits on the same card.

What changes

Use fetched settings as the baseline and keep a separate draft for each card. A save sends that card's fields and uses saved values for fields that the shared chat/embedding endpoint requires. After a successful readback, discard only the submitted draft if no edits have superseded it. Failed readback can be retried without another PUT.

How it was checked

  • Linux Chromium 145 with mocked settings endpoints. All three regressions reproduced on dev (f33f9fc9). The fixed branch passed those scenarios and the failed-readback retry. Tests inspect the actual PUT payloads and the drafts displayed after refresh.
  • Linux Node 20. All 341 Vitest tests, the bench helper tests, and the web production build passed.

Before review

  • The commit is signed off (git commit -s).
  • Web build and tests pass.
  • New status text is available in English and Chinese.

Signed-off-by: Maya Kid <BinjunYann@gmail.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks — per-card drafts and the identity check on clear look right. Merging.

@WaylandYang
WaylandYang merged commit 40a35bd into deeplethe:dev Nov 16, 2026
6 checks passed
@Maya-Kid
Maya-Kid deleted the codex/preserve-model-card-drafts branch November 29, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants