Skip to content

perf(models): speed up removal of active provider connections - #398

Merged
Angnuo (angnuoli) merged 1 commit into
microsofthackathons:mainfrom
angnuoli:codex/provider-remove-default-20261118
Nov 18, 2026
Merged

Angnuo (angnuoli) merged 1 commit into
microsofthackathons:mainfrom
angnuoli:codex/provider-remove-default-20261118

Conversation

@angnuoli

Copy link
Copy Markdown
Collaborator

Description

Removing a Qwen or MiniMax connection while it was selected as the default model fell back to the slower config.apply path because removing its model references disqualified the lightweight write. Use config.set for this removal as well, while still waiting for the saved configuration and runtime revision to agree before completing the MXC transaction.

Changes

  • Share the connection-removal function between settings and the write guard. Only the exact removal of the requested provider and its own model references qualifies for the fast path.
  • Verify both provider absence and the saved agent/model references before reporting success. Preserve concurrency guards, runtime-version checks, and MXC verification.
  • Add regression coverage and real-Gateway comparisons for removal of a selected provider with default, fallback, and model-catalog references; document the production diagnosis and measurements.

Type of Change

  • Bug fix
  • Documentation update

Testing

  • 80 main-process tests: vitest run src/model-config-application.test.ts src/windows-node-mxc-model-config.test.ts
  • 84 renderer tests: vitest run src/utils/model-provider.test.ts src/views/SettingsView.models.test.ts
  • Two isolated OpenClaw 2026.10.10 Gateway integration scenarios, confirming reference removal, applied revision, and no Gateway restart
  • Main/renderer type checks, targeted ESLint, Prettier, and git diff --check
  • Main TypeScript compilation and renderer Vite production build

Warmed isolated measurements for removing the selected provider were 6.966s -> 3.619s and 6.025s -> 3.360s (config.apply -> config.set). Each round has one non-warmup sample per path. These measure configuration write and applied-revision confirmation, excluding outer MXC checks, production plugins, and UI latency.

Checklist

  • Self-reviewed the change
  • Updated the corresponding documentation
  • Added regression tests

@angnuoli
Angnuo (angnuoli) merged commit 10d3f64 into microsofthackathons:main Nov 18, 2026
4 checks passed
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.

1 participant