Skip to content

Load pi-tui only on upstream Pi so Oh My Pi 19.2 loads the extension - #340

Merged
Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi/oh-my-pi-ci-diagnostics
Nov 25, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi/oh-my-pi-ci-diagnostics

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Fixes the Oh My Pi package (19.2.0) CI failure, which also means the Braintrust extension doesn't load for real Oh My Pi 19.2.0 users.

Cause

Oh My Pi 19.2.0 (published 2026-11-25 09:13 UTC) moved extension UI onto its own @oh-my-pi/pi-tui. It now throws PiTuiImportError for any extension source that references @earendil-works/pi-tui or @mariozechner/pi-tui, whether in a static import or a literal dynamic import() (legacy-pi-compat.ts, assertNoPiTuiImport). The changelog says: "Extensions that import bundled or alternate pi-tui packages no longer load."

Our extension did import * as piTui from "@earendil-works/pi-tui" at the top level. Oh My Pi therefore dropped it (Failed to load extension …, visible thanks to this PR's diagnostics), and the daemon received no events. The tool-less requests in the CI logs were harmless side requests that carry no tools key.

One thing I couldn't explain: the job passed on PRs at 15:28 UTC even though 19.2.0 had already been out for 6 hours. It failed on every run from 15:52 on, including main plus diagnostics only.

Fix

  • pi-tui was only used for the clickable status-bar trace link, which Oh My Pi's pi-tui never supported. On Oh My Pi, the extension now skips pi-tui and shows the same plain Braintrust: connected status as before.
  • On other hosts it loads pi-tui lazily through a computed specifier (["@earendil-works", "pi-tui"].join("/")), so Oh My Pi's source scan never sees it. The helpers are cached per extension instance.
  • src/plugins/pi/validate.sh fails if the built dist/index.mjs names upstream pi-tui literally. That guards against a bundler folding the specifier back into a literal. Today's build keeps it computed.
  • Diagnostics: the empty-tool panic now includes the request keys and raw tools field, and the Pi test prints the agent's output. That's how the cause showed up.

Tests

  • New never loads upstream pi-tui under Oh My Pi test. The test mock's host name is now controllable and defaults to upstream Pi, so the existing clickable-link tests run on the upstream path.
  • pnpm run check and all 37 Pi package tests pass.
  • Ran pi_session_emits_traces locally against upstream Pi 1.5.2 with the built extension: it passed in 1.4 s.
  • Oh My Pi 19.2.0 is only verified by this PR's CI. I couldn't install it locally because my npm config blocks packages less than 3 days old.

Oh My Pi 19.2.0 jobs started failing at ~15:52 UTC with dozens of
'offered tools: []' panics and no trace rows, but the logs omit both
Pi's own output and the raw request, so the cause is not visible.
Oh My Pi 19.2.0 throws PiTuiImportError for any extension that imports
@earendil-works/pi-tui, including literal dynamic imports, so it dropped
the Braintrust extension entirely and no traces were captured. pi-tui is
only used for the clickable status-bar trace link, which Oh My Pi never
supported. The extension now skips it on Oh My Pi and loads it on other
hosts through a computed specifier; validate.sh rejects a literal
upstream pi-tui reference in the built entrypoint.
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) changed the title Diagnose Oh My Pi integration test failures Load pi-tui only on upstream Pi so Oh My Pi 19.2 loads the extension Nov 25, 2026
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) marked this pull request as ready for review November 25, 2026 16:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T16:45:22.918343Z 34d55a6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit fd42f39 into main Nov 25, 2026
28 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/oh-my-pi-ci-diagnostics branch November 25, 2026 16:47
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