Skip to content

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

Merged
tiann merged 1 commit into
tiann:mainfrom
heavygee:fix/pi-zod4-schemas-upstream
Jun 29, 2026
Merged

fix(cli): Pi RPC parsers compatible with Zod 4 optional fields#973
tiann merged 1 commit into
tiann:mainfrom
heavygee:fix/pi-zod4-schemas-upstream

Conversation

@heavygee

Copy link
Copy Markdown
Collaborator

Summary

  • Fix Pi RPC schema helpers for Zod 4: missing object keys no longer skip transforms
  • parsePiModels / parsePiCommands check safeParse success explicitly
  • Restores get_available_models / get_commands parsing so wireTransportEvents caches models and commands

Test plan

Issue

Closes #972

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>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings
No findings.

Summary
Review mode: initial
No issues found in the modified Pi RPC parser schema. Residual risk: local automation could not be run in this environment because bun is unavailable.

Testing
Not run (automation): bun not found in runner.

HAPI Bot

@tiann tiann merged commit 8493ec9 into tiann:main Jun 29, 2026
2 checks passed
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.

fix(cli): Pi RPC parsers fail under Zod 4 — get_available_models/get_commands return empty

2 participants