Skip to content

fix(provider): prevent recursive model refresh - #2

Draft
ilimei wants to merge 1 commit into
codex/latest-initial-commitfrom
agent/fix-model-refresh-loop
Draft

fix(provider): prevent recursive model refresh#2
ilimei wants to merge 1 commit into
codex/latest-initial-commitfrom
agent/fix-model-refresh-loop

Conversation

@ilimei

@ilimei ilimei commented Aug 15, 2026

Copy link
Copy Markdown
Owner

What changed

  • Cache empty model-list resolutions when no ZenMux API key is configured.
  • Stop emitting model-change events from inside model discovery.
  • Emit one explicit change event after API key updates.
  • Dispose provider registrations correctly.
  • Bump the extension to 0.1.18.
  • Add regression coverage for empty-cache, invalidation, and interactive refresh behavior.

Root cause

When no API key was stored, model discovery cleared the cache timestamp and emitted onDidChangeLanguageModelChatInformation. VS Code reacted by resolving the provider again, which repeated the same missing-key path and could create an unbounded discovery and UI refresh loop with high Renderer CPU.

Validation

  • pnpm test: 3 tests passed.
  • TypeScript compilation passed.
  • pnpm build packaged a valid 0.1.18 VSIX.
  • VSIX contents exclude source and test files.

Known pre-existing issue

pnpm lint cannot run because the repository uses ESLint 9 without an eslint.config file.

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