Skip to content

Prepare Effect HttpApi backend parity#24853

Open
kitlangton wants to merge 20 commits intodevfrom
kit/httpapi-dev-beta-default
Open

Prepare Effect HttpApi backend parity#24853
kitlangton wants to merge 20 commits intodevfrom
kit/httpapi-dev-beta-default

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

@kitlangton kitlangton commented Apr 28, 2026

Summary

  • Add the Effect HttpApi server backend path alongside the existing Hono server path, with backend selection logging and request span attributes.
  • Expand generated SDK and route parity coverage across Hono and Effect HttpApi, including auth, streams, sessions, TUI, project git init, and fake-LLM prompt flows.
  • Fix HttpApi parity gaps surfaced by the tests and encode event streams with Effect's SSE helpers.
  • Refactor HttpApi composition into aggregate APIs with separate route contracts in groups/* and handlers in handlers/*.

Testing

  • bun typecheck
  • bun run test:ci test/server/httpapi-bridge.test.ts
  • bun 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.ts
  • bun run test:ci test/server/httpapi-*.test.ts
  • bun run test:ci

@kitlangton kitlangton added beta and removed beta labels Apr 28, 2026
@kitlangton kitlangton removed the beta label Apr 29, 2026
@kitlangton kitlangton changed the title Default dev and beta builds to HttpApi Feature-flag Effect HttpApi backend Apr 29, 2026
@kitlangton kitlangton changed the title Feature-flag Effect HttpApi backend Prepare Effect HttpApi backend parity Apr 29, 2026
…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
@kitlangton kitlangton force-pushed the kit/httpapi-dev-beta-default branch from ebdf382 to 51bc424 Compare April 29, 2026 01:35
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant