Read PR, linked issues, and comments.
UnderstandAnalyzed code changes and main branch files.
UnderstandReviewed documentation for updates.
UnderstandFixed changelog attribution.
EditMerged PR to main branch with updates.
BuildYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/pull/922
For each PR URL, do the following in order:
packages/*/CHANGELOG.md files. Report whether an entry exists. If missing, state that a changelog entry is required before merge and that you will add it if the user decides to merge. Follow the changelog format rules in AGENTS.md. Verify:
### Breaking Changes, ### Added, ### Fixed, etc.)Fixed foo ([#123](https://github.com/badlogic/pi-mono/pull/123) by [@user](https://github.com/user))### Breaking Changes, not just ### FixedOutput format per PR: PR: Changelog:
If no issues are found, say so under Bad and Ugly.
>cd /Users/badlogic/workspaces/pi-mono && gh pr view 922 --json title,body,comments,commits,files,author,state,labels,headRefName,baseRefName>cd /Users/badlogic/workspaces/pi-mono && gh pr diff 922Let me read the linked issue #666:
>cd /Users/badlogic/workspaces/pi-mono && gh issue view 666 --json title,body,comments,labels,stateNow let me read the affected files on main to compare:
Now let me check the coding-agent documentation to see if any updates are needed:
>cd /Users/badlogic/workspaces/pi-mono && ls packages/coding-agent/docs/Now I have all the information needed to provide a comprehensive review.
packages/ai/CHANGELOG.md under ## [Unreleased] in the ### Fixed section- Fixed Bun runtime detection for dynamic imports in browser-compatible modules (stream.ts, openai-codex-responses.ts, openai-codex.ts) ([#922](https://github.com/badlogic/pi-mono/pull/922) by [@dannote](https://github.com/dannote))package.json script changes should have a separate changelog entry, possibly in a top-level changelog or noted somewhere since it affects the build system across all packagesprocess.versions.bun exists in Bun runtime, so checking (process.versions?.node || process.versions?.bun) properly handles both Node.js and Bunpkg:ai label since it modifies packages/ai/*cd && npm run approach relies on shell behavior (each command runs in a subshell, so cd doesn't persist). The chained cd packages/tui && npm run build && cd ../ai && npm run build works because they're in one shell context with &&, but this is fragile. The original -w approach was more declarative.build, dev, dev:tsc, and check, but leaves clean and test using the -w flag. If Bun has issues with -w, those scripts would also fail.-w flag. The workaround in this PR is valid, but the commits referenced by @badlogic (d409b37a, ed042e3d) were never pushed as noted in issue #666. This PR is a re-implementation of a fix that was supposedly already done.package.json scripts. The -w @mariozechner/pkg approach was self-documenting because it used package names.clean and test scripts also be converted to the cd approach for Bun consistency?build, dev, dev:tsc, and check scripts to use cd packages/X && npm run Y instead of npm run Y -w @package-nameprocess.versions?.bun) alongside Node.js detectionbun run build from the repo root and verifying the build completes successfullypackages/coding-agent/README.md or docs. The Bun support mentioned in the README for binary builds still works. This PR fixes bun run build which was broken, but that's a developer concern not documented as a user feature.read package.json and see wtf is up
The current package.json on main still uses the -w @mariozechner/... syntax. The PR wants to change it to the cd packages/X && npm run Y approach.
Looking at the PR diff again:
-"build": "npm run build -w @mariozechner/pi-tui && npm run build -w @mariozechner/pi-ai && ...",+"build": "cd packages/tui && npm run build && cd ../ai && npm run build && ...",The issue mentioned in #666 is that Bun doesn't properly handle npm's -w flag. The workaround replaces workspace filtering with explicit cd commands.
The "wtf" here is that @badlogic claimed in issue #666 (closed) that commits d409b37a and ed042e3d fixed this, but those commits were never pushed to main. The contributor @dannote pointed this out in the issue comments, and this PR is a re-implementation of that supposedly-done fix.
So the current state is:
well, merge via gh cli pull from origin
>cd /Users/badlogic/workspaces/pi-mono && git fetch origin pull/922/head:fix/bun-compatibility && git checkout fix/bun-compatibility && git rebase main>cd /Users/badlogic/workspaces/pi-mono && git checkout main && git merge fix/bun-compatibility --no-ff -m "fix: Bun compatibility for build scripts and runtime detection (#922)"Now let me fix the changelog attribution:
>cd /Users/badlogic/workspaces/pi-mono && npm run check 2>&1>cd /Users/badlogic/workspaces/pi-mono && git add packages/ai/CHANGELOG.md && git commit --amend --no-edit>cd /Users/badlogic/workspaces/pi-mono && git push origin main>cd /Users/badlogic/workspaces/pi-mono && gh pr close 922 --comment "Merged via 2cdf608d. Thanks for the fix!" && git branch -d fix/bun-compatibility>cd /Users/badlogic/workspaces/pi-mono && gh pr comment 922 --body "Thanks for the fix!" && git branch -d fix/bun-compatibilityDone. Merged PR #922 to main:
>git pull- Fixed Bun runtime detection for dynamic imports in browser-compatible modules (stream.ts, openai-codex-responses.ts, openai-codex.ts) ([#922](https://github.com/badlogic/pi-mono/pull/922) by [@dannote](https://github.com/dannote))-"build": "npm run build -w @mariozechner/pi-tui && npm run build -w @mariozechner/pi-ai && ...",+"build": "cd packages/tui && npm run build && cd ../ai && npm run build && ...",