Skip to content

fix(desktop): preserve incomplete MoA edits - #63867

Closed
BlackishGreen33 wants to merge 1 commit into
NousResearch:mainfrom
BlackishGreen33:bg/fix-desktop-moa-autosave-63658
Closed

fix(desktop): preserve incomplete MoA edits#63867
BlackishGreen33 wants to merge 1 commit into
NousResearch:mainfrom
BlackishGreen33:bg/fix-desktop-moa-autosave-63658

Conversation

@BlackishGreen33

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #63658.

Changing a MoA reference or aggregator provider clears its model while the user chooses a replacement. The Desktop previously autosaved that incomplete slot, and the normalized response could remove the row from the UI and config.yaml.

This change keeps incomplete edits in the local draft, saves only after every provider/model pair is complete, and ignores older save responses when the user has already made a newer edit.

Related Issue

Fixes #63658

Type of Change

  • Bug fix
  • Tests

Changes Made

  • Cancel any pending MoA autosave when a slot becomes incomplete.
  • Keep incomplete reference and aggregator rows visible until a model is selected.
  • Prevent an older save response from overwriting a newer local edit.
  • Add focused Desktop tests for reference drafts, aggregator drafts, completed saves, and stale responses.

How to Test

npm --workspace apps/desktop run test:ui -- src/app/settings/model-settings.test.tsx
# 11 passed

npm --workspace apps/desktop run typecheck
npx eslint src/app/settings/model-settings.tsx src/app/settings/model-settings.test.tsx
npm --workspace apps/desktop run build
npm audit --workspace apps/desktop
git diff --check

The targeted ESLint command exits successfully. The full Desktop lint still reports four existing import-order errors in files outside this PR.

Checklist

  • Searched open PRs by issue number, behavior, and affected symbols.
  • Kept the change limited to the MoA settings component and focused tests.
  • Added regression coverage for both incomplete slots and stale responses.
  • Verified typecheck, production build, audit, formatting, and diff checks.
  • No config schema, backend API, dependency, documentation, or tool schema changes are required.

Copilot AI review requested due to automatic review settings July 13, 2026 17:01

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Jul 13, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing with credit — this was fixed on main via PR #64976, but you found and fixed this bug first (a day before the PR we salvaged, #64158, was opened). Your implementation had the same correct shape the merged fix ended up with: cancel the pending autosave while a slot is incomplete, save only once every provider/model pair is complete, and guard against stale save responses overwriting newer edits.

The merged version additionally hardens the backend (PUT /api/model/moa now rejects half-filled slots with a 422 naming the broken preset/slot, so no client can trigger the silent defaults swap again) — but the desktop behavior is functionally what you built here.

Apologies for not catching your PR during the duplicate sweep before salvaging — you were the earliest submitter on the client-side fix and we've noted that in #64976. #63658 is being closed as fixed as well. Thanks for the sharp work, and we hope to see more contributions from you.

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

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MoA reference disappears when changing provider because autosave persists an incomplete slot

4 participants