Skip to content

Migrate @mariozechner/pi-* packages to @earendil-works/pi-* (0.78.0)#3707

Merged
wojtekn merged 13 commits into
trunkfrom
migrate-pi-ai-to-earendil-works
Jun 8, 2026
Merged

Migrate @mariozechner/pi-* packages to @earendil-works/pi-* (0.78.0)#3707
wojtekn merged 13 commits into
trunkfrom
migrate-pi-ai-to-earendil-works

Conversation

@wojtekn

@wojtekn wojtekn commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude Code identified all affected files and performed the migration.

Proposed Changes

The @mariozechner/* npm scope is deprecated — the upstream author has moved to @earendil-works/*. This replaces all four packages (pi-ai, pi-agent-core, pi-coding-agent, pi-tui) from 0.70.2 to 0.78.0 across all package.json files and import statements.

The version jump includes several fixes relevant to Studio:

  • Fixed createAgentSession() failing with ENOENT when package.json is missing next to the bundle entrypoint (directly affects bundled CLI)
  • Fixed Anthropic-compatible requests incorrectly picking up ANTHROPIC_AUTH_TOKEN for non-Anthropic providers
  • Fixed HTTP idle timeout for long-running provider streams
  • Fixed AgentSession retry/compaction/event settlement

Using 0.78.0 rather than 0.78.1 (latest) because 0.78.1 was published June 4 and falls within the dependency cooldown window.

Testing Instructions

  • Run the Studio CLI AI agent flow and verify it starts a session correctly
  • Confirm no TypeScript errors: npm run typecheck

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

The @mariozechner/* npm scope is deprecated in favor of @earendil-works/*.
Updates all four packages (pi-ai, pi-agent-core, pi-coding-agent, pi-tui)
from 0.70.2 to 0.78.0 across package.json files and all import statements.
@wojtekn wojtekn requested review from a team and youknowriad June 5, 2026 08:57
@wpmobilebot

wpmobilebot commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing faeaaad vs trunk

app-size

Metric trunk faeaaad Diff Change
App Size (Mac) 1312.72 MB 1384.35 MB +71.64 MB 🔴 5.5%

site-editor

Metric trunk faeaaad Diff Change
load 1644 ms 1649 ms +5 ms ⚪ 0.0%

site-startup

Metric trunk faeaaad Diff Change
siteCreation 9010 ms 9057 ms +47 ms ⚪ 0.0%
siteStartup 4424 ms 4416 ms 8 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@youknowriad

Copy link
Copy Markdown
Contributor

I noticed warnings about these packages when installing wp-studio, I'll give this a try

@youknowriad

Copy link
Copy Markdown
Contributor

I'm seeing this error

[skills] skills directory not found at /private/var/folders/p3/pg75dppn2bx_09trv09g3fhr0000gn/T/AppTranslocation/B2A11343-B366-46A8-B4A1-9CDD0BF57C44/d/Studio.app/Contents/Resources/cli/skills

I had fixed a similar issue on trunk, so I wonder if a rebase would fix this

@wojtekn

wojtekn commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@youknowriad thanks for checking. I merged the trunk into the branch today, so this code should be there. I will take a look.

@youknowriad

Copy link
Copy Markdown
Contributor

Nevermind, I think I was not testing the right branch

@youknowriad youknowriad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to be working properly for me.

@wojtekn wojtekn merged commit 11ed78b into trunk Jun 8, 2026
11 checks passed
@wojtekn wojtekn deleted the migrate-pi-ai-to-earendil-works branch June 8, 2026 15:31
wojtekn added a commit that referenced this pull request Jun 9, 2026
…e addon segfault (#3740)

## Related issues

- Related to intermittent CI failures on trunk

## How AI was used in this PR

Claude Code investigated the CI failure logs, identified root causes,
and implemented the fixes, after thorough debugging and trying multiple
different approaches.

## Proposed Changes

This PR fixes two distinct Windows CI issues:

**1. Flaky `certificate-manager` test**

The `rejects when sudo.exec reports an error` test was intermittently
failing on Windows CI. Each test called `setPlatform('linux')`
individually, leaving a window where the prior test's `afterEach`
(restoring the platform to `win32`) could race with the next test's
async mock setup. Fixed by moving `setPlatform('linux')` into a
`beforeEach` for the `trustRootCA` describe block so the platform is
guaranteed to be set before any async code runs.

**2. Node.js segfault on Windows CI**

After the `@mariozechner/pi-*` → `@earendil-works/pi-*` 0.78.0 migration
(#3707), the new packages bundle native `.node` addons
(`clipboard-win32`, `win32-console-mode`). When Vitest runs tests in its
default `threads` pool, these native addons are loaded into worker
threads and don't clean up properly on thread exit, causing a segfault
that kills the entire test process.

Fixed by switching the CLI project's Vitest pool from `threads` to
`forks` (`apps/cli/vitest.config.ts`). Each test file now runs in an
isolated child process, so a native addon crash cannot propagate across
files.

The pool change also surfaced two pre-existing test issues in
`export.test.ts` and `import.test.ts`: with `pool:forks`, each test file
runs as a child process which has `process.send` defined. Both commands
use `if (process.send)` to choose between an IPC event handler and a
logger event handler — the tests expect the logger path but were
silently taking the IPC path. Fixed by stubbing `process.send` to
`undefined` in `beforeEach` and restoring via `vi.unstubAllGlobals()` in
`afterEach`.

## Testing Instructions

- `npm test -- apps/cli/lib/tests/certificate-manager.test.ts` — all 10
tests pass
- `npm test -- apps/cli/commands/tests/export.test.ts
apps/cli/commands/tests/import.test.ts` — all 12 tests pass

## Pre-merge Checklist

- [ ] Have you checked for TypeScript, React or other console errors?
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.

3 participants