Skip to content

fix(pi): publish typed response schemas and strip the $schema meta-ref - #318

Closed
rohitg00 wants to merge 3 commits into
mainfrom
fix/pi-typed-response-schemas
Closed

fix(pi): publish typed response schemas and strip the $schema meta-ref#318
rohitg00 wants to merge 3 commits into
mainfrom
fix/pi-typed-response-schemas

Conversation

@rohitg00

Copy link
Copy Markdown
Contributor

pi merged in #314 but cannot publish: the worker-interface CI gate and the registry validator both reject its schemas.

What this fixes

  1. Untyped response schemas — the interface collector rejects functions whose response_schema is the empty/AnyValue node. Every pi:: function declared only request_format, so response_schema was untyped. Declares a typed response_format on all eight functions plus pi::on-config-change.
  2. $schema meta-ref — the registry publish validator has no draft-2020-12 meta-schema registered, so the $schema key z.toJSONSchema stamps at the root fails publish with no schema with key or ref ...draft/2020-12/schema. A jsonSchema() helper strips the root $schema from every request and response format, and runtimeJsonSchema does the same.

Status and sessions::list responses carry a concrete SessionRecord schema rather than an open record, so the published nested schema is fully typed.

Validation

  • Every emitted format verified against the collector's typed-keyword rule (passes) and confirmed to carry no $schema key.
  • typecheck clean, lint clean, 69 tests pass.

Note for the team

Both gates are new. claude-code and codex declare only request_format and do not strip $schema, so both will fail the same two gates on their next release. They are grandfathered until then.

rohitg00 added 3 commits June 23, 2026 16:31
CI's worker-interface gate rejects untyped (AnyValue/empty) response
schemas. Declare a typed response_format on every pi:: function via
z.toJSONSchema, and give pi::on-config-change a typed request_format plus
a null response_format. All schemas satisfy the collector's typed-keyword
check; 69 tests still pass.
Replace the open z.record(z.string(), z.unknown()) in the status and
sessions::list response schemas with a concrete SessionRecordSchema, so
the published nested schema carries the real record contract instead of
an empty additionalProperties node.
The registry publish validator has no draft-2020-12 meta-schema
registered, so the $schema key z.toJSONSchema stamps at the root fails
publish with 'no schema with key or ref ...draft/2020-12/schema'. Add a
jsonSchema() helper that strips the root $schema from every request and
response format, and do the same in runtimeJsonSchema. Schemas stay
typed; 69 tests pass.
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jun 23, 2026 3:52pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@rohitg00, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 39 minutes and 39 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ddf5fd80-44c7-43ac-b454-267c81a35ca0

📥 Commits

Reviewing files that changed from the base of the PR and between c6a7351 and 409e785.

📒 Files selected for processing (3)
  • pi/src/config.ts
  • pi/src/configuration.ts
  • pi/src/run.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pi-typed-response-schemas

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 25 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@rohitg00

Copy link
Copy Markdown
Contributor Author

Superseded by a clean branch. #318 re-included the typed-schema commits already merged in #317 and carried a lint error from a rebase artifact. The only outstanding fix is the $schema strip, opened fresh off current main.

@rohitg00 rohitg00 closed this Jun 23, 2026
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.

1 participant