Skip to content

fix(cli): Pi RPC parsers compatible with Zod 4 optional fields#67

Closed
heavygee wants to merge 1 commit into
mainfrom
fix/pi-zod4-schemas-upstream
Closed

fix(cli): Pi RPC parsers compatible with Zod 4 optional fields#67
heavygee wants to merge 1 commit into
mainfrom
fix/pi-zod4-schemas-upstream

Conversation

@heavygee

Copy link
Copy Markdown
Owner

Summary

  • Fix Pi RPC schema helpers for Zod 4: missing object keys no longer skip transforms
  • parsePiModels / parsePiCommands check safeParse success explicitly
  • Fork-stage cold review before upstream PR to tiann/hapi

Test plan

  • bun typecheck (repo root)
  • cd cli && bun run test src/pi/loop.test.ts — 30/30 pass

Upstream tracking

Upstream issue: tiann#972
Fork proof: heavygee/hapi PR #65 (merged to fork main @ 2a4ae30c)

Disclosure

Drafted with composer via Cursor; reviewed and tested by the human contributor.

asStrOrDef/asOpt* helpers now treat missing keys as undefined so
get_available_models/get_commands parsing works again. safeParse success
checked explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@heavygee heavygee marked this pull request as ready for review June 24, 2026 12:54
@heavygee heavygee added the cold-review-clean Fork-side bot review is satisfactory; safe to promote to upstream PR label Jun 24, 2026
@heavygee

Copy link
Copy Markdown
Owner Author

Fork-stage cold review complete (cold-review-clean). Upstream PR: tiann#973

@heavygee heavygee closed this Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cold-review-clean Fork-side bot review is satisfactory; safe to promote to upstream PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant