magic-context icon indicating copy to clipboard operation
magic-context copied to clipboard

pi-magic-context cannot load on OMP 19.2.0: legacy @earendil-works/pi-tui import (0.49.76 also affected)

Open timothyclin opened this issue 1 week ago • 2 comments

Summary

@cortexkit/pi-magic-context fails to load under OMP 19.2.0 because it still imports the removed @earendil-works/pi-tui package. The extension is rejected during startup, so Magic Context is unavailable. The current npm release, 0.49.76, is also affected.

Environment

  • Client: OMP 19.2.0 at failure time; 19.2.1 is now installed. The issue template has no OMP option; the closest is Pi.
  • OS: macOS 27.2.1, arm64
  • Installed versions: 0.49.61 and 0.48.0 in two profiles
  • Current npm latest: 0.49.76
  • Plugin path: ~/.omp/profiles/<profile>/plugins

What happened

After OMP updated from 19.1.1 to 19.2.0, OMP logged the following on every startup. It occurs before any model turn:

Failed to load extension: ... imports "@earendil-works/pi-tui", which omp no longer provides: its component API was replaced by the reactive @oh-my-pi/pi-tui. ...

Disabling the plugin removes the error, but Magic Context is then unavailable.

Expected behavior

The extension loads on OMP 19.2.x and its commands and memory features are available.

Actual behavior

OMP rejects the extension before its factory runs.

Reproduction

  1. Install @cortexkit/[email protected] (or 0.49.76) into an OMP profile.
  2. Start OMP 19.2.0, for example: omp --profile <profile> -p --no-session --no-lsp --no-pty --tools read "x"
  3. Observe the Failed to load extension error during startup.

The same behavior appears in two independent profiles.

Latest release is also affected

@cortexkit/[email protected] still has static imports from @earendil-works/pi-tui in package/dist/index.js at lines 23530, 37704, and 55140. The imports come from commands/pi-command-utils.ts, pi-context-refusal.ts, and dialogs/status-dialog.ts. The package's omp.extensions entry points to the same dist/index.js, so the OMP entry does not avoid the legacy import. Upgrading from 0.49.61 or 0.48.0 does not resolve the load failure.

Upstream context

OMP 19.2.0 lists the extension UI migration as a breaking change: https://github.com/can1357/oh-my-pi/releases/tag/v19.2.0

OMP issue #20517 confirms that the legacy package is no longer supported: https://github.com/can1357/oh-my-pi/issues/20517

Migration guide: https://github.com/can1357/oh-my-pi/blob/main/docs/extensions.md#migrating-from-pi-tui

Sanitized logs

Only the loader-error records are included. User name, home path, profile name, PID, and unrelated fields are removed.

{"timestamp": "2026-11-25T12:53:42.966-05:00", "level": "error", "message": "Failed to load extension", "path": "~/.omp/profiles/<profile-a>/plugins/node_modules/@cortexkit/pi-magic-context/dist/index.js", "error": "Failed to load extension: ~/.omp/profiles/<profile-a>/plugins/node_modules/@cortexkit/pi-magic-context/dist/index.js imports \"@earendil-works/pi-tui\", which omp no longer provides: its component API was replaced by the reactive @oh-my-pi/pi-tui. Return pi-tui nodes (JSX from \"@oh-my-pi/pi-tui\") or a { render(width): string[] } rows object from renderers, ctx.ui.custom and ctx.ui.setWidget; replace ctx.ui.setEditorComponent with the ctx.ui.composer hooks; import Theme types from \"@oh-my-pi/pi-coding-agent\". See docs/extensions.md#migrating-from-pi-tui."}
{"timestamp": "2026-11-25T13:02:27.984-05:00", "level": "error", "message": "Failed to load extension", "path": "~/.omp/profiles/<profile-b>/plugins/node_modules/@cortexkit/pi-magic-context/dist/index.js", "error": "Failed to load extension: ~/.omp/profiles/<profile-b>/plugins/node_modules/@cortexkit/pi-magic-context/dist/index.js imports \"@earendil-works/pi-tui\", which omp no longer provides: its component API was replaced by the reactive @oh-my-pi/pi-tui. Return pi-tui nodes (JSX from \"@oh-my-pi/pi-tui\") or a { render(width): string[] } rows object from renderers, ctx.ui.custom and ctx.ui.setWidget; replace ctx.ui.setEditorComponent with the ctx.ui.composer hooks; import Theme types from \"@oh-my-pi/pi-coding-agent\". See docs/extensions.md#migrating-from-pi-tui."}

Workaround

Disable the extension with omp --profile <profile> plugin disable @cortexkit/pi-magic-context, or stay on OMP 19.1.1 until a compatible release is available.

Diagnostics

I did not run npx @cortexkit/magic-context@latest doctor --issue because the failure occurs in OMP's extension loader before Magic Context starts. I can provide that output from an environment with the extension enabled if it would help.

timothyclin avatar Nov 25 '26 18:11 timothyclin

Thanks for the precise report. This is fixed in 0.49.77, which reached npm about an hour after you filed this.

What was wrong, in two parts: Oh My Pi 19.2.0 refuses any extension that imports @earendil-works/pi-tui, so Magic Context never started. It also refuses the --no-tools flag when an extension is loaded at startup, which broke Magic Context's hidden summary and maintenance runs. 0.49.77 uses the terminal UI of the host it runs in and asks for an empty tool list on Oh My Pi. /ctx-status and the todo list draw the new way on 19.2.

To update, run npx @cortexkit/magic-context@latest doctor, follow the upgrade command it prints for Oh My Pi, and restart Oh My Pi (a /reload does not load an upgraded extension).

We verified it on real Oh My Pi 19.2.0, 19.1.1, 19.0.0 and 18.22, and on plain Pi. We have not tested 19.2.1 yet, which you now have installed. If it still fails to load there, please post the loader error and we'll take it from there.

magic-alfonso[bot] avatar Nov 25 '26 18:11 magic-alfonso[bot]

Closing this as fixed in 0.49.77; the current release is 0.49.100. If the plugin still fails to load on Oh My Pi 19.2.x or newer, please reopen with the Oh My Pi version and the error line, and I will look at it.

magic-alfonso[bot] avatar Dec 02 '26 10:12 magic-alfonso[bot]