Reviewed PR description, comments, commits, and changed files.
UnderstandChecked linked issues and relevant source files.
UnderstandIdentified provider rename causing detection break.
UnderstandVerified changelog entry placement and classification.
UnderstandYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/pull/899/changes
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.
>gh pr view 899 --repo badlogic/pi-mono --json title,body,comments,commits,labels,state,author,headRefName,baseRefName>gh pr diff 899 --repo badlogic/pi-monoLet me check if there are any linked issues and read the relevant source files to validate the changes:
>rg -l "zai" packages/ai/src/ packages/coding-agent/src/ --type ts | head -20>git pull>git pullcontinue
>rg -n "zai-coding-plan" packages/ai/src/env-api-keys.tsThere's an issue: the env-api-keys.ts file still has the old zai key in the envMap, not zai-coding-plan. Let me verify by checking the current state on main:
>rg -n "zai" packages/ai/src/env-api-keys.ts>rg -n '"zai"' packages/ai/src/ packages/coding-agent/src/Now I see the issue. The PR changes packages/ai/src/stream.ts but the actual env key mapping is in packages/ai/src/env-api-keys.ts. The diff shows stream.ts being changed, but that's outdated code. Let me check the current structure more carefully:
>rg -n "getEnvApiKey" packages/ai/src/stream.ts>cat packages/ai/src/stream.ts | head -30I see. The diff shows changes to stream.ts that don't exist on main. The PR is based on an outdated version of main. The getEnvApiKey function used to be in stream.ts but has since been moved to env-api-keys.ts.
Let me also check if the PR has missing package labels and review other aspects:
>gh pr view 899 --repo badlogic/pi-mono --json labelsNow I have a clear picture. The detectCompat function in openai-completions.ts still uses provider === "zai" for detection. The PR needs to update this to provider === "zai-coding-plan".
Let me check the cross-provider-handoff test as mentioned in AGENTS.md:
>rg -n "zai" packages/ai/test/cross-provider-handoff.test.ts 2>/dev/null || echo "File not found">rg -n "zai" packages/ai/test/abort.test.ts packages/ai/test/image-limits.test.ts packages/ai/test/image-tool-result.test.ts 2>/dev/null | head -30I notice the cross-provider-handoff test doesn't include zai (or zai-coding-plan). According to AGENTS.md, new providers should be added to this test.
Now let me check for documentation update requirements:
>rg -n "zai" packages/coding-agent/docs/*.md 2>/dev/null | head -20The thinkingFormat description mentions "zai" which is correct as this is an internal format identifier, not the provider name.
Now let me check if there are any remaining issues to summarize:
>rg -n 'provider === "zai"' packages/ai/src/This is a critical issue. The detectCompat function still checks for provider === "zai" but the PR renames the provider to zai-coding-plan. This will break detection for the new provider name.
Let me also verify the coding-agent changelog entry placement:
I see. The PR has added a changelog entry under ## [0.49.2] - 2026-01-19 which is incorrect. The changelog entry should be under ## [Unreleased]. Additionally, the entry says "Changed" but this is a breaking change since it renames the provider.
Let me verify the exact diff for the coding-agent changelog:
>gh pr diff 899 --repo badlogic/pi-mono | grep -A20 "coding-agent/CHANGELOG"Confirmed: the PR adds a changelog entry to a released version (0.49.2) instead of [Unreleased]. This is a violation of the changelog rules.
PR: https://github.com/badlogic/pi-mono/pull/899
Changelog:
## [Unreleased] → ### Breaking Changes ✅## [0.49.2] (released version) instead of ## [Unreleased]. Must be moved. Also marked as ### Changed but should be ### Breaking Changes since renaming a provider breaks existing configurations.Good:
packages/ai/CHANGELOG.md with correct ### Breaking Changes sectionpackages/coding-agent/README.md with detailed Z.AI Coding Plan notesBad:
env-api-keys.ts not updated - The diff shows changes to stream.ts with an old getEnvApiKey function, but on main this function lives in packages/ai/src/env-api-keys.ts. The PR is based on an outdated main branch. The envMap in env-api-keys.ts still has zai: "ZAI_API_KEY" and needs to be changed to "zai-coding-plan": "ZAI_API_KEY".detectCompat() in openai-completions.ts not updated - Line 754 still checks provider === "zai" but should check provider === "zai-coding-plan". Without this fix, the compatibility detection (thinking format, supportsStore, etc.) will fall back to defaults instead of detecting zai-specific settings.KnownProvider type in types.ts not updated - The diff shows "zai-coding-plan" but main still has "zai". The PR needs rebasing.packages/coding-agent/CHANGELOG.md entry added to released [0.49.2] instead of [Unreleased]pkg:* labels on the PR (should have pkg:ai, pkg:coding-agent, pkg:web-ui, pkg:agent)cross-provider-handoff.test.ts: Per AGENTS.md, new providers should be added to this testUgly:
stream.ts that don't exist on current main). This will cause merge conflicts and the key changes are missing.Questions or Assumptions:
Change summary:
zai → zai-coding-plan to align with models.dev namingZAI_API_KEY configured will need to update their model selections from zai/... to zai-coding-plan/...Tests:
cross-provider-handoff.test.ts entry for zai-coding-plan provider