Prepare Effect HttpApi backend parity#24853
Open
kitlangton wants to merge 20 commits intodevfrom
Open
Conversation
…ng schemas
Schema.Number emits anyOf:[number, string enum(Infinity/-Infinity/NaN)] in
OpenAPI because JS numbers include non-finite values. Schema.Finite adds an
isFinite check so the OpenAPI output is just {type:"number"}, eliminating
the need for post-hoc normalization in public.ts.
…sform - Replace Schema.Finite with NonNegativeInt/PositiveInt where values are always integers (timestamps, token counts, positions, PIDs, etc.) - Simplify public.ts: remove finite-number normalization, TUI event hoisting, and sync replay inlining (all now handled at schema level) - Add generic self-referencing $ref fixer for Effect OpenAPI generation bug where annotated union arms sharing AST nodes produce circular component schemas - Keep: optional null stripping, workspace re-nulling, SSE response override, instance query param injection, query param type overrides
ebdf382 to
51bc424
Compare
…quest bodies Extends stripOptionalNull to run over every component schema, closing ~200 null-vs-undefined mismatches between Hono and HttpApi SDK output. Removes LegacyBodyRefParameters since components are now pre-cleaned. Adds scripts/diff-sdk-types.sh for comparing Hono vs HttpApi SDK types.
Add ResponseDescriptions map to public.ts transform that overwrites the generic "Success" descriptions with the endpoint-specific descriptions from the Hono spec (115 endpoints).
…r types Add EffectSchema to namedSchemaError for HttpApi OpenAPI generation. Replace Schema.Any + ZodOverride bridges on RetryPart.error and AssistantMessage.error with proper Effect Schema unions, producing concrete discriminated union types in the HttpApi spec instead of unknown.
Add effectPayloads() to BusEvent and SyncEvent that build Effect Schemas from the same registries the Hono spec uses. Wire them into OpenCodeHttpApi via HttpApi.AdditionalSchemas so both specs emit identical Event/SyncEvent component schemas (55 event types).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
groups/*and handlers inhandlers/*.Testing
bun typecheckbun run test:ci test/server/httpapi-bridge.test.tsbun run test:ci test/server/httpapi-bridge.test.ts test/server/httpapi-event.test.ts test/server/httpapi-sdk.test.ts test/server/httpapi-json-parity.test.ts test/server/session-messages.test.ts test/server/session-select.test.ts test/server/project-init-git.test.tsbun run test:ci test/server/httpapi-*.test.tsbun run test:ci