Skip to content

fix(coding-agent): prevent model picker exits with compatibility plugins - #12653

Open
wolfiesch wants to merge 2 commits into
can1357:mainfrom
wolfiesch:fix/model-picker-compat-imports
Open

wolfiesch wants to merge 2 commits into
can1357:mainfrom
wolfiesch:fix/model-picker-compat-imports

Conversation

@wolfiesch

Copy link
Copy Markdown
Contributor

What

Restore top-level imports for ModelPickerComponent and ModelHubComponent, replacing their shared synchronous require() loader. Add an isolated subprocess regression that opens the picker with the real compatibility shim installed, renders a model, dismisses the picker with Escape, and verifies that keyboard focus returns to the editor.

Why

On source-linked installs with Bun 1.3.14, pressing Alt+P after compatibility plugins initialize can terminate the session. The deferred require() passes through the process-global legacy-pi resolver and fails with NameTooLong on a repeated file:file:… path. When this exception escapes the key handler, the terminal disconnect path ends the session without showing the underlying loader error.

Related to #12293. This patch addresses the model picker and model hub only; it does not claim to close the whole issue. The provider-auth work in #12271 remains separate.

This deliberately restores eager imports for the two model overlays instead of changing the process-global compatibility resolver. Other deferred components remain unchanged. Startup timing was not measured.

Testing

  • New test/model-picker-compat.test.ts: failed before the fix with the reported NameTooLong error; passes after the fix. Compatibility plugin registration stays inside a child process so it cannot affect later tests.
  • Passed from packages/coding-agent: bun test test/model-picker-compat.test.ts test/model-picker.test.ts test/model-hub.test.ts test/interactive-mode-model-cycle.test.ts.
  • Passed from packages/coding-agent: bun run check (lint, formatting, and types). An existing unused-import warning remains in src/session/session-manager.ts.
  • Exercised the source CLI in a PTY with an explicit extension installing installLegacyPiSpecifierShim(): Alt+P displayed the model picker, Escape dismissed it, and Alt+M displayed the model hub without exiting.
  • Adding test/modes/controllers/selector-controller-login.test.ts to the focused test group exposes the existing auth loader failures. The same failures were reproduced on untouched upstream commit 10b867cb2e, without the new regression test or patch.
  • Packaged binaries and other Bun versions were not exercised. No full workspace check or test suite was run.

  • bun check passes (package scope)
  • Tested locally
  • CHANGELOG updated with the required attribution

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@wolfiesch
wolfiesch marked this pull request as draft September 21, 2026 10:35
@wolfiesch
wolfiesch marked this pull request as ready for review September 21, 2026 10:35
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

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